LibraryConfiguration now also knows crate packages.

This commit is contained in:
Vassyli
2018-01-19 17:42:33 +01:00
parent efb333d08a
commit 846ab6018e
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -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/",
+1 -1
View File
@@ -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);
+3
View File
@@ -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();