2019-05-14 10:35:37 +02:00
|
|
|
/**
|
|
|
|
* Augmentation-related methods for the Player class (PlayerObject)
|
|
|
|
*/
|
|
|
|
import { IPlayer } from "../IPlayer";
|
|
|
|
|
|
|
|
import { Augmentation } from "../../Augmentation/Augmentation";
|
|
|
|
|
2021-09-09 05:47:34 +02:00
|
|
|
export function hasAugmentation(this: IPlayer, aug: string | Augmentation): boolean {
|
2021-09-05 01:09:30 +02:00
|
|
|
const augName: string = aug instanceof Augmentation ? aug.name : aug;
|
2019-05-14 10:35:37 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
for (const owned of this.augmentations) {
|
|
|
|
if (owned.name === augName) {
|
|
|
|
return true;
|
2019-05-14 10:35:37 +02:00
|
|
|
}
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
2019-05-14 10:35:37 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
for (const owned of this.queuedAugmentations) {
|
|
|
|
if (owned.name === augName) {
|
|
|
|
return true;
|
2019-05-14 10:35:37 +02:00
|
|
|
}
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
2019-05-14 10:35:37 +02:00
|
|
|
|
2021-09-05 01:09:30 +02:00
|
|
|
return false;
|
2019-05-14 10:35:37 +02:00
|
|
|
}
|