本文整理汇总了PHP中Monster类的典型用法代码示例。如果您正苦于以下问题:PHP Monster类的具体用法?PHP Monster怎么用?PHP Monster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Monster类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testMonsters
public function testMonsters()
{
$frank = new Monster();
$frank->title = 'Dr.';
$frank->name = 'Frankenstein';
$this->assertEquals('Dr. Frankenstein', $frank->render());
$dracula = new Monster();
$dracula->title = 'Count';
$dracula->name = 'Dracula';
$this->assertEquals('Count Dracula', $dracula->render());
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:MustacheHigherOrderSectionsTest.php
示例2: testFindQueryWithMultipleWheres
public function testFindQueryWithMultipleWheres()
{
$connection = m::mock('juicyORM\\Database\\DbConnection');
$connection->shouldReceive('query')->with('SELECT * FROM "monster" WHERE "species" = ? AND "origin" = ?', array('Jormungandr', 'Norse'))->once()->andReturn(array($this->fake_monster_table[2]));
$db = juicyORM\Database\DB::Instance($this->dbConfig, $connection, true);
$user_response = Monster::where("species", "=", "Jormungandr")->where("origin", "=", "Norse")->find();
$this->assertEquals(gettype($user_response), 'array');
$this->assertEquals(gettype($user_response[0]), 'object');
$this->assertEquals(get_class($user_response[0]), 'juicyORM\\Database\\ModelRow');
$this->assertEquals($user_response[0]->species, 'Jormungandr');
$this->assertEquals($db->runtime_info(), array(array('sql' => 'SELECT * FROM "monster" WHERE "species" = ? AND "origin" = ?', 'bindings' => array('Jormungandr', 'Norse'))));
}
开发者ID:nkalush,项目名称:orm,代码行数:12,代码来源:ORMVersionThreeTest.php
示例3: attack
public function attack(Monster $monster)
{
$monster->receiveAttack($this->wapen()->ap());
}
开发者ID:vinillo,项目名称:example,代码行数:4,代码来源:game.php
示例4: session_start
<?php
require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Monster.php";
session_start();
if (empty($_SESSION['list_of_monsters'])) {
$_SESSION['list_of_monsters'] = array();
}
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get("/", function () use($app) {
return $app['twig']->render('monsters.html.twig', array('monster' => Monster::getAll()));
});
$app->post("/add_monster", function () use($app) {
$monster = new Monster($_POST['name']);
$monster->saveMonster();
return $app['twig']->render('add_monster.html.twig', array('newmonster' => $monster));
});
$app->post("/release_monsters", function () use($app) {
Monster::releaseAll();
return $app['twig']->render('release_monsters.html.twig');
});
return $app;
开发者ID:kylepratuch,项目名称:Tamagotchi_App,代码行数:23,代码来源:app.php
示例5: present
public function present()
{
$monster = new Monster();
$monster->giveMonster();
}
开发者ID:kawazoe-yusuke,项目名称:design-pattern,代码行数:5,代码来源:adapter_2.php
示例6: spawnTo
public function spawnTo(Player $player)
{
$pk = $this->addEntityDataPacket($player);
$pk->type = Creeper::NETWORK_ID;
$player->dataPacket($pk);
parent::spawnTo($player);
}
开发者ID:Creeperface01,项目名称:ImagicalMine,代码行数:7,代码来源:Creeper.php
示例7: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddMobPacket();
$pk->eid = $this->getId();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->getData();
$player->dataPacket($pk);
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
parent::spawnTo($player);
}
开发者ID:rryy,项目名称:PocketMine-MP,代码行数:15,代码来源:Zombie.php
示例8: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk);
parent::spawnTo($player);
}
开发者ID:owensel,项目名称:PocketMine-0.13.0,代码行数:17,代码来源:Zombie.php
示例9: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Blaze::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y + 2;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
$player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ);
parent::spawnTo($player);
}
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:18,代码来源:Blaze.php
示例10: spawnTo
public function spawnTo(Player $player)
{
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = PigZombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->speedX = $this->motionX;
$pk->speedY = $this->motionY;
$pk->speedZ = $this->motionZ;
$pk->yaw = $this->yaw;
$pk->pitch = $this->pitch;
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk);
parent::spawnTo($player);
$pk = new MobEquipmentPacket();
$pk->eid = $this->getId();
$pk->item = new ItemItem(283);
$pk->slot = 0;
$pk->selectedSlot = 0;
$player->dataPacket($pk);
}
开发者ID:PepbookPvP,项目名称:Genisys,代码行数:23,代码来源:PigZombie.php
示例11: initialize
public function initialize()
{
self::$db = new MDB('ar');
}
开发者ID:niczhangqiang,项目名称:arserver,代码行数:4,代码来源:Monster.php
示例12: __construct
public function __construct()
{
parent::__construct();
$this->createStages();
}
开发者ID:BradlySharpe,项目名称:Digimon,代码行数:5,代码来源:Egg.php
注:本文中的Monster类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论