ManageBuildings.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212
  1. var reGameStates = require('GameStates');
  2. import date from "../Unit/date.js"
  3. cc.Class({
  4. extends: cc.Component,
  5. properties: {
  6. //MyMapNode
  7. //建筑物的节点
  8. BuildingsParent: {
  9. default: null,
  10. type: cc.Node,
  11. },
  12. //农舍
  13. Env_101_house_low: {
  14. default: null,
  15. type: cc.Prefab,
  16. serializable: true,
  17. },
  18. //单元楼
  19. Env_102_house_mid: {
  20. default: null,
  21. type: cc.Prefab,
  22. serializable: true,
  23. },
  24. //别墅
  25. Env_103_house_high: {
  26. default: null,
  27. type: cc.Prefab,
  28. serializable: true,
  29. },
  30. //蓝色城堡
  31. Env_104_BlueCastle: {
  32. default: null,
  33. type: cc.Prefab,
  34. serializable: true,
  35. },
  36. //粉色城堡
  37. Env_105_PinkCastle: {
  38. default: null,
  39. type: cc.Prefab,
  40. serializable: true,
  41. },
  42. //农田
  43. Labour_201_Farmland: {
  44. default: null,
  45. type: cc.Prefab,
  46. serializable: true,
  47. },
  48. //伐木场
  49. Labour_202_TimberYard: {
  50. default: null,
  51. type: cc.Prefab,
  52. serializable: true,
  53. },
  54. //矿坑
  55. Labour_203_MiningPit: {
  56. default: null,
  57. type: cc.Prefab,
  58. serializable: true,
  59. },
  60. //工厂
  61. Labour_204_Factory: {
  62. default: null,
  63. type: cc.Prefab,
  64. serializable: true,
  65. },
  66. //神农专用农田
  67. Labour_205_Holy_Farmland: {
  68. default: null,
  69. type: cc.Prefab,
  70. serializable: true,
  71. },
  72. //一级
  73. // 冷饮摊
  74. Shops_30101_ColdDrinkStall: {
  75. default: null,
  76. type: cc.Prefab,
  77. serializable: true,
  78. },
  79. //贩卖机
  80. Shops_30102_SalesMachine: {
  81. default: null,
  82. type: cc.Prefab,
  83. serializable: true,
  84. },
  85. //面包房
  86. Shops_30103_Bakery: {
  87. default: null,
  88. type: cc.Prefab,
  89. serializable: true,
  90. },
  91. //早餐车
  92. Shops_30104_BreakfastCar: {
  93. default: null,
  94. type: cc.Prefab,
  95. serializable: true,
  96. },
  97. //二级
  98. //饮茶店
  99. Shops_30201_TeaShop: {
  100. default: null,
  101. type: cc.Prefab,
  102. serializable: true,
  103. },
  104. //点心店
  105. Shops_30202_confectaurant: {
  106. default: null,
  107. type: cc.Prefab,
  108. serializable: true,
  109. },
  110. //美食店
  111. Shops_30203_GourmetRestaurant: {
  112. default: null,
  113. type: cc.Prefab,
  114. serializable: true,
  115. },
  116. //西餐厅
  117. Shops_30204_WesternRestaurant: {
  118. default: null,
  119. type: cc.Prefab,
  120. serializable: true,
  121. },
  122. //三级
  123. //花店
  124. Shops_30301_Florist: {
  125. default: null,
  126. type: cc.Prefab,
  127. serializable: true,
  128. },
  129. //美发店
  130. Shops_30302_HairSalon: {
  131. default: null,
  132. type: cc.Prefab,
  133. serializable: true,
  134. },
  135. //洋装店
  136. Shops_30303_DressShop: {
  137. default: null,
  138. type: cc.Prefab,
  139. serializable: true,
  140. },
  141. //珠宝店
  142. Shops_30304_JewelryStore: {
  143. default: null,
  144. type: cc.Prefab,
  145. serializable: true,
  146. },
  147. //电影院
  148. Shops_30305_Cinema: {
  149. default: null,
  150. type: cc.Prefab,
  151. serializable: true,
  152. },
  153. //特殊建筑
  154. //路灯
  155. Spe_401_StreetLamp: {
  156. default: null,
  157. type: cc.Prefab,
  158. serializable: true,
  159. },
  160. //绿化带
  161. Spe_402_GreenBelt: {
  162. default: null,
  163. type: cc.Prefab,
  164. serializable: true,
  165. },
  166. //花坛
  167. Spe_403_FlowerBed: {
  168. default: null,
  169. type: cc.Prefab,
  170. serializable: true,
  171. },
  172. //喷泉
  173. Spe_404_Pool: {
  174. default: null,
  175. type: cc.Prefab,
  176. serializable: true,
  177. },
  178. //警察局
  179. Spe_405_PoliceOffice: {
  180. default: null,
  181. type: cc.Prefab,
  182. serializable: true,
  183. },
  184. //游乐场
  185. Spe_406_Playground: {
  186. default: null,
  187. type: cc.Prefab,
  188. serializable: true,
  189. },
  190. BuildingArray: {
  191. default: [],
  192. type: [cc.Node],
  193. serializable: true,
  194. },
  195. /**
  196. * 定义一个场景预制对象
  197. */
  198. DressUpArray: {
  199. default: [],
  200. type: [cc.Prefab]
  201. }
  202. },
  203. onBuildHouse(index) {
  204. // cc.log(index);
  205. let mainCamera = GlobalD.game.MainCamera;
  206. let housing = null;
  207. //content button 设置的index
  208. //农舍
  209. if ('101' == index) {
  210. housing = cc.instantiate(this.Env_101_house_low);
  211. }
  212. //单元楼
  213. else if ('102' == index) {
  214. housing = cc.instantiate(this.Env_102_house_mid);
  215. }
  216. //别墅
  217. else if ('103' == index) {
  218. housing = cc.instantiate(this.Env_103_house_high);
  219. }
  220. else if ('104' == index) {
  221. housing = cc.instantiate(this.Env_104_BlueCastle);
  222. }
  223. else if ('105' == index) {
  224. housing = cc.instantiate(this.Env_105_PinkCastle);
  225. }
  226. //农田
  227. else if ('201' == index) {
  228. housing = cc.instantiate(this.Labour_201_Farmland);
  229. }
  230. //伐木场
  231. else if ('202' == index) {
  232. housing = cc.instantiate(this.Labour_202_TimberYard);
  233. }
  234. //矿坑
  235. else if ('203' == index) {
  236. housing = cc.instantiate(this.Labour_203_MiningPit);
  237. }
  238. //工厂
  239. else if ('204' == index) {
  240. housing = cc.instantiate(this.Labour_204_Factory);
  241. }
  242. //神农专用农田
  243. else if ('205' == index) {
  244. housing = cc.instantiate(this.Labour_205_Holy_Farmland);
  245. }
  246. //冷饮摊
  247. else if ('30101' == index) {
  248. housing = cc.instantiate(this.Shops_30101_ColdDrinkStall);
  249. }
  250. //贩卖机
  251. else if ('30102' == index) {
  252. housing = cc.instantiate(this.Shops_30102_SalesMachine);
  253. }
  254. //面包房
  255. else if ('30103' == index) {
  256. housing = cc.instantiate(this.Shops_30103_Bakery);
  257. }
  258. //早餐车
  259. else if ('30104' == index) {
  260. housing = cc.instantiate(this.Shops_30104_BreakfastCar);
  261. }
  262. //饮茶店
  263. else if ('30201' == index) {
  264. housing = cc.instantiate(this.Shops_30201_TeaShop);
  265. }
  266. //点心店
  267. else if ('30202' == index) {
  268. housing = cc.instantiate(this.Shops_30202_confectaurant);
  269. }
  270. //美食店
  271. else if ('30203' == index) {
  272. housing = cc.instantiate(this.Shops_30203_GourmetRestaurant);
  273. }
  274. //西餐厅
  275. else if ('30204' == index) {
  276. housing = cc.instantiate(this.Shops_30204_WesternRestaurant);
  277. }
  278. //花店
  279. else if ('30301' == index) {
  280. housing = cc.instantiate(this.Shops_30301_Florist);
  281. }
  282. //美发店
  283. else if ('30302' == index) {
  284. housing = cc.instantiate(this.Shops_30302_HairSalon);
  285. }
  286. //洋装店
  287. else if ('30303' == index) {
  288. housing = cc.instantiate(this.Shops_30303_DressShop);
  289. }
  290. //珠宝店
  291. else if ('30304' == index) {
  292. housing = cc.instantiate(this.Shops_30304_JewelryStore);
  293. }
  294. //电影院
  295. else if ('30305' == index) {
  296. housing = cc.instantiate(this.Shops_30305_Cinema);
  297. }
  298. //路灯
  299. else if ('401' == index) {
  300. housing = cc.instantiate(this.Spe_401_StreetLamp);
  301. }
  302. //绿化带
  303. else if ('402' == index) {
  304. housing = cc.instantiate(this.Spe_402_GreenBelt);
  305. }
  306. //花坛
  307. else if ('403' == index) {
  308. housing = cc.instantiate(this.Spe_403_FlowerBed);
  309. }
  310. //喷泉
  311. else if ('404' == index) {
  312. housing = cc.instantiate(this.Spe_404_Pool);
  313. }
  314. //警察局
  315. else if ('405' == index) {
  316. housing = cc.instantiate(this.Spe_405_PoliceOffice);
  317. }
  318. //游乐场
  319. else if ('406' == index) {
  320. housing = cc.instantiate(this.Spe_406_Playground);
  321. }
  322. housing.parent = this.BuildingsParent;
  323. let tempPos = housing.parent.convertToNodeSpace(mainCamera.node);
  324. let CanvasPos = GlobalD.game.Canvas.position;
  325. housing.setPosition(tempPos.x + CanvasPos.x, tempPos.y + CanvasPos.y);
  326. let buildingsInfo = housing.getComponent("buildingsInfo");
  327. //id用时间戳来记录
  328. buildingsInfo.buildInfo.id = new Date().getTime();//+= Math.random() * 1000000;
  329. this.SpawnBuildingDefaultValue(buildingsInfo);
  330. let buildingsTouch = housing.getComponent("buildingsTouch");
  331. // buildingsTouch.buildInfo = buildingsInfo.buildInfo;
  332. buildingsTouch.onEditorStatus(true);
  333. // housing.active = true;
  334. //收起菜单
  335. GlobalD.game._ManageUIScript.onHideMenu();
  336. //收起底部菜单栏
  337. GlobalD.game._ManageUIScript.onBottomMenuView(false);
  338. },
  339. start() {
  340. },
  341. //如果存储到有房子数据的话,把地图上的房屋都隐藏起来,或者删除
  342. //todo...
  343. onHideInitPosBuildings() {
  344. //删除对应层的子节点
  345. let tempNode = this.BuildingsParent.children;
  346. let length = tempNode.length;
  347. for (let i = length - 1; i >= 0; i--) {
  348. tempNode[i].active = false;
  349. }
  350. },
  351. /**
  352. * GameData里面处理的生成数据流程,生成建筑物
  353. */
  354. InitBuildings() {
  355. //如果有存储的数据,隐藏场景房屋节点
  356. // this.onHideInitPosBuildings();
  357. /**
  358. * 注释 spawnConfigLand 不初始化固定土地
  359. */
  360. //第一步初始化土地的网络数据
  361. this.spawnConfigLand(GlobalD.UserLeaseLand, true);
  362. /**
  363. * todo 之类初始化场景障碍物操作,如果不需要直接注释即可。
  364. * 村长和镇长
  365. * 初始化障碍物场景,装饰
  366. */
  367. // if(0 != GlobalD.Dapp.UserInfo.agent_level){
  368. // this.spawnDressUp();
  369. // }
  370. //先初始化网络数据
  371. // remove version: todo 去除旧的生成建筑逻辑
  372. // this.SpawnHouse();
  373. // cc.log('初始化场景建筑');
  374. let BuildingStateArray = GlobalD.GameData.GetBuildingStateArray();
  375. for (let i = 0; i < BuildingStateArray.length; i++) {
  376. if (BuildingStateArray[i] == 0) {
  377. if (this.BuildingArray[i])
  378. this.BuildingArray[i].active = false;
  379. }
  380. else {
  381. if (this.BuildingArray[i])
  382. this.BuildingArray[i].active = true;
  383. }
  384. }
  385. let BuildingNumArray = GlobalD.GameData.GetBuildingNumArray();
  386. // cc.log('BuildingNumArray',BuildingNumArray)
  387. for (let i = 3; i < this.BuildingArray.length; i++) {
  388. // cc.log('this.BuildingArray[' + i + ']=' + this.BuildingArray[i].getChildByName('Name').getComponent(cc.Label).string);
  389. if (this.BuildingArray[i])
  390. this.BuildingArray[i].getChildByName('Name').getChildByName('Num').getComponent(cc.Label).string = BuildingNumArray[i];
  391. }
  392. },
  393. //生成房子的默认值
  394. SpawnBuildingDefaultValue(buildingsInfo) {
  395. buildingsInfo.InitPos = false;
  396. buildingsInfo.InitWorkBuildingInfo = false;
  397. //激活状态,可运营
  398. buildingsInfo.buildInfo.isItActive = true;
  399. //设置销售状态
  400. buildingsInfo.buildInfo.isItSaleable = true;
  401. if (reGameStates.BuildType.Farmland == buildingsInfo.buildInfo.buildType) {
  402. buildingsInfo.buildInfo.isItSaleable = GlobalD.GameData.GetFoodTradeState() > 0 ? true : false;// GlobalD.GameData.GetFoodTradeState();
  403. // cc.log('初始化房子的信息:', buildingsInfo.buildInfo.buildingName, buildingsInfo.buildInfo.isItSaleable);
  404. }
  405. if (reGameStates.BuildType.MiningPit == buildingsInfo.buildInfo.buildType) {
  406. buildingsInfo.buildInfo.isItSaleable = GlobalD.GameData.GetMineralTradeState() > 0 ? true : false;// GlobalD.GameData.GetMineralTradeState();
  407. }
  408. if (reGameStates.BuildType.TimberYard == buildingsInfo.buildInfo.buildType) {
  409. buildingsInfo.buildInfo.isItSaleable = GlobalD.GameData.GetWoodTradeState() > 0 ? true : false;// GlobalD.GameData.GetWoodTradeState();
  410. }
  411. //设置一下,可查看信息
  412. if (reGameStates.BuildType.Housing !== buildingsInfo.buildInfo.buildType
  413. && reGameStates.BuildType.Special !== buildingsInfo.buildInfo.buildType
  414. /** 神农小镇固定土地关闭 基本的房屋信息,另外设置其他信息 */
  415. && reGameStates.BuildType.HolyFarmland !== buildingsInfo.buildInfo.buildType
  416. ) {
  417. buildingsInfo.node.getComponent('buildingsTouch').isShowBuildingInfo = true;
  418. }
  419. //设置消耗的体力值为工人的最低值 20
  420. //过高的话,会导致工人不工作
  421. // buildingsInfo.buildInfo.totalConsumption = 20;
  422. // cc.log('初始化房子的信息:', buildingsInfo.buildInfo.buildingName, buildingsInfo.buildInfo.isItSaleable)
  423. },
  424. //初始化场景的两个建筑
  425. SpawnDefaultHouse() {
  426. cc.log('初始化默认房子');
  427. //房子
  428. let housingTemp_house = this.onGetHousingPrefabFromName('Env_101_house_low');
  429. housingTemp_house.parent = this.BuildingsParent;
  430. var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(cc.v2(24, 23));
  431. housingTemp_house.setPosition(endPos.x, endPos.y);
  432. let buildingsInfo_house = housingTemp_house.getComponent("buildingsInfo");
  433. //id用时间戳来记录
  434. buildingsInfo_house.buildInfo.id = 101;//对应的id
  435. //设置tile的最底下的坐标,就是起始坐标
  436. buildingsInfo_house.buildInfo.startTilePos = cc.v2(24, 23);
  437. this.SpawnBuildingDefaultValue(buildingsInfo_house);
  438. //起始坐标,占位范围,是否占位
  439. GlobalD.game.addBuildTiled(buildingsInfo_house.buildInfo.id, buildingsInfo_house.buildInfo.startTilePos, buildingsInfo_house.buildInfo.occupyArea);
  440. //添加占位信息
  441. GlobalD.game.addBuilding(buildingsInfo_house);
  442. //农田
  443. let housingTemp_farmland = this.onGetHousingPrefabFromName('Labour_201_Farmland');
  444. housingTemp_farmland.parent = this.BuildingsParent;
  445. var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(cc.v2(26, 24));
  446. housingTemp_farmland.setPosition(endPos.x, endPos.y);
  447. let buildingsInfo_farmland = housingTemp_farmland.getComponent("buildingsInfo");
  448. //id用时间戳来记录
  449. buildingsInfo_farmland.buildInfo.id = 201;//对应的id
  450. //设置tile的最底下的坐标,就是起始坐标
  451. buildingsInfo_farmland.buildInfo.startTilePos = cc.v2(26, 24);
  452. this.SpawnBuildingDefaultValue(buildingsInfo_farmland);
  453. //起始坐标,占位范围,是否占位
  454. GlobalD.game.addBuildTiled(buildingsInfo_farmland.buildInfo.id, buildingsInfo_farmland.buildInfo.startTilePos, buildingsInfo_farmland.buildInfo.occupyArea);
  455. //添加占位信息
  456. GlobalD.game.addBuilding(buildingsInfo_farmland);
  457. },
  458. /**
  459. * 按钮调用
  460. * 回到用户自己的农场
  461. */
  462. onBackSelfFarmland() {
  463. //刷新一下自己的用户信息
  464. GlobalD.GameData.getSelfUserLandList(() => {
  465. this.spawnConfigLand(GlobalD.UserLeaseLand, true);
  466. //显示底部菜单栏
  467. GlobalD.game._ManageUIScript.onBottomMenuView(true);
  468. //收起其他用户场景后菜单操作
  469. GlobalD.game._ManageUIScript.onOtherFarmerView(false);
  470. })
  471. //更新自己的狗
  472. let _dogContainerScript = cc.find("Canvas/DogContainer").getComponent("DogContainer")
  473. _dogContainerScript.onGetSelfList();
  474. },
  475. /**
  476. * 初始化后台配置的土地数据
  477. * 切换时候需要重置其他用户数据
  478. * @returns
  479. */
  480. spawnConfigLand(_userLeaseLand, bSelf) {
  481. if (GlobalD.ConfigLand == null) {
  482. console.error("GlobalD.ConfigLand 未初始化设置!");
  483. return;
  484. }
  485. if (_userLeaseLand == null) {
  486. console.error("_userLeaseLand 未初始化设置!");
  487. return;
  488. }
  489. let _configLand = GlobalD.ConfigLand;
  490. if (bSelf) {
  491. let _bInitFarmland = false;
  492. let _landBuildingsInfo = this.BuildingsParent.children;
  493. for (let i = _landBuildingsInfo.length - 1; i >= 0; i--) {
  494. let resetLandInfo = _landBuildingsInfo[i];
  495. if (resetLandInfo.name == "Labour_205_Holy_Farmland") {
  496. let leaseFarmlandInfoScript = resetLandInfo.getComponent("LeaseFarmlandInfo");
  497. //如果存在开锁的土地,重置状态
  498. if (!leaseFarmlandInfoScript.onGetUnlockLandState()) {
  499. leaseFarmlandInfoScript.onLockLand();
  500. }
  501. for (let j = 0; j < _userLeaseLand.length; j++) {
  502. //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
  503. if (_userLeaseLand[j].configLandId == leaseFarmlandInfoScript.initConfigLandId) {
  504. // console.log(leaseFarmlandInfoScript.initConfigLandId);
  505. let _leaseLandInfo = _userLeaseLand[j];
  506. leaseFarmlandInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
  507. }
  508. }
  509. _bInitFarmland = true;
  510. }
  511. }
  512. if (_bInitFarmland) {
  513. console.log("已经初始化过土地数据!");
  514. return;
  515. }
  516. //此时是第一次生成
  517. for (let i = 0; i < _configLand.length; i++) {
  518. //生成默认土地
  519. //农田
  520. let housingTemp_farmland = this.onGetHousingPrefabFromName('Labour_205_Holy_Farmland');
  521. housingTemp_farmland.parent = this.BuildingsParent;
  522. var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(cc.v2(_configLand[i].posX, _configLand[i].posY));
  523. housingTemp_farmland.setPosition(endPos.x, endPos.y);
  524. let leaseFarmlandInfoScript = housingTemp_farmland.getComponent("LeaseFarmlandInfo");
  525. //记录一下第一次初始化时候的id
  526. leaseFarmlandInfoScript.initConfigLandId = _configLand[i].id;
  527. // console.log(housingTemp_farmland.name +" = "+ leaseFarmlandInfoScript.initConfigLandId);
  528. //记录config的土地信息
  529. leaseFarmlandInfoScript.setConfigLandInfo(_configLand[i]);
  530. for (let j = 0; j < _userLeaseLand.length; j++) {
  531. //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
  532. if (_userLeaseLand[j].configLandId == _configLand[i].id) {
  533. let _leaseLandInfo = _userLeaseLand[j];
  534. leaseFarmlandInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
  535. }
  536. }
  537. let buildingsInfo_farmland = housingTemp_farmland.getComponent("buildingsInfo");
  538. //id用时间戳来记录
  539. buildingsInfo_farmland.buildInfo.id = _configLand[i].id;//对应的id
  540. /**
  541. * 服务器设置的农田 独立于其他游戏数据
  542. * 这步设置之后,addBuilding 时候不存储到 GameData_buildings
  543. */
  544. buildingsInfo_farmland.InitPosFromStore = true;
  545. //设置tile的最底下的坐标,就是起始坐标
  546. buildingsInfo_farmland.buildInfo.startTilePos = cc.v2(_configLand[i].posX, _configLand[i].posY);
  547. this.SpawnBuildingDefaultValue(buildingsInfo_farmland);
  548. //起始坐标,占位范围,是否占位
  549. GlobalD.game.addBuildTiled(buildingsInfo_farmland.buildInfo.id, buildingsInfo_farmland.buildInfo.startTilePos, buildingsInfo_farmland.buildInfo.occupyArea);
  550. //添加占位信息
  551. GlobalD.game.addBuilding(buildingsInfo_farmland);
  552. }
  553. // console.log(this.BuildingsParent.children);
  554. } else {
  555. //访问其他用户时候,已经有土地了
  556. //重置土地信息
  557. let _landBuildingsInfo = this.BuildingsParent.children;
  558. for (let i = _landBuildingsInfo.length - 1; i >= 0; i--) {
  559. let resetLandInfo = _landBuildingsInfo[i];
  560. if (resetLandInfo.name == "Labour_205_Holy_Farmland") {
  561. let leaseFarmlandInfoScript = resetLandInfo.getComponent("LeaseFarmlandInfo");
  562. //如果存在开锁的土地,重置状态
  563. if (!leaseFarmlandInfoScript.onGetUnlockLandState()) {
  564. leaseFarmlandInfoScript.onLockLand();
  565. }
  566. //访问其他农场时候,全部不显示待租按钮
  567. leaseFarmlandInfoScript.onUnlockLand();
  568. for (let j = 0; j < _userLeaseLand.length; j++) {
  569. //记录已经租赁的信息(租赁里面包含了seedInfo,如果有种植的话,对应的种植信息会有)
  570. if (_userLeaseLand[j].configLandId == leaseFarmlandInfoScript.initConfigLandId) {
  571. let _leaseLandInfo = _userLeaseLand[j];
  572. leaseFarmlandInfoScript.setLeaseLandInfo(_leaseLandInfo, bSelf);
  573. }
  574. }
  575. }
  576. }
  577. // console.log("other:", this.BuildingsParent.children);
  578. }
  579. },
  580. /**
  581. * 初始化障碍物
  582. * 生成的预制信息,需要在 DressUpArray 添加对应的预制件,才可以添加
  583. */
  584. spawnDressUp() {
  585. //村长和镇长的区别,樱花树区别
  586. let agent_level = GlobalD.Dapp.UserInfo.agent_level; // 0普通用户,1 村长身份,2 镇长身份
  587. let _cherryTree = 2 === agent_level ? "Dress_505_SmallTree02" : "Dress_505_SmallTree01";
  588. let _temp = [
  589. //左边第一部分 ----start----
  590. {
  591. spawnName: "Dress_502_ChrisTree",
  592. startPos: cc.v2(14, 20)
  593. },
  594. //拱门
  595. {
  596. spawnName: "Dress_505_MainDoor01",
  597. startPos: cc.v2(18, 17)
  598. },
  599. {
  600. spawnName: "Dress_503_RailingGrassX",
  601. startPos: cc.v2(9, 20)
  602. },
  603. {
  604. spawnName: "Dress_503_RailingGrassX",
  605. startPos: cc.v2(7, 20)
  606. },
  607. //-----
  608. {
  609. spawnName: "Dress_505_FlowerBed",
  610. startPos: cc.v2(8, 22)
  611. },
  612. {
  613. spawnName: "Dress_505_FlowerBed",
  614. startPos: cc.v2(8, 23)
  615. },
  616. //喷泉
  617. {
  618. spawnName: "Dress_502_Fountain",
  619. startPos: cc.v2(10, 23)
  620. },
  621. {
  622. spawnName: "Dress_505_FlowerBed",
  623. startPos: cc.v2(11, 22)
  624. },
  625. {
  626. spawnName: "Dress_505_FlowerBed",
  627. startPos: cc.v2(11, 23)
  628. },
  629. {
  630. spawnName: "Dress_505_ChrisSanta",
  631. startPos: cc.v2(10, 25)
  632. },
  633. //-----
  634. //左边第一部分 ----end----
  635. //主路放两个灯和树
  636. {
  637. spawnName: "Dress_505_Streetlight",
  638. startPos: cc.v2(15, 29)
  639. },
  640. {
  641. spawnName: "Dress_505_Streetlight",
  642. startPos: cc.v2(18, 29)
  643. },
  644. {
  645. spawnName: "Dress_505_SmallTree",
  646. startPos: cc.v2(15, 30)
  647. },
  648. {
  649. spawnName: "Dress_505_SmallTree",
  650. startPos: cc.v2(18, 30)
  651. }
  652. ];
  653. //左边小麦区域
  654. // for (let x = 0; x < 3; x++) {
  655. // for (let y = 0; y < 2; y++) {
  656. // _temp.push({
  657. // spawnName: "Dress_502_Rice",
  658. // startPos: cc.v2(4 - x * 2, 30 - y * 2)
  659. // })
  660. // }
  661. // }
  662. //1倍土地部分木质花圃
  663. // for (let x = 0; x < 6; x++) {
  664. // for (let y = 0; y < 3; y++) {
  665. // _temp.push({
  666. // spawnName: "Dress_503_WhiteWoodRailingX",
  667. // startPos: cc.v2(18 + x, 14 - y * 3)
  668. // })
  669. // }
  670. // }
  671. //生成一个未盛开的樱花围绕,间隔1个空格 ---start ,镇长换成盛开的樱花
  672. // for (let x = 0; x < 3; x++) {
  673. // _temp.push({
  674. // spawnName: _cherryTree,
  675. // startPos: cc.v2(18 + x * 2, 17)
  676. // })
  677. // _temp.push({
  678. // spawnName: _cherryTree,
  679. // startPos: cc.v2(18 + x * 2, 5)
  680. // })
  681. // }
  682. // for (let y = 0; y < 7; y++) {
  683. // _temp.push({
  684. // spawnName: _cherryTree,
  685. // startPos: cc.v2(24, 17 - y * 2)
  686. // })
  687. // }
  688. //多倍区域
  689. // for (let x = 0; x < 3; x++) {
  690. // _temp.push({
  691. // spawnName: _cherryTree,
  692. // startPos: cc.v2(15 - x * 2, 14)
  693. // })
  694. // _temp.push({
  695. // spawnName: _cherryTree,
  696. // startPos: cc.v2(15 - x * 2, 2)
  697. // })
  698. // }
  699. //生成一个未盛开的樱花围绕,间隔1个空格 --- end
  700. //多倍土地部分木质花圃
  701. // for (let x = 0; x < 3; x++) {
  702. // for (let y = 0; y < 3; y++) {
  703. // _temp.push({
  704. // spawnName: "Dress_503_RailingGrassX",
  705. // startPos: cc.v2(15 - x * 2, 11 - y * 3)
  706. // })
  707. // }
  708. // }
  709. //生成番茄区域
  710. // for (let x = 0; x < 3; x++) {
  711. // for (let y = 0; y < 2; y++) {
  712. // _temp.push({
  713. // spawnName: "Dress_502_Tomato",
  714. // startPos: cc.v2(26 + x * 2, 30 - y * 2)
  715. // })
  716. // }
  717. // }
  718. //----中上别墅区域--start
  719. //生成中上三个别墅和三个树木
  720. for (let x = 0; x < 3; x++) {
  721. _temp.push({
  722. spawnName: "Dress_505_SmallTree",
  723. startPos: cc.v2(7 - x * 2, 6)
  724. })
  725. _temp.push({
  726. spawnName: "Dress_502_Villa",
  727. startPos: cc.v2(8 - x * 2, 8)
  728. })
  729. }
  730. //雪橇
  731. _temp.push({
  732. spawnName: "Dress_505_ChrisCar02",
  733. startPos: cc.v2(8, 10)
  734. })
  735. //圣诞门和栏杆
  736. for (let x = 0; x < 3; x++) {
  737. _temp.push({
  738. spawnName: "Dress_503_WhiteWoodRailingX",
  739. startPos: cc.v2(8 - x, 11)
  740. })
  741. }
  742. _temp.push({
  743. spawnName: "Dress_503_ChrisDoorX",
  744. startPos: cc.v2(5, 11)
  745. })
  746. for (let x = 0; x < 3; x++) {
  747. _temp.push({
  748. spawnName: "Dress_503_WhiteWoodRailingX",
  749. startPos: cc.v2(4 - x, 11)
  750. })
  751. }
  752. //门外区域
  753. _temp.push({
  754. spawnName: "Dress_502_florist",
  755. startPos: cc.v2(4, 15)
  756. })
  757. _temp.push({
  758. spawnName: "Dress_505_ChrisCar01",
  759. startPos: cc.v2(6, 16)
  760. })
  761. _temp.push({
  762. spawnName: "Dress_505_PondDuck",
  763. startPos: cc.v2(6, 14)
  764. })
  765. for (let y = 0; y < 3; y++) {
  766. _temp.push({
  767. spawnName: "Dress_504_ChrisRailingY",
  768. startPos: cc.v2(8, 16 - y)
  769. })
  770. }
  771. //樱花路
  772. for (let x = 0; x < 5; x++) {
  773. _temp.push({
  774. spawnName: _cherryTree,
  775. startPos: cc.v2(10 - x * 2, 17)
  776. })
  777. _temp.push({
  778. spawnName: _cherryTree,
  779. startPos: cc.v2(10 - x * 2, 19)
  780. })
  781. }
  782. //------end
  783. //----右边区域--start
  784. _temp.push({
  785. spawnName: "Dress_505_Pond",
  786. startPos: cc.v2(20, 3)
  787. })
  788. _temp.push({
  789. spawnName: "Dress_504_RailingGrassY",
  790. startPos: cc.v2(21, 3)
  791. })
  792. _temp.push({
  793. spawnName: "Dress_502_FruitTreeAndStool",
  794. startPos: cc.v2(23, 3)
  795. })
  796. //---- end
  797. for (let i = 0; i < _temp.length; i++) {
  798. for (let j = 0; j < this.DressUpArray.length; j++) {
  799. let _dressUpTemp = this.DressUpArray[j];
  800. if (_dressUpTemp.name == _temp[i].spawnName) {
  801. let prefab = cc.instantiate(_dressUpTemp);
  802. prefab.parent = this.BuildingsParent;
  803. let tipNode = prefab.getChildByName("Tip");
  804. if (tipNode) {
  805. tipNode.destroy();
  806. }
  807. let buildingsInfo = prefab.getComponent("buildingsInfo");
  808. //id用时间戳来记录
  809. buildingsInfo.buildInfo.id = new Date().getTime();//对应的id
  810. buildingsInfo.buildInfo.isItActive = false;
  811. //设置tile的最底下的坐标,就是起始坐标
  812. buildingsInfo.buildInfo.startTilePos = _temp[i].startPos;
  813. buildingsInfo.InitPos = false;
  814. buildingsInfo.InitStartPos = _temp[i].startPos;
  815. var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(_temp[i].startPos);
  816. prefab.setPosition(endPos.x, endPos.y);
  817. //起始坐标,占位范围,是否占位
  818. GlobalD.game.addBuildTiled(buildingsInfo.buildInfo.id, buildingsInfo.buildInfo.startTilePos, buildingsInfo.buildInfo.occupyArea);
  819. //添加占位信息
  820. GlobalD.game.addBuilding(buildingsInfo);
  821. // console.log(_dressUpTemp.name);
  822. //跳出里面一层循环
  823. break;
  824. }
  825. }
  826. }
  827. },
  828. //初始化场景建筑
  829. SpawnHouse: function () {
  830. let BuildingJSON = Object.assign([], GlobalD.GameData.GameData_buildings);
  831. //拿到数据后,清空 GlobalD.GameData.GameData_buildings 数据,下面再添加上去
  832. GlobalD.GameData.GameData_buildings.length = 0;
  833. // cc.log('BuildingJSON', BuildingJSON);
  834. // if (BuildingJSON.length == 0) {
  835. // //初始化默认房子
  836. // this.SpawnDefaultHouse();
  837. // return
  838. // };
  839. for (let i = 0; i < BuildingJSON.length; i++) {
  840. let HouseName = BuildingJSON[i].buildingNodeName;
  841. let housingTemp = this.onGetHousingPrefabFromName(HouseName);
  842. if (!housingTemp)
  843. cc.error('housingTemp', HouseName, housingTemp);
  844. //预制为空
  845. if (!housingTemp) continue;
  846. let buildingsInfo = housingTemp.getComponent("buildingsInfo");
  847. /**
  848. * 处理数据库数据冲突问题
  849. * 这里处理判断初始化位置是否被占用,占用了回收到仓库背包系统
  850. * BuildingJSON 看做旧的数据, 拿到旧数据 BuildingJSON[i].startTilePos 起始位置 ,生成对应预制的大小occupyArea
  851. * 来判断占位信息
  852. */
  853. // //全部回收
  854. // // 背包添加对应的建筑数量
  855. // GlobalD.game.PlusBuilding(buildingsInfo.buildInfo.buildingName);
  856. // // 删除上面生成的预制节点
  857. // housingTemp.destroy();
  858. // continue;
  859. let _canNotBuild = GlobalD.game.areTheraOverlappingAreas(BuildingJSON[i].startTilePos, buildingsInfo.buildInfo.occupyArea, 1);
  860. if (_canNotBuild) {
  861. // 背包添加对应的建筑数量
  862. GlobalD.game.PlusBuilding(buildingsInfo.buildInfo.buildingName);
  863. // 删除上面生成的预制节点
  864. housingTemp.destroy();
  865. //跳过生成
  866. continue;
  867. }
  868. housingTemp.parent = this.BuildingsParent;
  869. var endPos = GlobalD.TiledMap._getTheMiddleLocationFromtilePos(BuildingJSON[i].startTilePos);
  870. housingTemp.setPosition(endPos.x, endPos.y);
  871. //id用时间戳来记录
  872. buildingsInfo.buildInfo.id = BuildingJSON[i].buildingId;//对应的id
  873. //设置tile的最底下的坐标,就是起始坐标
  874. buildingsInfo.buildInfo.startTilePos = BuildingJSON[i].startTilePos;
  875. //初始化位置的坐标
  876. buildingsInfo.InitStartPos = BuildingJSON[i].startTilePos;
  877. this.SpawnBuildingDefaultValue(buildingsInfo);
  878. //目前应该只有商店,后面根据RunningCost来判断 todo.....
  879. // if (reGameStates.BuildType.Shop == buildingsInfo.buildInfo.buildType)
  880. {
  881. // buildingsInfo.buildInfo.isItSaleable = Number(BuildingJSON[i].isItSaleable) > 0 ? true : false;
  882. buildingsInfo.buildInfo.isItStopOperation = Number(BuildingJSON[i].isItStopOperation) > 0 ? true : false;
  883. //如果不可以运营的,加上牌子
  884. if (buildingsInfo.buildInfo.isItStopOperation) {
  885. GlobalD.game.onAddBuildingTipView(buildingsInfo);
  886. }
  887. }
  888. //建筑物的加成值
  889. buildingsInfo.buildInfo.consumeStrengthAddValue = Number(BuildingJSON[i].consumeStrengthAddValue);
  890. buildingsInfo.buildInfo.goodsPriceAddValue = Number(BuildingJSON[i].goodsPriceAddValue);
  891. /**
  892. * 判断是否占位的时候,需要进一步处理。放回背包,然后背包物品加上对应的数量
  893. */
  894. //起始坐标,占位范围,是否占位
  895. GlobalD.game.addBuildTiled(buildingsInfo.buildInfo.id, buildingsInfo.buildInfo.startTilePos, buildingsInfo.buildInfo.occupyArea);
  896. //添加占位信息
  897. GlobalD.game.addBuilding(buildingsInfo);
  898. }
  899. // console.log("GlobalD.GameData.GameData_buildings:", GlobalD.GameData.GameData_buildings);
  900. },
  901. onGetHousingPrefabFromName(HouseName) {
  902. let housing = null;
  903. //住宿地方
  904. if (HouseName == 'Env_101_house_low') {
  905. housing = cc.instantiate(this.Env_101_house_low);
  906. }
  907. else if (HouseName === 'Env_102_house_mid') {
  908. housing = cc.instantiate(this.Env_102_house_mid);
  909. }
  910. else if (HouseName == 'Env_103_house_high') {
  911. housing = cc.instantiate(this.Env_103_house_high);
  912. }
  913. else if (HouseName == 'Env_104_BlueCastle') {
  914. housing = cc.instantiate(this.Env_104_BlueCastle);
  915. }
  916. else if (HouseName == 'Env_105_PinkCastle') {
  917. housing = cc.instantiate(this.Env_105_PinkCastle);
  918. }
  919. //劳动地方
  920. else if (HouseName == 'Labour_201_Farmland') {
  921. housing = cc.instantiate(this.Labour_201_Farmland);
  922. }
  923. else if (HouseName == 'Labour_202_TimberYard') {
  924. housing = cc.instantiate(this.Labour_202_TimberYard);
  925. }
  926. else if (HouseName == 'Labour_203_MiningPit') {
  927. housing = cc.instantiate(this.Labour_203_MiningPit);
  928. }
  929. else if (HouseName == 'Labour_204_Factory') {
  930. housing = cc.instantiate(this.Labour_204_Factory);
  931. }
  932. //神农专用农田
  933. else if (HouseName == 'Labour_205_Holy_Farmland') {
  934. housing = cc.instantiate(this.Labour_205_Holy_Farmland);
  935. }
  936. //特殊建筑
  937. else if (HouseName == 'Spe_401_StreetLamp') {
  938. housing = cc.instantiate(this.Spe_401_StreetLamp);
  939. }
  940. else if (HouseName == 'Spe_402_GreenBelt') {
  941. housing = cc.instantiate(this.Spe_402_GreenBelt);
  942. }
  943. else if (HouseName == 'Spe_403_FlowerBed') {
  944. housing = cc.instantiate(this.Spe_403_FlowerBed);
  945. }
  946. else if (HouseName == 'Spe_404_Pool') {
  947. housing = cc.instantiate(this.Spe_404_Pool);
  948. }
  949. else if (HouseName == 'Spe_405_PoliceOffice') {
  950. housing = cc.instantiate(this.Spe_405_PoliceOffice);
  951. }
  952. else if (HouseName == 'Spe_406_Playground') {
  953. housing = cc.instantiate(this.Spe_406_Playground);
  954. }
  955. //商店类型
  956. else if (HouseName == 'Shops_30101_ColdDrinkStall') {
  957. housing = cc.instantiate(this.Shops_30101_ColdDrinkStall);
  958. }
  959. else if (HouseName == 'Shops_30102_SalesMachine') {
  960. housing = cc.instantiate(this.Shops_30102_SalesMachine);
  961. }
  962. else if (HouseName == 'Shops_30103_Bakery') {
  963. housing = cc.instantiate(this.Shops_30103_Bakery);
  964. }
  965. else if (HouseName == 'Shops_30104_BreakfastCar') {
  966. housing = cc.instantiate(this.Shops_30104_BreakfastCar);
  967. }
  968. else if (HouseName == 'Shops_30201_TeaShop') {
  969. housing = cc.instantiate(this.Shops_30201_TeaShop);
  970. }
  971. else if (HouseName == 'Shops_30202_confectaurant') {
  972. housing = cc.instantiate(this.Shops_30202_confectaurant);
  973. }
  974. else if (HouseName == 'Shops_30203_GourmetRestaurant') {
  975. housing = cc.instantiate(this.Shops_30203_GourmetRestaurant);
  976. }
  977. else if (HouseName == 'Shops_30204_WesternRestaurant') {
  978. housing = cc.instantiate(this.Shops_30204_WesternRestaurant);
  979. }
  980. else if (HouseName == 'Shops_30301_Florist') {
  981. housing = cc.instantiate(this.Shops_30301_Florist);
  982. }
  983. else if (HouseName == 'Shops_30302_HairSalon') {
  984. housing = cc.instantiate(this.Shops_30302_HairSalon);
  985. }
  986. else if (HouseName == 'Shops_30303_DressShop') {
  987. housing = cc.instantiate(this.Shops_30303_DressShop);
  988. }
  989. else if (HouseName == 'Shops_30304_JewelryStore') {
  990. housing = cc.instantiate(this.Shops_30304_JewelryStore);
  991. }
  992. else if (HouseName == 'Shops_30305_Cinema') {
  993. housing = cc.instantiate(this.Shops_30305_Cinema);
  994. }
  995. return housing;
  996. },
  997. //获取预制的名字
  998. onGetPrefabsBuildingName(index) {
  999. //content button 设置的index
  1000. let buildingName = '';
  1001. //农舍
  1002. if ('101' == index) {
  1003. buildingName = 'Env_101_house_low';
  1004. }
  1005. //单元楼
  1006. else if ('102' == index) {
  1007. buildingName = 'Env_102_house_mid';
  1008. }
  1009. //别墅
  1010. else if ('103' == index) {
  1011. buildingName = 'Env_103_house_high';
  1012. }
  1013. //蓝色城堡
  1014. else if ('104' == index) {
  1015. buildingName = 'Env_104_BlueCastle';
  1016. }
  1017. //粉色城堡
  1018. else if ('105' == index) {
  1019. buildingName = 'Env_105_PinkCastle';
  1020. }
  1021. //农田
  1022. else if ('201' == index) {
  1023. buildingName = 'Labour_201_Farmland';
  1024. }
  1025. //伐木场
  1026. else if ('202' == index) {
  1027. buildingName = 'Labour_202_TimberYard';
  1028. }
  1029. //矿坑
  1030. else if ('203' == index) {
  1031. buildingName = 'Labour_203_MiningPit';
  1032. }
  1033. //工厂
  1034. else if ('204' == index) {
  1035. buildingName = 'Labour_204_Factory';
  1036. }
  1037. //神农专用农田
  1038. else if ('205' == index) {
  1039. buildingName = 'Labour_205_Holy_Farmland';
  1040. }
  1041. //冷饮摊
  1042. else if ('30101' == index) {
  1043. buildingName = 'Shops_30101_ColdDrinkStall';
  1044. }
  1045. //贩卖机
  1046. else if ('30102' == index) {
  1047. buildingName = 'Shops_30102_SalesMachine';
  1048. }
  1049. //面包房
  1050. else if ('30103' == index) {
  1051. buildingName = 'Shops_30103_Bakery';
  1052. }
  1053. //早餐车
  1054. else if ('30104' == index) {
  1055. buildingName = 'Shops_30104_BreakfastCar';
  1056. }
  1057. //饮茶店
  1058. else if ('30201' == index) {
  1059. buildingName = 'Shops_30201_TeaShop';
  1060. }
  1061. //点心店
  1062. else if ('30202' == index) {
  1063. buildingName = 'Shops_30202_confectaurant';
  1064. }
  1065. //美食店
  1066. else if ('30203' == index) {
  1067. buildingName = 'Shops_30203_GourmetRestaurant';
  1068. }
  1069. //西餐厅
  1070. else if ('30204' == index) {
  1071. buildingName = 'Shops_30204_WesternRestaurant';
  1072. }
  1073. //花店
  1074. else if ('30301' == index) {
  1075. buildingName = 'Shops_30301_Florist';
  1076. }
  1077. //美发店
  1078. else if ('30302' == index) {
  1079. buildingName = 'Shops_30302_HairSalon';
  1080. }
  1081. //洋装店
  1082. else if ('30303' == index) {
  1083. buildingName = 'Shops_30303_DressShop';
  1084. }
  1085. //珠宝店
  1086. else if ('30304' == index) {
  1087. buildingName = 'Shops_30304_JewelryStore';
  1088. }
  1089. //电影院
  1090. else if ('30305' == index) {
  1091. buildingName = 'Shops_30305_Cinema';
  1092. }
  1093. //路灯
  1094. else if ('401' == index) {
  1095. buildingName = 'Spe_401_StreetLamp';
  1096. }
  1097. //绿化带
  1098. else if ('402' == index) {
  1099. buildingName = 'Spe_402_GreenBelt';
  1100. }
  1101. //花坛
  1102. else if ('403' == index) {
  1103. buildingName = 'Spe_403_FlowerBed';
  1104. }
  1105. //喷泉
  1106. else if ('404' == index) {
  1107. buildingName = 'Spe_404_Pool';
  1108. }
  1109. //警察局
  1110. else if ('405' == index) {
  1111. buildingName = 'Spe_405_PoliceOffice';
  1112. }
  1113. //游乐场
  1114. else if ('406' == index) {
  1115. buildingName = 'Spe_406_Playground';
  1116. }
  1117. return buildingName;
  1118. },
  1119. Grant() {
  1120. },
  1121. Sale() {
  1122. },
  1123. Exchange() {
  1124. }
  1125. });