コード例 #1
0
        public static SpaceVehicle testShip(SimulatedEmpire emp, Design <Ship> design, int ID)
        {
            SimulatedSpaceObject simveh = new SimulatedSpaceObject((SpaceVehicle)design.Instantiate());

            simveh.SpaceObject.ID = ID;
            SpaceVehicle spaceveh = (SpaceVehicle)simveh.SpaceObject;

            spaceveh.Owner = emp.Empire;
            emp.SpaceObjects.Add(simveh);
            return(spaceveh);
        }
コード例 #2
0
        public void setupEnvironment0()
        {
            location = new Sector(sys, new System.Drawing.Point());

            SimulatedEmpire simemp = new SimulatedEmpire(testships2.empire("TestEmpOne", new Culture(), new Race()));
            Design <Ship>   design = testships2.EscortDUC(gal, simemp.Empire, testships2.Components(gal));
            SpaceVehicle    sv     = testships2.testShip(simemp, design, 100);

            location.Place(sv);

            battle = new Battle_Space(location);
        }
コード例 #3
0
        private void btnDuplicateEmpire_Click(object sender, EventArgs e)
        {
            foreach (var simemp in Empires.Where(se => lstEmpires.HasItemSelected(se)).ToArray())
            {
                var newse = new SimulatedEmpire(simemp.Empire);

                // no duplicate empire names!
                if (Empires.Any(se => se.Empire.Name == newse.Empire.Name))
                {
                    newse.Empire.Name = "Empire #" + newse.Empire.ID;
                }

                Empires.Add(newse);
            }
            BindEmpireList();
        }
コード例 #4
0
        public void setupEnvironment1()
        {
            location = new Sector(sys, new System.Drawing.Point());

            SimulatedEmpire simemp0 = new SimulatedEmpire(testships2.empire("TestEmpOne", new Culture(), new Race()));
            SimulatedEmpire simemp1 = new SimulatedEmpire(testships2.empire("TestEmpTwo", new Culture(), new Race()));
            Design <Ship>   design0 = testships2.EscortCSM(gal, simemp0.Empire, testships2.Components(gal));
            Design <Ship>   design1 = testships2.EscortDUC(gal, simemp1.Empire, testships2.Components(gal));

            SpaceVehicle sv0 = testships2.testShip(simemp0, design0, 100);
            SpaceVehicle sv1 = testships2.testShip(simemp1, design1, 200);

            location.Place(sv0);
            location.Place(sv1);

            battle = new Battle_Space(location);
        }