Exemple #1
0
 public WindmillMenu(Game game) : base(game)
 {
     this.releaseBtnPos   = new Point(game.GraphicsDevice.Viewport.Width - 10 - 64, 120); //Fill free to place this button where ever you want
     this.buildingsParent = game.Components.OfType <BuildingsParent>().ElementAt(0);
     this.buildingsParent.GetMayorObject(ref this.mayorObject);
     this.mayorObject.WindmillExists   = true;
     this.mayorObject.OnRecallFarmers += new Mayor.RecallFarmers(mayorObject_OnRecallFarmers);
     this.mayorObject.OnAddFarmers    += new Mayor.AddFarmers(mayorObject_OnAddFarmers);
 }
Exemple #2
0
 public MarketMenu(Game game) : base(game)
 {
     this.releaseBtnPos   = new Point(game.GraphicsDevice.Viewport.Width - 10 - 64, 120); //Fill free to place this button where ever you want
     this.buildingsParent = game.Components.OfType <BuildingsParent>().ElementAt(0);
     this.buildingsParent.GetMayorObject(ref this.mayorObject);
     this.mayorObject.MarketExists     = true;
     this.mayorObject.OnRecallSellers += new Mayor.RecallSellers(mayorObject_OnRecallSellers);
     this.mayorObject.OnAddSellers    += new Mayor.AddSellers(mayorObject_OnAddSellers);
     this.inputManager    = game.GetService <InputManager>();
     this.EnabledChanged += new EventHandler <EventArgs>(MarketMenu_EnabledChanged);
 }
Exemple #3
0
 /// <summary>
 /// Retrievs all services and components needed to start the game
 /// </summary>
 private void GetComponentsServicesToEnable()
 {
     this.cameraService   = this.Game.GetService <CameraService>();
     this.pickingService  = this.Game.GetService <PickingService>();
     this.gameScreen      = this.Game.Components.OfType <GameScreen>().ElementAt(0);
     this.gameField       = this.Game.Components.OfType <GameField>().ElementAt(0);
     this.humansParent    = this.Game.Components.OfType <HumansParent>().ElementAt(0);
     this.buildingsParent = this.Game.Components.OfType <BuildingsParent>().ElementAt(0);
     this.resourcesParent = this.Game.Components.OfType <ResourcesParent>().ElementAt(0);
     this.menuCaller      = this.Game.Components.OfType <MenusCaller>().ElementAt(0);
     this.resourcesHUD    = this.Game.Components.OfType <ResourcesHUD>().ElementAt(0);
 }
Exemple #4
0
 public void SetBuildingsResourcesParent(ref BuildingsParent buildingsParent, ref ResourcesParent resourcesParent)
 {
     this.buildingsParent = buildingsParent;
     this.resourcesParent = resourcesParent;
 }