rename library from engine-php to core-php

This commit is contained in:
openlegends 2024-03-20 01:02:27 +02:00
parent feb357e1a6
commit c97bfd446d
22 changed files with 77 additions and 31 deletions

View File

@ -1,3 +1,3 @@
# Game Assets for Open Legends # Game Assets for Open Legends
Game schemes, items and behavior implementation based on the [engine-php](https://github.com/openlegends/engine-php) interface. Game schemes, items and behavior implementation based on the [core-php](https://github.com/openlegends/core-php) interface.

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Ability; namespace OpenLegends\Asset\Test\Card\Ability;
class Breakthrough extends \OpenLegends\Engine\Abstract\Card\Ability class Breakthrough extends \OpenLegends\Core\Abstract\Card\Ability
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Ability; namespace OpenLegends\Asset\Test\Card\Ability;
class Damage extends \OpenLegends\Engine\Abstract\Card\Ability class Damage extends \OpenLegends\Core\Abstract\Card\Ability
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Ability; namespace OpenLegends\Asset\Test\Card\Ability;
class Drain extends \OpenLegends\Engine\Abstract\Card\Ability class Drain extends \OpenLegends\Core\Abstract\Card\Ability
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Ability; namespace OpenLegends\Asset\Test\Card\Ability;
class Multiple extends \OpenLegends\Engine\Abstract\Card\Ability class Multiple extends \OpenLegends\Core\Abstract\Card\Ability
{ {
private array $_abilities = []; private array $_abilities = [];
@ -20,7 +20,7 @@ class Multiple extends \OpenLegends\Engine\Abstract\Card\Ability
} }
public function add( public function add(
\OpenLegends\Engine\Abstract\Card\Ability $ability \OpenLegends\Core\Abstract\Card\Ability $ability
): void ): void
{ {
$this->_abilities[] = $ability; $this->_abilities[] = $ability;

View File

@ -4,22 +4,22 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Action; namespace OpenLegends\Asset\Test\Card\Action;
class Damage extends \OpenLegends\Engine\Abstract\Card\Action class Damage extends \OpenLegends\Core\Abstract\Card\Action
{ {
private \OpenLegends\Engine\Abstract\Card $_card; private \OpenLegends\Core\Abstract\Card $_card;
private int $_power = 0; private int $_power = 0;
private int $_breakthrough = 0; private int $_breakthrough = 0;
public function __construct( public function __construct(
\OpenLegends\Engine\Abstract\Card $card \OpenLegends\Core\Abstract\Card $card
) { ) {
$this->_card = $card; $this->_card = $card;
} }
public function card( public function card(
\OpenLegends\Engine\Abstract\Card &$card, \OpenLegends\Core\Abstract\Card &$card,
): void ): void
{ {
$damage = $this->getPower() ? $this->getPower() : $this->_card->getPower(); $damage = $this->getPower() ? $this->getPower() : $this->_card->getPower();
@ -64,7 +64,7 @@ class Damage extends \OpenLegends\Engine\Abstract\Card\Action
} }
public function player( public function player(
\OpenLegends\Engine\Abstract\Player &$player, \OpenLegends\Core\Abstract\Player &$player,
): void ): void
{ {
$damage = $this->getPower() ? $this->getPower() : $this->_card->getPower(); $damage = $this->getPower() ? $this->getPower() : $this->_card->getPower();

View File

@ -4,20 +4,20 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Action; namespace OpenLegends\Asset\Test\Card\Action;
class Heal extends \OpenLegends\Engine\Abstract\Card\Action class Heal extends \OpenLegends\Core\Abstract\Card\Action
{ {
private \OpenLegends\Engine\Abstract\Card $_card; private \OpenLegends\Core\Abstract\Card $_card;
private int $_power = 0; private int $_power = 0;
public function __construct( public function __construct(
\OpenLegends\Engine\Abstract\Card $card \OpenLegends\Core\Abstract\Card $card
) { ) {
$this->_card = $card; $this->_card = $card;
} }
public function card( public function card(
\OpenLegends\Engine\Abstract\Card &$card \OpenLegends\Core\Abstract\Card &$card
): void ): void
{ {
$card->setHealth( $card->setHealth(
@ -26,7 +26,7 @@ class Heal extends \OpenLegends\Engine\Abstract\Card\Action
} }
public function player( public function player(
\OpenLegends\Engine\Abstract\Player &$player \OpenLegends\Core\Abstract\Player &$player
): void ): void
{ {
$player->setHealth( $player->setHealth(

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Attribute; namespace OpenLegends\Asset\Test\Card\Attribute;
class Goblin extends \OpenLegends\Engine\Abstract\Card\Attribute class Goblin extends \OpenLegends\Core\Abstract\Card\Attribute
{} {}

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Attribute; namespace OpenLegends\Asset\Test\Card\Attribute;
class Multiple extends \OpenLegends\Engine\Abstract\Card\Attribute class Multiple extends \OpenLegends\Core\Abstract\Card\Attribute
{} {}

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Attribute; namespace OpenLegends\Asset\Test\Card\Attribute;
class Neutral extends \OpenLegends\Engine\Abstract\Card\Attribute class Neutral extends \OpenLegends\Core\Abstract\Card\Attribute
{} {}

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card; namespace OpenLegends\Asset\Test\Card;
class Goblin extends \OpenLegends\Engine\Abstract\Card class Goblin extends \OpenLegends\Core\Abstract\Card
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card; namespace OpenLegends\Asset\Test\Card;
class Mouse extends \OpenLegends\Engine\Abstract\Card class Mouse extends \OpenLegends\Core\Abstract\Card
{ {
public function __construct() public function __construct()
{ {
@ -84,4 +84,50 @@ class Mouse extends \OpenLegends\Engine\Abstract\Card
new \OpenLegends\Asset\Test\Card\Ability\Damage() new \OpenLegends\Asset\Test\Card\Ability\Damage()
); );
} }
public function onCard(
\OpenLegends\Core\Abstract\Card $card
)
{
$damage = new \OpenLegends\Asset\Test\Card\Action\Damage(
$mouse
);
$damage->card(
$card
);
if ($damage->getBreakthrough())
{
$damage = new \OpenLegends\Asset\Test\Card\Action\Damage(
$mouse
);
$damage->setPower(
$damage->getBreakthrough()
);
$damage->player(
$player
);
}
}
public function onPlayer(
\OpenLegends\Core\Abstract\Player $player
)
{
$damage = new \OpenLegends\Asset\Test\Card\Action\Damage(
$mouse
);
$damage->player(
$player
);
}
public function onDiscard(
$card
)
{}
} }

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Rarity; namespace OpenLegends\Asset\Test\Card\Rarity;
class Common extends \OpenLegends\Engine\Abstract\Card\Rarity class Common extends \OpenLegends\Core\Abstract\Card\Rarity
{} {}

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Rarity; namespace OpenLegends\Asset\Test\Card\Rarity;
class Rare extends \OpenLegends\Engine\Abstract\Card\Rarity class Rare extends \OpenLegends\Core\Abstract\Card\Rarity
{} {}

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card; namespace OpenLegends\Asset\Test\Card;
class Rat extends \OpenLegends\Engine\Abstract\Card class Rat extends \OpenLegends\Core\Abstract\Card
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Type; namespace OpenLegends\Asset\Test\Card\Type;
class Animal extends \OpenLegends\Engine\Abstract\Card\Type class Animal extends \OpenLegends\Core\Abstract\Card\Type
{} {}

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Card\Type; namespace OpenLegends\Asset\Test\Card\Type;
class Goblin extends \OpenLegends\Engine\Abstract\Card\Type class Goblin extends \OpenLegends\Core\Abstract\Card\Type
{} {}

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Game; namespace OpenLegends\Asset\Test\Game;
class Arena extends \OpenLegends\Engine\Abstract\Game class Arena extends \OpenLegends\Core\Abstract\Game
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Game\Player; namespace OpenLegends\Asset\Test\Game\Player;
class Player1 extends \OpenLegends\Engine\Abstract\Game\Player class Player1 extends \OpenLegends\Core\Abstract\Game\Player
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Game\Player; namespace OpenLegends\Asset\Test\Game\Player;
class Player2 extends \OpenLegends\Engine\Abstract\Game\Player class Player2 extends \OpenLegends\Core\Abstract\Game\Player
{ {
public function __construct() public function __construct()
{ {

View File

@ -4,5 +4,5 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\Pool; namespace OpenLegends\Asset\Test\Pool;
class Card extends \OpenLegends\Engine\Abstract\Pool\Card class Card extends \OpenLegends\Core\Abstract\Pool\Card
{} {}

View File

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace OpenLegends\Asset\Test\User\Type; namespace OpenLegends\Asset\Test\User\Type;
class Elf extends \OpenLegends\Engine\Abstract\User\Type class Elf extends \OpenLegends\Core\Abstract\User\Type
{ {
public function __construct() public function __construct()
{ {