1
1

CombatPokeUnit.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /// <reference path="../ContentUnit.ts" />
  2. /// <reference path="../../Things/Person.ts" />
  3. /// <reference path="../../Things/Bodypart/SexHole.ts" />
  4. /// <reference path="../../Things/Bodypart/SexStick.ts" />
  5. class CombatPokeUnit extends ContentUnit {
  6. private target : ContentDifferential = new ContentDifferential(Person);
  7. private markers : ContentDifferential = new ContentDifferential();
  8. public constructor () {
  9. super();
  10. }
  11. public setTarget (it : Thing | typeof Thing) {
  12. this.target = new ContentDifferential(it);
  13. return this;
  14. }
  15. public getTarget () {
  16. return this.target;
  17. }
  18. public addMarker (...marker : Array<ContentMarker | AdaptiveDifferential>) {
  19. this.markers.addNoun(...marker);
  20. return this;
  21. }
  22. public getMarkers () {
  23. return [...this.markers.nouns];
  24. }
  25. public getScore () {
  26. return this.target.getScore() + this.markers.getScore();
  27. }
  28. public isMatch (cu : CombatPokeUnit) {
  29. console.warn("Chegking :)");
  30. if (cu instanceof CombatPokeUnit) {
  31. console.log(this.markers.nouns, cu.markers.nouns);
  32. return this.target.isMatch(cu.target) &&
  33. this.markers.isMatch(cu.markers);
  34. }
  35. return false;
  36. }
  37. }