public inGameButtons(inGame_menu form, ref tempMap gameData, ref List <Unit>[] allUnits) { InitializeComponent(); this.focus_form = form; this.allUnits = allUnits; //do not copy want pointers //this.gameData = gameData; this.BackgroundImage = new Bitmap(@"data\img\Texture.png"); HumanMove_Button(); HumanArmor1_Button(); HumanWeapon1_Button(); Repair_Button(); Mine_Button(); BuildSimple_Button(); ChickenFarm_Button(); TownHall_Button(); HumanBarracks_Button(); HumanLumberMill_Button(); HumanBlacksmith_Button(); ScoutTower_Button(); Cancel_Button(); Peasant_Button(); TownHall_Button(); Keep_Button(); Footman_Button(); HumanPatrol_Button(); Archer_Button(); //Upgrade buttons Ranger_Button(); humanArrow2_Button(); humanArrow3_Button(); HumanArmor2_Button(); HumanArmor3_Button(); HumanWeapon2_Button(); HumanWeapon3_Button(); Keep_Button(); castle_Button(); HumanGuardTower_Button(); HumanCannonTower_Button(); longbow_Button(); rangerScouting_Button(); rangerUpgrade_Button(); marksmanship_Button(); hideButtons(); this.KeyDown += new KeyEventHandler(inGame_menu_KeyDown); this.KeyUp += new KeyEventHandler(inGame_menu_KeyDown); //add to key release too this.builder = new BuildCapabilities(); //init this.playerChoice = SplashScreen.mapUnits.playerChoice; this.gameData = gameData; }
public void reloadBuilder(ref tempMap gameData, ref List <Unit>[] allUnits) {//function for reloading building data //call this function when we load new map this.playerChoice = SplashScreen.mapUnits.playerChoice; this.mode = 0; //reset mode builder = null; builder = new BuildCapabilities(); //init new builder this.gameData = gameData; this.allUnits = allUnits; }
//PlayerChoice is the AI player number (not our playerchoice) public BasicAI(int playerChoice, ref List <Unit>[] allUnits, ref tempMap gameData, int numPlayers, Microsoft.Xna.Framework.Graphics.GraphicsDevice g) { this.playerNum = playerChoice; this.workingUnit = new int[this.numUnits]; this.gameData = gameData; this.numPlayers = numPlayers; this.allUnits = allUnits; this.builder = new BuildCapabilities(); this.g = g; this.waitTimer = (gameData.DConstructTime + 1) * 10; //a default wait and try again timer reCalcUnits(); //init calculations }