1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace loyalsoft;
- /**
- * 玩家关卡地图数据
- * @author gwang
- * @version
- * 1.0.0 Created at 2021年3月2日14:32:52 关卡分三层处理 大陆->区域->关卡.
- */
- class Info_Map extends Object_ext {
- /**
- * 大陆数据
- * @var dict<int,Ins_Mainland>
- */
- public $mainlands;
- function __construct($arg = null) {
- if (null === $arg) {
- // 直接初始化8个大陆的基本数据
- foreach (GameConfig::gate_mainland() as $id => $land) {
- $this->mainlands = ObjectInit();
- $ins = new Ins_Mainland();
- $ins->landId = $id;
- if (1 == $id) { # 第一个大陆, 直接开启第一个区域
- $zones = explode(',', $land->containZones);
- $zoneid = $zones[0];
- $zone = new Ins_Mapzone();
- $zone->zoneid = $zoneid;
- $zonecfg = GameConfig::gate_zone_getItem($zoneid);
- my_Assert($zonecfg, ErrCode::err_const_no);
- $gateIds = explode(',', $zonecfg->contains);
- $zone->highest = $gateIds[0];
- $ins->normal->$zoneid = $zone;
- }
- $this->$id = $ins;
- }
- } else {
- parent::__construct($arg);
- }
- }
- }
|