mirror of
https://github.com/openlegends/asset-php.git
synced 2025-02-08 04:54:15 +00:00
update engine api
This commit is contained in:
parent
99c9290bbb
commit
feb357e1a6
@ -8,45 +8,12 @@ class Arena extends \OpenLegends\Engine\Abstract\Game
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$deck = new \OpenLegends\Asset\Test\Pool\Card();
|
||||
|
||||
for ($i = 0; $i < 3; $i++) // generate 3 copies of each card
|
||||
{
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Goblin()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Mouse()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Rat()
|
||||
);
|
||||
}
|
||||
|
||||
$this->setDeck(
|
||||
$deck
|
||||
$this->addPlayer(
|
||||
new \OpenLegends\Asset\Test\Game\Player\Player1()
|
||||
);
|
||||
|
||||
$this->setHand(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setPile(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setLeft(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setRight(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setPlayer(
|
||||
new \OpenLegends\Asset\Test\Player\Elf()
|
||||
$this->addPlayer(
|
||||
new \OpenLegends\Asset\Test\Game\Player\Player2()
|
||||
);
|
||||
}
|
||||
}
|
52
src/Test/Game/Player/Player1.php
Normal file
52
src/Test/Game/Player/Player1.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OpenLegends\Asset\Test\Game\Player;
|
||||
|
||||
class Player1 extends \OpenLegends\Engine\Abstract\Game\Player
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->setHealth(
|
||||
30
|
||||
);
|
||||
|
||||
$deck = new \OpenLegends\Asset\Test\Pool\Card();
|
||||
|
||||
for ($i = 0; $i < 3; $i++) // generate 3 copies of each card
|
||||
{
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Goblin()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Mouse()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Rat()
|
||||
);
|
||||
}
|
||||
|
||||
$this->setDeck(
|
||||
$deck
|
||||
);
|
||||
|
||||
$this->setHand(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setPile(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setLeft(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setRight(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
}
|
||||
}
|
52
src/Test/Game/Player/Player2.php
Normal file
52
src/Test/Game/Player/Player2.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OpenLegends\Asset\Test\Game\Player;
|
||||
|
||||
class Player2 extends \OpenLegends\Engine\Abstract\Game\Player
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->setHealth(
|
||||
30
|
||||
);
|
||||
|
||||
$deck = new \OpenLegends\Asset\Test\Pool\Card();
|
||||
|
||||
for ($i = 0; $i < 3; $i++) // generate 3 copies of each card
|
||||
{
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Goblin()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Mouse()
|
||||
);
|
||||
|
||||
$deck->addCard(
|
||||
new \OpenLegends\Asset\Test\Card\Rat()
|
||||
);
|
||||
}
|
||||
|
||||
$this->setDeck(
|
||||
$deck
|
||||
);
|
||||
|
||||
$this->setHand(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setPile(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setLeft(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
|
||||
$this->setRight(
|
||||
new \OpenLegends\Asset\Test\Pool\Card()
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user