LibraryConfiguration now also knows crate packages.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"name": "lotgd/core",
|
||||
"description": "Core functionality for Legend of the Green Dragon, a text-based RPG game.",
|
||||
"license": "AGPL-3.0",
|
||||
"version": "0.4.0",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"LotGD\\Core\\": "src/",
|
||||
|
||||
@@ -43,7 +43,7 @@ class LibraryConfiguration
|
||||
if ($basePackage && $basePackage->getName() === $package->getName()) {
|
||||
// Whatever the base package is in this repo is at $cwd.
|
||||
$path = $cwd;
|
||||
} else if ($package->getType() === "lotgd-module") {
|
||||
} elseif (in_array($package->getType(), ["lotgd-module", "lotgd-crate"])) {
|
||||
// lotgd-modules are installed in the vendor directory.
|
||||
$installationManager = $composerManager->getComposer()->getInstallationManager();
|
||||
$path = $installationManager->getInstallPath($package);
|
||||
|
||||
@@ -73,6 +73,9 @@ class BattleTest extends CoreModelTestCase
|
||||
|
||||
$battle = new Battle($this->getMockGame($character), $character, $monster);
|
||||
|
||||
$this->assertSame($character, $battle->getPlayer());
|
||||
$this->assertSame($monster, $battle->getMonster());
|
||||
|
||||
for ($n = 0; $n < 99; $n++) {
|
||||
$oldPlayerHealth = $character->getHealth();
|
||||
$oldMonsterHealth = $monster->getHealth();
|
||||
|
||||
Reference in New Issue
Block a user