/// <summary> /// Manages all aspects of Planetary Invasion. /// </summary> /// <param name="Content">Content Manager</param> /// <param name="planetLevel">Level to play on.</param> public PlanetStateManager(SpriteBatch spriteBatch, ClientManager clientManager, HudElementManager hudElementManager, ParticleManager particleManager, PhysicsManager physicsManager, ProjectileManager projectileManager, ShipManager shipManager, TextureManager textureManager, WarpHoleManager warpHoleManager, SpaceStateManager spaceStateManager, MessageManager messageManager, IBus bus, DebugTextManager debugTextManager, TargetingManager targetManager, TeamManager teamManager, ConfigPlanetStateUI uiConfig, GameWindow window) : base(particleManager, physicsManager, targetManager, teamManager) { _clientManager = clientManager; _spriteBatch = spriteBatch; _hudElementManager = hudElementManager; _shipManager = shipManager; _textureManager = textureManager; _projectileManager = projectileManager; _warpHoleManager = warpHoleManager; _spaceStateManager = spaceStateManager; _messageManager = messageManager; _bus = bus; _debugTextManager = debugTextManager; _UI = new PlanetStateUI(uiConfig, shipManager.GetPlayerEnergy); _UI.RegisterInstructionCallback("ToggleColonizeMode", ToggleColonizeMode); _UI.RegisterInstructionCallback("TurretClicked", ToggleStructurePlacementMode); _UI.RegisterInstructionCallback("MissileClicked", _UIFireAmbassador); Turrets = new List <Turret>(); Camera = new Camera2D(); updateWatch = new Stopwatch(); drawWatch = new Stopwatch(); Windows = new List <BaseUI>(); Camera.Zoom = 1f; PotentialTurretTargets = new Dictionary <int, ITargetable>(); _bus.Subscribe(this); this.OnStructureRemoved += PlanetStateManager_OnStructureRemoved; }
public SpaceStateManager(IBus bus, ContentManager Content, GraphicsDeviceManager graphics, SpriteBatch spriteBatch, ChatManager chatManager, HudElementManager hudElementManager, ParticleManager particleManager, PhysicsManager physicsManager, ProjectileManager projectileManager, ShipManager shipManager, SpaceManager spaceManager, WarpHoleManager warpholeManager, TextureManager textureManager, TargetingManager targetManager, TeamManager teamManager, ConfigSpaceStateUI uiConfig) : base(particleManager, physicsManager, targetManager, teamManager) { State = GameStates.loading; _bus = bus; _spaceManager = spaceManager; _chatManager = chatManager; _hudElementManager = hudElementManager; _physicsManager = physicsManager; _projectileManager = projectileManager; _shipManager = shipManager; _spriteBatch = spriteBatch; _warpholeManager = warpholeManager; _textureManager = textureManager; _UI = new SpaceStateUI(uiConfig, uiConfig.GameWindow, shipManager.GetPlayerEnergy); _UI.RegisterInstructionCallback("TurretClicked", ToggleStructurePlacementMode); _UI.RegisterInstructionCallback("MissileClicked", _UIFireAmbassador); rotationalCamera = new RotationalCamera(chatManager); Camera = new Camera2D(); Windows = new List <BaseUI>(); _bus.Subscribe(this); State = GameStates.updating; }