private void InitializeTowns(World world) { var human = GlobalRaces.GetInstance().FindByName("Human"); var elf = GlobalRaces.GetInstance().FindByName("Elf"); // Constant Dataをハードコードで実装 var initialTownDatas = new List <InitialTownData>() { new InitialTownData(1, "原初の森", TownType.Inland, elf), new InitialTownData(2, "青碧の湖", TownType.Port, elf), new InitialTownData(3, "首都マクシムス", TownType.Inland, human), new InitialTownData(4, "ポートランド", TownType.Port, human), new InitialTownData(5, "クラフトランド", TownType.Inland, human) }; // Model側を初期化 var presenter = GetComponent <TownsPresenter>(); // 農場5 world.InitializeTowns(initialTownDatas .Select(townData => { var townEntity = TownFactory.Create(townData.Id, townData.TownName, townData.TownType, townData.Race); for (var i = 0; i < 5; i++) { townEntity.Build(townEntity.Divisions.ElementAt(i).Id, BuildingFactory.FlourFarm()); } presenter.InitializeEntity(townEntity); return(townEntity); })); // View側を初期化 presenter.InitializeView(); }
private void InitializeBuildingTemplate() { AddBuildingTemplate(BuildingFactory.FlourFarm()); AddBuildingTemplate(BuildingFactory.SugarCaneField()); AddBuildingTemplate(BuildingFactory.Confectionery()); }