當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Monster類代碼示例

本文整理匯總了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;未經允許,請勿轉載。