Ejemplo n.º 1
0
		public Fleet (List<ActorShip> Ships = null, ActorShip FlagShip =null, Colony HomeColony =null)
		{
			name = "Fleet " + (Finder.fleetDatabase.Count + 1);
			ships = new List<ActorShip> ();
			AddMultipleShips (Ships);
			SetDefaultFlagShip ();
			homeColony = HomeColony;
			Interval = 5;
			//
			selectedLine = new VectorLine ("Selected_" + name, new Vector3[8], null, 3.0f);
			selectedLine.color = Color.magenta;
			Finder.fleetDatabase.Add (this);
		}
Ejemplo n.º 2
0
		public static List<ActorShip> AddShip (int qty, float x, float z, float y, int systemID=-1, Colony homeColony = null, bool isConstructed=false)
		{
			if (systemID == -1) {
				systemID = GameManager.currentGame.currentSystemID;
			}
			List<ActorShip> ships = new List<ActorShip> ();
			for (int i =0; i<qty; i++) {
				ActorShip act;
				act = new ActorShip ();
				act.Init ("");
				act.isConstructed = isConstructed;
				act.homeColony = homeColony;
				if (homeColony != null) {
					act.MoveCenterTo (homeColony.parent.Center);
					act.system = homeColony.parent.system;
				} else {
					act.MoveCenterTo (new Vector3 (x, y, z));
					act.system = GameManager.currentGame.planetarySystems [systemID];
				}
				ships.Add (act);
			}
			return ships;
		}
Ejemplo n.º 3
0
		public void SetHomeColony (Colony HomeColony)
		{
			homeColony = HomeColony;
		}
Ejemplo n.º 4
0
		public override void Destroy ()
		{
			base.Destroy ();
			ClearAllShips ();
			ships = null;
			flagShip = null;
			homeColony = null;
			Finder.fleetDatabase.Remove (this);
		}
Ejemplo n.º 5
0
		public void Destroy ()
		{
			thing = null;
			colony.RemoveConstructionJob (this);
			colony = null;
		}
Ejemplo n.º 6
0
		public ConstructionJob (Colony tColony, Thing tThing)
		{
			thing = tThing;
			colony = tColony;
			constructionPoints = thing.constructionPointsRequired;
		}
Ejemplo n.º 7
0
		public static List<ActorShip> AddShip (int qty, Vector3 position, int systemID=-1, Colony homeColony = null, bool isConstructed=false)
		{
			return AddShip (qty, position.x, position.y, position.z, systemID, homeColony, isConstructed);
		}
Ejemplo n.º 8
0
		public override void SetConstructed (bool value)
		{
			base.SetConstructed (value);
			homeColony = _homeColony;
		}
Ejemplo n.º 9
0
		public override void Destroy ()
		{
			base.Destroy ();
			fleet.RemoveShip (this);
			if (homeColony != null) {
				homeColony.RemoveGarrisonedShip (this);
				homeColony = null;
			}
		}