示例#1
0
        public override void HandleInput(GameTime gameTime, InputState input)
        {
            PlayerIndex playerIndex;

            if (menuAccept.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                aiFlag = 1;
                game.SetAiFlag(aiFlag);

                OpponentAI ai = new OpponentAI(game);
                game.Components.Add(ai);
                ai.LoadCursor(game);

                game.Services.AddService(typeof(OpponentAI), ai);
                PlayerManager tempRef = (PlayerManager)game.Services.GetService(typeof(PlayerManager));
                tempRef.LoadAI(game);

                ExitScreen();
            }
            if (menuCancel.Evaluate(input, ControllingPlayer, out playerIndex))
            {
                aiFlag = 0;
                game.SetAiFlag(aiFlag);
                ExitScreen();
            }
        }
示例#2
0
 public void LoadAI(Game1 game)
 {
     ai = (OpponentAI)game.Services.GetService(typeof(OpponentAI));
 }