Esempio n. 1
0
 public MaryBottins()
 {
     Dynamite             = new Dynamite();
     GameplayScores       = new GameplayScores();
     PredictOpponentMoves = new Dictionary <Move, MovePredictionData>();
     PredictMyMoves       = new Dictionary <Move, MovePredictionData>();
     MoveArray            = new[] { Move.R, Move.P, Move.S, Move.W, Move.D };
     SuggestMove          = new SuggestMove();
     foreach (var move in MoveArray)
     {
         MovePredictionData p1predictMoves = new MovePredictionData(move);
         MovePredictionData p2predictMoves = new MovePredictionData(move);
         PredictMyMoves.Add(move, p1predictMoves);
         PredictOpponentMoves.Add(move, p2predictMoves);
     }
 }
Esempio n. 2
0
        public Move MakeMove(Gamestate gamestate)
        {
            Round[] rounds = gamestate.GetRounds();
            if (rounds != null && rounds.Length > 2)
            {
                Move suggestedMove;
                Move predictedMove;
                UpdateClasses(rounds);
                var rand = new Random();
                int pick = rand.Next(5);
                switch (pick)
                {
                case 0:
                case 1:
                case 2:
                    //case 3:
                    predictedMove = PredictOpponentMoves[rounds.Last().GetP2()].PredictAMove();
                    suggestedMove = SuggestMove.CounterTheirMove(predictedMove);
                    break;

                //case 2:
                //case 3:
                //case 3:
                case 6:
                    predictedMove = PredictMyMoves[rounds.Last().GetP1()].PredictAMove();
                    suggestedMove = SuggestMove.CounterMyMove(predictedMove);
                    break;

                case 3:
                case 4:
                    suggestedMove = SuggestMove.GuessAMove();
                    break;

                default:
                    suggestedMove = Move.P;
                    break;
                }

                var moveToMake = Dynamite.ShouldDynamiteBePlayed(GameplayScores, suggestedMove);
                return(moveToMake);
            }

            return(Move.P);
        }