Пример #1
0
 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();
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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;
        }
Пример #4
0
 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);
 }
Пример #5
0
        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);
        }
Пример #6
0
 internal void SetDestination(Int64 destinationScId)
 {
     _model.DestinationScId = destinationScId;
     _destination = _model.SolarSystem.Planets.Where(x => x.StarChartId == destinationScId).FirstOrDefault();
 }