public void AddShip (ActorShip Ship) { if (!ships.Contains (Ship)) { ships.Add (Ship); Ship.fleet = this; } }
public void RemoveShip (ActorShip Ship) { if (ships.Contains (Ship)) { ships.Remove (Ship); if (Ship.fleet == this) { Ship.fleet = null; } } }
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); }
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; }
public void SetDefaultFlagShip () { if (ships != null && ships.Count > 0) { flagShip = ships [0]; } else { flagShip = null; } }
public Fleet (ActorShip Ship):this(new List<ActorShip>(){Ship}) { }
public override void Destroy () { base.Destroy (); ClearAllShips (); ships = null; flagShip = null; homeColony = null; Finder.fleetDatabase.Remove (this); }
public void RemoveGarrisonedShip (ActorShip ship) { garrisonedShips.Remove (ship); }
public void AddGarrisonedShip (ActorShip ship) { garrisonedShips.Add (ship); }