public void refereeInit(MultiplayerGameManager <Player> gameManager)
        {
            if (Constants.VERBOSE_LEVEL > 1)
            {
                Console.WriteLine("New game");
            }

            RefereeParams _params = new RefereeParams(gameManager);

            DraftPhase.Difficulty difficulty;
            switch (gameManager.getLeagueLevel())
            {
            case 1:
                difficulty = DraftPhase.Difficulty.VERY_EASY;
                break;

            case 2:
                difficulty = DraftPhase.Difficulty.EASY;
                break;

            case 3:
                difficulty = DraftPhase.Difficulty.LESS_EASY;
                break;

            default:
                difficulty = DraftPhase.Difficulty.NORMAL;
                break;
            }


            Constants.LoadCardlist("main\\resources\\cardlist.txt");
            if (Constants.VERBOSE_LEVEL > 1)
            {
                Console.WriteLine("   CARDSET with " + Constants.CARDSET.Count + " cards loaded.");
            }
            if (Constants.VERBOSE_LEVEL > 1)
            {
                Console.WriteLine("   Difficulty is set to: " + difficulty.ToString() + ".");
            }

            draft = new DraftPhase(difficulty, _params);
            draft.PrepareChoices();

            if (Constants.VERBOSE_LEVEL > 1)
            {
                Console.WriteLine("   Draw Phase Prepared. " + draft.allowedCards.Count + " cards allowed. ");
            }
            if (Constants.VERBOSE_LEVEL > 1)
            {
                Console.WriteLine("   " + draft.draftingCards.Count + " cards selected to the draft.");
            }

            gameManager.setMaxTurns(Constants.MAX_TURNS_HARDLIMIT); // should be never reached, not handled on the referee's side
        }
Example #2
0
        public GameState(DraftPhase draft)
        {
            //assert(draft.decks[0].Count == Constants.CARDS_IN_DECK);
            //assert(draft.decks[1].Count == Constants.CARDS_IN_DECK);

            turn          = -1;
            winner        = -1;
            currentPlayer = 1;
            players       = new Gamer[] { new Gamer(0, draft.decks[0]), new Gamer(1, draft.decks[1]) };

            cardIdMap = new Dictionary <int, Card>();
            for (int i = 0; i < 2; i++)
            {
                foreach (Card c in draft.decks[i])
                {
                    cardIdMap[c.id] = c;
                }
            }
        }