예제 #1
0
        private static Dictionary <ZoneType, List <FootballCard> > GetSquadZones(IFootballDatabase db,
                                                                                 string formation)
        {
            int[] eachzoneSize = formation.Split('-').Select(int.Parse).ToArray();
            var   squad        = new Dictionary <ZoneType, List <FootballCard> >
            {
                { ZoneType.DEF, db.GetCards(eachzoneSize[0]).ToList() },
                { ZoneType.MID, db.GetCards(eachzoneSize[1]).ToList() },
                { ZoneType.ATT, db.GetCards(eachzoneSize[2]).ToList() }
            };

            return(squad);
        }
예제 #2
0
        public void AddPlayer(string name, string squadFormation, string squadName)
        {
            ValidateFormation(squadFormation);
            var squad = Squad.GetRandomSquad(db, squadName, squadFormation);

            players.Add(new Player(name, squad, new Hand(db.GetCards(10).ToList()), ball));
        }
예제 #3
0
 public Deck(IFootballDatabase db)
 {
     deck = new Stack <FootballCard>(db.GetCards(DECK_SIZE));
 }