public PlacingSoldiersState(Game game) : base(game) { game.Services.AddService(typeof(IPlacingSoldiersState), this); buildingBoardState = (BuildingBoardState)game.Services.GetService(typeof(IBuildingBoardState)); celAnimationManager = (ICelAnimationManager)game.Services.GetService(typeof(ICelAnimationManager)); scrollingBackgroundManager = (IScrollingBackgroundManager)game.Services.GetService(typeof(IScrollingBackgroundManager)); inputHandler = (IInputHandler)game.Services.GetService(typeof(IInputHandler)); }
protected override void LoadContent() { base.LoadContent(); buildingBoardState = (BuildingBoardState)OurGame.Services.GetService(typeof(IBuildingBoardState)); connection = startMenuState.connection; flags = new string[19]; for (int i = 0; i <= 18; i++) { flags[i] = OurGame.countryList.ElementAt <string>(i); } currFlag = 1; bg = Content.Load <Texture2D>(@"Textures\backgroundShip"); main = Content.Load <Texture2D>(@"Textures\Controls\choose_flag_menu"); left = new Button(OurGame, OurGame.button_texture, OurGame.font30) { Text = "Left", Position = new Vector2(Game1.screen_width / 4, Game1.screen_height - Game1.screen_height / 4) }; left.Click += Left_Click; right = new Button(OurGame, OurGame.button_texture, OurGame.font30) { Text = "Right", Position = new Vector2((Game1.screen_width / 4) * 3 - left.Rectangle.Width, Game1.screen_height - Game1.screen_height / 4) }; right.Click += Right_Click; select = new Button(OurGame, OurGame.button_texture, OurGame.font30) { Text = "Select", Position = new Vector2((Game1.screen_width / 2) - left.Rectangle.Width / 2, Game1.screen_height / (2 * 3)) }; select.Click += Select_Click; OurGame.Components.Add(left); OurGame.Components.Add(right); OurGame.Components.Add(select); }