////////////////////////////////////////////////////////////////// //Constructors public GalacticGameEngine() { ID = ""; Name = ""; Player1 = new Player(); _gameIsRunning = false; curGalacticDayMang = new GalacticDayManager(); curGameUniverse = new GameUniverse(); MainMapControl = new Controls.GameEngineControls.GalacticMapControl(); TopBarControl = new Controls.GameEngineControls.GameTopBarControl(); RightBarControl = new Controls.GameEngineControls.GameRightBarControl(); LeftPlanetMenu = new Controls.PlanetsInGalaxyMenu(); RightPlanetMenu = new Controls.PlanetsInGalaxyMenu(); LeftPlanetOrbitMenu = new Controls.PlanetOrbitControl(); InfoMenu = new Controls.GameInformationMenu(); PlanetCommandMenu = new Controls.PlanetCommandControl(); ConstructionMenu = new Controls.GameEngineControls.ConstructionMenuControl(); }
public void updateTopBarData(GameDrawClassComponents curGameDrawComponents, GameEngine.Player curPlayer, GameEngine.GalacticDayManager curGalacticDayMang) { int activeGameDayToShow = curGalacticDayMang.CurrentGalacticDay; //X:103 Y:10 Vector2 curGameDayVector = new Vector2(103, 4); curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, activeGameDayToShow.ToString(), curGameDayVector, Color.Black); int rawMaterialsToShow = curPlayer.curGameResourceMang.invRawMaterials; Vector2 curRMsVect = new Vector2(400, 4); curGameDrawComponents._spriteBatch.DrawString(curGameDrawComponents._staticFonts._courierNew, rawMaterialsToShow.ToString(), curRMsVect, Color.Black); }
public Owner(GameEngine.Player _player) { Name = _player.UserName; player = _player; _neutral = false; }
//Methods public void startNewGame(string gameID, string gameName, string userName, string factionName, GameUpdateClassComponents curGameUpdateClassComponents) { ID = gameID; Name = gameName; _gameIsRunning = true; //Start at galactic day 1 curGalacticDayMang.CurrentGalacticDay = 1; //Create player 1. Give him 5 resources for the hell of it... Player1 = new Player(userName, factionName, 5); //Build the Galaxies and planets from the XML file curGameUniverse.TheUniverse = Model.DataUtilities.getGalaxiesFromXML(); buildGameControls(curGameUpdateClassComponents); //Get all the units from XML files staticDataCards = new Model.StaticDataCards(); GameEngine.StartingGameUnits startingUnits = Model.DataUtilities.getStartingSettingsFromXML(factionName, staticDataCards); Player1.curGameResourceMang.invRawMaterials = startingUnits.startingResources; curGameUniverse.getPlanetByName("Coruscant").Owner = new GameEngine.GalacticComponents.Owner(Player1); foreach (GameEngine.PlayerInvObjs.InvUnit curInvObj in startingUnits.startingUnits) { curInvObj.FacilityOwner = new GameEngine.GalacticComponents.Owner(Player1); //curInvObj.iuFacility._underConstruction = false; //.player = Player1; if (curInvObj.invUnitType == Model.DataCardType.Facility) {//Add Facilities to the ground curGameUniverse.getPlanetByName(curInvObj.startingLocation).GroundSpaces.Facilities.Add(curInvObj); } else if (curInvObj.invUnitType == Model.DataCardType.Ship) {//Add Ships to the orbit curGameUniverse.getPlanetByName(curInvObj.startingLocation).Orbit.StarshipFleetsInOrbit.Add(curInvObj); } else if (curInvObj.invUnitType == Model.DataCardType.Troops) {//Add Troops to the ground curGameUniverse.getPlanetByName(curInvObj.startingLocation).GroundSpaces.Troops.Add(curInvObj); } //Player1.playerUnits.Add(new GalacticConquest.GameEngine.PlayerInvObjs.InvUnit(curFacil)); } //Player1.playerUnits //DataCards.GameUnit curUnit = new GalacticConquest.DataCards.Ship(); }