public virtual Solar CreateSolar(ArchSolar obj) { Solar solar = new Solar(this, ++lastSolarID, obj); solars[solar.id] = solar; return(solar); }
public Solar(WorldController worldController, uint id, ArchSolar arch) { this.valid = true; this.worldController = worldController; this.id = id; this.components = new List <SolarComponent>(); this.controlPanel = new SolarControlPanel(this); CreateSolarComponents(arch); }
private void CreateSolarComponents(ArchSolar arch) { foreach (ArchSolarComponent compArch in arch.components) { components.Add(new SolarComponent(this, compArch)); } rootComponent = GetComponentByID(Hash.FromString64("root_component")); if (rootComponent == null) { throw new Exception("Solar component doesnt contatin root component"); } }