public ShipController(Ship s, SolarSystemController ssc, IActorRef actorTextOutput) { _model = s; _solarSystemC = ssc; _actorTextOutput = actorTextOutput; _destination = _model.SolarSystem.Planets.Where(x => x.StarChartId == _model.DestinationScId).FirstOrDefault(); }
public PlanetController(Planet p, IActorRef actorTextOutput) { _model = p; _actorTextOutput = actorTextOutput; _scPlanet = StarChart.GetPlanet(_model.StarChartId); _orbitHours = _scPlanet.OrbitDays * Globals.DAYS_TO_TICKS_FACTOR; _producerCs = new HashSet<ProducerController>(); // create child controllers for each producer in planet foreach (Producer prod in p.Producers) { ProducerController pc = new ProducerController(prod, this, actorTextOutput); _producerCs.Add(pc); } }
private Planet GetPlanet(ScPlanet chartP) { Planet plan = new Planet(); plan.Name = chartP.Name; plan.Population = 10000; Society soc = new Society(); soc.Name = chartP.Name + " Soc"; plan.Society = soc; return plan; }
private void addProducersToPlanet(Agent ag, Planet p) { addNewStoreToPlanet(p, ag); Producer prod = this.GetProducer("Factory Metal", BluePrintEnum.SpiceToPlatinum); prod.Owner = ag; ag.Producers.Add(prod); Producer prod2 = this.GetProducer("Factory Spice", BluePrintEnum.PlatinumToSpice); prod2.Owner = ag; ag.Producers.Add(prod2); p.Producers.Add(prod); p.Producers.Add(prod2); }
private void addNewStoreToPlanet(Planet p, Agent o) { Store s = new Store(); s.Owner = o; s.Location = p; p.Stores.Add(o.AgentId,s); o.Stores.Add(s); // seed with basic starter resource s.StoredResources.Add(ResourceTypeEnum.Spice, 100); s.StoredResources.Add(ResourceTypeEnum.Platinum, 100); }
internal void SetDestination(Int64 destinationScId) { _model.DestinationScId = destinationScId; _destination = _model.SolarSystem.Planets.Where(x => x.StarChartId == destinationScId).FirstOrDefault(); }