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; }
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); }
public static Squad GetRandomSquad(IFootballDatabase db, string name, string formation) => new Squad(name, db.GetCardOfType(ZoneType.GK), GetSquadZones(db, formation), formation);
public Deck(IFootballDatabase db) { deck = new Stack <FootballCard>(db.GetCards(DECK_SIZE)); }