예제 #1
0
 public Game(IFootballDatabase database, IBall ball)
 {
     db        = database;
     players   = new List <Player>();
     this.ball = ball;
     Deck      = new Deck(db);
     success   = new Success(this);
     MovesLeft = MOVES_AMOUNT;
 }
예제 #2
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);
        }
예제 #3
0
 public static Squad GetRandomSquad(IFootballDatabase db, string name, string formation) =>
 new Squad(name, db.GetCardOfType(ZoneType.GK), GetSquadZones(db, formation), formation);
예제 #4
0
 public Deck(IFootballDatabase db)
 {
     deck = new Stack <FootballCard>(db.GetCards(DECK_SIZE));
 }