public SolarSystem(int X, int Y, Universe here) { // Get the system data here in the constructor // to avoid passing our (huge) galaxy object into yet another sub routine. CStar star = null; bool[] orbits = new bool[8]; int[] PlanetTypes = new int[8]; for (int i = 0; i < 8; i++) { orbits[i] = false; Planets[i] = null; } here.GetStarAtLocation(X, Y, ref star); if (star != null) { for (int i = 0; i < star.NumberOfPlanets; i++) { CPlanet planet = null; int orbitnum; star.GetPlanet(i, ref planet); orbitnum = planet.Orbit; orbits[orbitnum - 1] = true; Planets[orbitnum - 1] = planet; planetrefs[orbitnum - 1] = i; } } EllipsePoints(); SetplanetXY(); for (int i = 0; i < 8; i++) { if (orbits[i]) { picframe[i] = GetPicFrame(Planets[i].PClass); //PlanetTypes(i)) 'We have a planet, get it's picture planethere[i] = true; } else { planethere[i] = false; } } }
/* Constructors for the OuterSpace Form. */ public OuterSpace() { InitializeComponent(); // Initialize game managers theRaceMgr = new RaceMgr(); theWindowMgr = new WindowMgr(); // The crew manager is initialized AFTER the race manager since crews require races theCrewMgr = new CrewMgr(); theGameState = new CGameState(); // Initialize the title screen and game options MainTitle = new CTitleScreen(); // Get the screen resolution to use clientArea.Width = MainTitle.options.GetScreenWidth(); clientArea.Height = MainTitle.options.GetScreenHeight(); // Make the title screen draw first if (theGameState.IsGameInState(GameStates.MainTitle)) MainTitle.SetState(0); // Set the window size or screen resolution this.ClientSize = new Size(clientArea.Width, clientArea.Height); // Window or Full Screen mode? if (OuterSpace.IsWindowMode == true) this.FormBorderStyle = FormBorderStyle.FixedToolWindow; starport = new CStarPort(); // load the galaxy file the user selects. theVerse = new Universe(); // *** THE FOLLOWING IS COMMENTED OUT BUT SHOULD REMAIN FOR FUTURE REFERENCE UNTIL DEAMED UNECESSARY *** // //Dim aRace As Race = theRaceMgr.GetRace("Vulcan") //Dim crew(4) As CrewMember //crew(0) = New CrewMember(theCrewMgr.GetNextKey(), 1, "John Smith", 50, 50, 50, 50, 50, 0) //theCrewMgr.HireCrewMember(crew(0)) //crew(1) = New CrewMember(theCrewMgr.GetNextKey(), 2, "Pon Far", 50, 50, 50, 50, 50, 0) //theCrewMgr.HireCrewMember(crew(1)) //crew(2) = New CrewMember(theCrewMgr.GetNextKey(), 3, "Rommy", 50, 50, 50, 50, 50, 0) //theCrewMgr.HireCrewMember(crew(2)) //crew(3) = New CrewMember(theCrewMgr.GetNextKey(), 4, "Worf", 50, 50, 50, 50, 50, 0) //theCrewMgr.HireCrewMember(crew(3)) //theCrewMgr.Train(1, 4, 3) //theCrewMgr.Train(1, 3, 10) //theCrewMgr.Train(2, 0, 3) //theCrewMgr.Train(3, 2, 3) //theCrewMgr.Train(4, 1, 3) msgbox = new Messages(); playership = new vehicleStats(); TV = new vehicleStats(); debugfile = new DebugOutput(debugdir + "Debug-Out.txt"); // Set the parameters of the Terrian Vehicle. TV.stellerSpeed = 0.03f; TV.systemSpeed = 0.03f; TV.combatSpeed = 0.03f; TV.thetadif = 1; TV.yawdif = 1; // Setup other ships for (int i = 0; i < MAXOTHERSHIPS; i++) { otherships[i] = new vehicleStats(); otherships[i].shipName = null; } // Set up a refrence table for costly trigometric function caclulations. for (int i = 0; i < 360; i++) { TanRef[i] = (float)Math.Tan(i * (Math.PI / 180)); moveX[i] = (float)Math.Cos(i * (Math.PI / 180)); moveY[i] = (float)Math.Sin(i * (Math.PI / 180)); } TanRef[0] = 0.0f; moveX[0] = 1.0f; moveY[0] = 0.0f; TanRef[180] = 0.0f; moveX[180] = -1.0f; moveY[180] = 0.0f; TanRef[90] = (float)Math.Tan(90.1 * (Math.PI / 180)); moveX[90] = 0.0f; moveY[90] = 1.0f; TanRef[270] = (float)Math.Tan(270.1 * (Math.PI / 180)); moveX[270] = 0.0f; moveY[270] = -1.0f; moveX[360] = 1.0f; moveY[360] = 0.0f; // Set up initial game clock theGameClock = new CGameClock(2317, 3, 2, 0); // Windows.Forms.Cursor.Hide() this.Cursor.Dispose(); this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); }