openlegends / core
Core Library for OpenLegends Game
dev-main
2024-03-19 22:59 UTC
This package is auto-updated.
Last update: 2024-12-20 00:26:23 UTC
README
Project under development!
Install
composer require openlegends/core:dev-main
Test features
Cards
composer require openlegends/asset:dev-main
<?php
require_once __DIR__ . '/../vendor/autoload.php';
$mouse = new \OpenLegends\Asset\Test\Card\Mouse();
$rat = new \OpenLegends\Asset\Test\Card\Rat();
$damage = new \OpenLegends\Asset\Test\Card\Action\Damage(
$mouse
);
$damage->card(
$rat
);
var_dump(
$mouse->getHealth()
);
var_dump(
$rat->getHealth()
);
Pool
Useful for decks, hand, discard pile, etc
composer require openlegends/asset:dev-main
<?php
require_once __DIR__ . '/../vendor/autoload.php';
$deck = new \OpenLegends\Asset\Test\Pool\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()
);
var_dump(
$deck->getRandomCard()->getName()
);