Adding more directory-related unit tests. Several more bug fixes and QoL improvements

This commit is contained in:
danielyxie
2019-05-14 01:35:37 -07:00
parent 1775ea86ff
commit fef7aaba8f
24 changed files with 423 additions and 85 deletions

View File

@@ -0,0 +1,20 @@
/**
* Augmentation-related methods for the Player class (PlayerObject)
*/
import { IPlayer } from "../IPlayer";
import { Augmentation } from "../../Augmentation/Augmentation";
export function hasAugmentation(this: IPlayer, aug: string | Augmentation): boolean {
const augName: string = (aug instanceof Augmentation) ? aug.name : aug;
for (const owned of this.augmentations) {
if (owned.name === augName) { return true; }
}
for (const owned of this.queuedAugmentations) {
if (owned.name === augName) { return true; }
}
return false;
}