public void ProcessGame(float frameDeltaTime) { bool skipUpdate = false; bool handleTaskBar = false; if (_currentScreen != Screen.MainMenu && _currentScreen != Screen.NewGame && _currentScreen != Screen.Battle) { handleTaskBar = true; } if (handleTaskBar) { if (_situationReport.Update(MousePos.X, MousePos.Y, frameDeltaTime)) { skipUpdate = true; } } if (!skipUpdate) { _screenInterface.Update(MousePos.X, MousePos.Y, frameDeltaTime); } _screenInterface.DrawScreen(); if (handleTaskBar) { _situationReport.DrawSitRep(); } Cursor.Draw(MousePos.X, MousePos.Y); Cursor.Update(frameDeltaTime, Random); }
public void Update(int x, int y, float frameDeltaTime) { _pathSprite.Update(frameDeltaTime, _gameMain.Random); _gameMain.Galaxy.Update(frameDeltaTime, _gameMain.Random); if (_taskBar.MouseHover(x, y, frameDeltaTime)) { return; } if (_windowShowing != null) { _windowShowing.MouseHover(x, y, frameDeltaTime); return; } Empire currentEmpire = _gameMain.EmpireManager.CurrentEmpire; if (currentEmpire.SelectedSystem != null) { if (_systemView.MouseHover(x, y, frameDeltaTime)) { return; } } if (currentEmpire.SelectedFleetGroup != null) { if (_fleetView.MouseHover(x, y, frameDeltaTime)) { return; } if (currentEmpire.SelectedFleetGroup.SelectedFleet.Empire == currentEmpire) { Point hoveringPoint = new Point(); hoveringPoint.X = (int)((x / _camera.ZoomDistance) + _camera.CameraX); hoveringPoint.Y = (int)((y / _camera.ZoomDistance) + _camera.CameraY); StarSystem selectedSystem = _gameMain.Galaxy.GetStarAtPoint(hoveringPoint); currentEmpire.SelectedFleetGroup.FleetToSplit.SetTentativePath(selectedSystem, currentEmpire.SelectedFleetGroup.FleetToSplit.HasReserveTanks, _gameMain.Galaxy); RefreshETAText(); } } _camera.HandleUpdate(frameDeltaTime); }