Пример #1
0
        public string accuseRound()
        {
            Dictionary <String, int> possibleAccuses = infoSet.getPossibleAccuses();

            for (int i = 0; i < Constants.N; i++)
            {
                List <PlayerNode> accuseSample = new List <PlayerNode>();
                accuseSample.Add(new MaxNode(player.getPlayerName(), player.getCharName(), infoSet));
                accuseSample.AddRange(infoSet.Sample(player.getCharName()));

                RolloutGame game;

                foreach (string possibleAccuse in infoSet.getPossibleAccuses().Keys)
                {
                    List <PlayerNode> accuseSampleGame = accuseSample.Select(x => x.Copy()).ToList();

                    game = new RolloutGame(accuseSampleGame, General.GameStates.ACCUSE, player.getCharName());
                    possibleAccuses[possibleAccuse] += game.sampleGame(possibleAccuse);
                }
            }

            return(possibleAccuses.FirstOrDefault(x => x.Value == possibleAccuses.Values.Max()).Key);
        }
Пример #2
0
        public string talkRound()
        {
            //Value of the talks, every one has a 0 value in the beginning.
            Dictionary <String, int> possibleTalks = infoSet.getPossibleTalks();

            for (int i = 0; i < Constants.N; i++)
            {
                List <PlayerNode> accuseSample = new List <PlayerNode>();
                accuseSample.Add(new MaxNode(player.getPlayerName(), player.getCharName(), infoSet));
                accuseSample.AddRange(infoSet.Sample(player.getCharName()));

                RolloutGame   game;
                List <String> possibleTalksCopy = new List <String>(possibleTalks.Keys);
                foreach (string possibleTalk in possibleTalksCopy)
                {
                    List <PlayerNode> accuseSampleGame = accuseSample.Select(x => x.Copy()).ToList();

                    game = new RolloutGame(accuseSampleGame, General.GameStates.TALK, player.getCharName());
                    possibleTalks[possibleTalk] += game.sampleGame(possibleTalk);
                }
            }

            return(possibleTalks.FirstOrDefault(x => x.Value == possibleTalks.Values.Max()).Key);
        }