// Use this for initialization void Start() { Colony = StarSystem.GetSpaceTile(Location); StarSystem.TimeController.TimeObjects.Add(this); var sp = GetComponent <SpriteRenderer>(); sp.sprite = StarSystem.Spritemanager.GetSprite("colony"); ColonyAction = ColonyAction.Mining; Attributes = GetComponent <ColonyAttributes>(); init = true; }
void Build() { if (design != null) { buildLeft -= Buildrate; if (buildLeft < 0) { Empire.CreateEntity(Location, design); design = null; ColonyAction = ColonyAction.Mining; } } }
public bool BuildShip(ShipDesign design) { if (ColonyAction != ColonyAction.Building && Empire.Resouces > design.Cost) { ColonyAction = ColonyAction.Building; this.design = design; buildLeft = (design.BaseComponents.Count * 10) + design.MaxHp; Empire.Resouces -= design.Cost; return(true); } return(false); }