当前位置: 首页>>代码示例>>PHP>>正文


PHP map::load_one方法代码示例

本文整理汇总了PHP中map::load_one方法的典型用法代码示例。如果您正苦于以下问题:PHP map::load_one方法的具体用法?PHP map::load_one怎么用?PHP map::load_one使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在map的用法示例。


在下文中一共展示了map::load_one方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __create

 public static function __create()
 {
     $trigger = new static();
     $trigger->sprite_url = 'not-found.png';
     $trigger->map_id = 1;
     $trigger->name = 'Trigger';
     $trigger->x = 50;
     $trigger->y = 50;
     $weaponDealer = clone $trigger;
     $weaponDealer->script = 'merchants/weapon_dealer';
     $weaponDealer->script_arguments = '{"min_level":0,"max_level":80}';
     $weaponDealer->name = 'Weapon Dealer';
     $weaponDealer->map_id = map::load_one('Trainee Village', 'name')->id;
     $weaponDealer->save();
     $weaponDealer->id = null;
     $weaponDealer->name = 'Weapon Dealer';
     $weaponDealer->map_id = map::load_one('Kinata', 'name')->id;
     $weaponDealer->save();
     $dungeonEntrance = clone $trigger;
     $dungeonEntrance->script = 'dungeon_entrance';
     $dungeonEntrance->script_arguments = '{"dungeon_script":"","modes":[0,1,2,3,4,5]}';
     $dungeonEntrance->name = 'Dungeon Entrance';
     $traineeCave = clone $dungeonEntrance;
     $traineeCave->script_arguments = '{"dungeon_script":"trainee_cave","modes":[0,1,2,3,4,5]}';
     $traineeCave->name = 'Trainee Cave';
     $traineeCave->map_id = map::load_one('Trainee Fields', 'name')->id;
     $traineeCave->save();
     $kinataUnderground = clone $dungeonEntrance;
     $kinataUnderground->script_arguments = '{"dungeon_script":"kinata_underground","modes":[0,1,2,3,4,5]}';
     $kinataUnderground->name = 'Kinata Underground';
     $kinataUnderground->x = 100;
     $kinataUnderground->y = 100;
     $kinataUnderground->map_id = map::load_one('Kinata', 'name')->id;
     $kinataUnderground->save();
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:35,代码来源:trigger.php

示例2: index_action

 public function index_action()
 {
     $char = character::current();
     $mapId = $char->map_id;
     $map = map::load_one($mapId);
     if (!$map) {
         page::redirect('/world/map-not-found');
     }
     $this->set('map', $map);
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:10,代码来源:world.php

示例3: map

 public function map($newMap = null)
 {
     static $map = null;
     if (!$map) {
         $map = map::load_one($this->map_id);
     }
     if ($newMap) {
         if ($newMap instanceof map) {
             $this->map_id = $newMap->id;
             $this->save();
             $map = $newMap;
         } else {
             if (is_int($newMap)) {
                 $this->map_id = $newMap;
                 $this->save();
                 $map = map::load_one($this->map_id);
             }
         }
     }
     return $map;
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:21,代码来源:character.php


注:本文中的map::load_one方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。