예제 #1
0
        public CardCommunity drawCommunity()
        {
            CardCommunity res = communityCards[0];

            communityCards.RemoveAt(0);
            //If it's the "Get out of jail" card
            if (res.getId() != 8)
            {
                communityCards.Insert(communityCards.Count(), res);
            }
            return(res);
        }
예제 #2
0
 public void init(string pathToCommunity, string pathToChance)
 {
     try
     {
         communityCards = File.ReadAllLines(pathToCommunity).Skip(1).Select(v => CardCommunity.FromCsv(v)).ToList();
         chanceCards    = File.ReadAllLines(pathToChance).Skip(1).Select(v => CardChance.FromCsv(v)).ToList();
         shuffle(communityCards);
         shuffle(chanceCards);
     }
     catch (DirectoryNotFoundException e)
     {
         Form_board.GetInstance.insert_console("Error : Cannot find path : " + e);
     }
 }