public TownCenterType(TownCenterService townCenterService, WorkersService workersService)
     : base("TownCenter")
 {
     this.townCenterService = townCenterService;
     this.workersService    = workersService;
     ReceiveCreationEvents  = true;
 }
예제 #2
0
            public ScenarioGame(GodGameOffline offline, TWEngine engine, Internal.Model.World world,
                                TownCenterType townCenterType, TownCenterService townCenterService,
                                MinerType minerType)
            {
                this.world             = world;
                this.townCenterType    = townCenterType;
                this.townCenterService = townCenterService;
                this.minerType         = minerType;
                offline.AddSimulatorsToEngine(engine);

                int  skipFrames    = 0;
                var  scenarioTasks = Run().GetEnumerator();
                bool complete      = false;

                engine.AddSimulator(() =>
                {
                    skipFrames--;
                    if (skipFrames > 0)
                    {
                        return;
                    }
                    if (!scenarioTasks.MoveNext())
                    {
                        complete = true;
                    }

                    if (complete)
                    {
                        return;
                    }

                    skipFrames = scenarioTasks.Current;
                }, "ScenarioSimulator");
            }
예제 #3
0
        public HouseType(ItemTypesFactory itemTypesFactory, TownCenterService townCenterService)
            : base("House")
        {
            this.itemTypesFactory  = itemTypesFactory;
            this.townCenterService = townCenterService;
            neededResources        = new[]
            {
                new VillageResource {
                    ItemType = itemTypesFactory.CropType, MaxResourceLevel = 3, MinResourceLevel = 1, ConsummationRate = 10
                },
                new VillageResource {
                    ItemType = itemTypesFactory.FishType, MaxResourceLevel = 2, MinResourceLevel = 1, ConsummationRate = 10
                }
            }.ToList();

            totalResourceCapacity = 0;
            foreach (var res in neededResources)
            {
                totalResourceCapacity += res.MaxResourceLevel;
            }

            ReceiveCreationEvents = true;
        }