Exemplo n.º 1
0
        Color tmpColor = Color.Green; // testing engine - changing color

        public UserInterface(Player player1, Player player2, FontPack fontPack, DataCollector data)
        {
            FocusID         = 0;
            NumberOfButtons = 5;
            FontPack        = fontPack;
            Player1         = player1;
            Player2         = player2;
            PrevState       = Keyboard.GetState();
            Buttons         = new Button[5];
            CreateButtons(Buttons);
            UpgradeFocus = false;
            Data         = data;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     data    = new DataCollector();
     bot     = new Bot();
     win     = new Win();
     player1 = new Player(Size, 1, data);
     player2 = new Player(Size, 2, data);
     TexturePack.TexturePackLoad(this);
     fontPack      = new FontPack(this);
     userInterface = new UserInterface(player1, player2, fontPack, data);
     GameEventEngine.Add(new GameEventCyclic(() => {
         if (player1.IsInactive == true)
         {
             LearnInputOutput learning = new LearnInputOutput(player2.ListOfForces, player1.ListOfForces, player1.Upgrades, player1.Cash, 5);
             data.WriteToFile(learning);
         }
         else
         {
             player1.IsInactive = true;
         }
     }, 15, int.MaxValue));
     base.Initialize();
 }