public Industry(SubStarBody parent, IndustryConstruction[] construction) { this.construction = construction == null ? new IndustryConstruction[0] : construction; this.parent = parent; stats = new IndustryStats(); stats.CalculateStats(this); }
public void SetSubStarBody(SubStarBody subStarBody) { this.subStarBody = subStarBody; ssoName.text = subStarBody.name; parent = frame.GetComponent <RectTransform>(); Debug.Log(parent); CalcParams(); Draw(); }
public Hub(SubStarBody body) { if (body == null) { throw new System.Exception(); } this.body = body; this.storage = AddStorage(); this.industry = AddIndustry(); this.market = AddMarket(); this.dock = AddDock(); }
public static Storage CreateStorage(GoodsStack[] initGoods, SubStarBody body) { Storage storage = new Storage(body); if (initGoods != null) { for (int i = 0; i < initGoods.Length; i++) { storage.Add(initGoods[i]); } } return(storage); }
public void AddTestResources(SubStarBody body) { foreach (var construction in body.hub.industry.construction) { foreach (var item in construction.recipe.perTurn) { if (item.amount < 0) { Add(new GoodsStack { id = item.goodsId, amount = (int)(item.amount * Settings.Industry.PROCESSING_RESERV_TURN * -1) });; } } } }
public static Industry TestCreateFullIndustry(SubStarBody body) { Industry industry = new Industry(body, null); List <IndustryConstruction> constructions = new List <IndustryConstruction>(); if (body.resourcer == null) { industry.construction = new IndustryConstruction[] { CreateIndustryConstruction(null) }; industry.stats.CalculateStats(industry); return(industry); } for (int i = 0; i < body.resourcer.resourceDeposits.Length; i++) { constructions.Add(CreateIndustryConstruction(body.resourcer.resourceDeposits[i])); } industry.construction = constructions.ToArray(); industry.stats.CalculateStats(industry); return(industry); }
private void Calculate(SubStarBody planet) { resources = new List <ResourceDeposit>(); values = new List <List <int> >(); List <int> temp = new List <int>(); for (int i = 0; i < planet.resourcer.resourceDeposits.Length; i++) { if (!resources.Exists(x => x.idResource == planet.resourcer.resourceDeposits[i].idResource)) { resources.Add(planet.resourcer.resourceDeposits[i]); values.Add(new List <int> { planet.resourcer.resourceDeposits[i].extraction }); continue; } int index = resources.FindIndex(x => x.idResource == planet.resourcer.resourceDeposits[i].idResource); values[index].Add(planet.resourcer.resourceDeposits[i].extraction); } foreach (var item in values) { item.Sort((x, y) => y - x); } }
public Storage(SubStarBody body) { parent = body; }
public static void Tick(SubStarBody station, IndustryConstruction module) { behav.Tick(new ManufactureWrapper { body = station, module = module }); }
public Resourcer(ResourceDeposit[] resourceDeposits, SubStarBody parent) { this.resourceDeposits = resourceDeposits == null ? new ResourceDeposit[0] : resourceDeposits; this.parent = parent; }
public void SetSubStarBody(SubStarBody body) { this.body = body; header.text = body.name; }
public void SetSSB(SubStarBody ssb) { this.ssb = ssb; }
public void CreatePreview(SubStarBody planet, Transform parent) { Calculate(planet); Draw(parent.Find("res")); }
public Dock(SubStarBody parent) { this.parent = parent; dockedShips = new List <Ship>(); }
public Market(SubStarBody subStarBody) { parent = subStarBody; }
public static Resourcer CreateResourcer(ResourceDeposit[] resourceDeposits, SubStarBody body) { return(new Resourcer(resourceDeposits, body)); }
public static Market CreateMarket(SubStarBody body) { Market market = new Market(body); return(market); }