Пример #1
0
    public static GameState GenerateGameState(string newGameId,
                                              int howManyPlayers,
                                              List <string> playersNicknames,
                                              string firstPlayerNickname)
    {
        string newId        = newGameId;
        var    mainDeck     = DeckGenerator.GenerateActionsDeck();
        var    animalsDeck  = DeckGenerator.GenerateAnimalsDeck();
        var    goodsDeck    = DeckGenerator.GenerateGoodsDeck();
        var    projectCards = PrepareProjectCards(mainDeck, howManyPlayers);
        var    players      = PreparePlayers(animalsDeck, goodsDeck, howManyPlayers, playersNicknames);
        var    bonuses      = PrepareAvailableBonuses(howManyPlayers);

        return(new GameState(newId,
                             players,
                             mainDeck,
                             animalsDeck,
                             goodsDeck,
                             projectCards,
                             bonuses,
                             Round.A,
                             firstPlayerNickname,
                             1,
                             players.Count,
                             false));
    }