Пример #1
0
        public static Disaster Random()
        {
            Random random     = new Random();
            int    nLifelines = random.Next(1, 10);

            Lifeline[] lifelines = new Lifeline[nLifelines];
            for (int i = 0; i < nLifelines; i++)
            {
                Lifeline lifeline = Extensions.GetRandomLifeline();
                lifelines[i] = lifeline;
            }
            Disaster disaster = new Disaster("Hurricane", lifelines);

            return(disaster);
        }
Пример #2
0
        static Game NewGame()
        {
            Disaster disaster = Disaster.Random();

            int            handCount = 5;
            List <OpsCard> hand      = new List <OpsCard>();

            for (int i = 0; i < handCount; i++)
            {
                hand.Add(OpsCard.Random());
            }

            Game game = new Game(disaster, hand);

            return(game);
        }
Пример #3
0
 public Game(Disaster disaster, List <OpsCard> hand)
 {
     this.disaster = disaster;
     this.hand     = hand;
 }