22 #ifndef SCUMM_HE_MOONBASE_AI_PATTERN_H 23 #define SCUMM_HE_MOONBASE_AI_PATTERN_H 27 const int NO_PATTERN = 0;
28 const int PATTERN_FOUND = 1;
52 void setSourceHub(
int sh) { _sourceHub = sh; }
53 void setUnit(
int unit) { _unit = unit; }
55 void setPower(
int power) {
64 void setAngle(
int angle) {
65 int tempAngle = angle % 360;
67 if ((tempAngle >= 0) && (tempAngle < 90))
70 if ((tempAngle >= 90) && (tempAngle < 180))
73 if ((tempAngle >= 180) && (tempAngle < 270))
76 if ((tempAngle >= 270))
80 int getSourceHub()
const {
return _sourceHub; }
81 int getUnit()
const {
return _unit; }
82 int getPowerIndex()
const {
return _power; }
83 int getAngleIndex()
const {
return _angle; }
86 if (p1->getSourceHub() != p2->getSourceHub())
89 if (p1->getUnit() != p2->getUnit())
92 if (p1->getUnit() == -999)
95 int temp = abs(p1->getPowerIndex() - p2->getPowerIndex());
100 temp = abs(p1->getAngleIndex() - p2->getAngleIndex());
102 if (temp > 1 && temp < 3)
116 for (
int i = 0; i < 10; i++) {
123 for (
int i = 0; i < 10; i++) {
128 void addPattern(
int sh,
int unit,
int power,
int angle) {
129 theList[listIndex]->setSourceHub(sh);
130 theList[listIndex]->setUnit(unit);
131 theList[listIndex]->setPower(power);
132 theList[listIndex]->setAngle(angle);
140 int evaluatePattern(
int sh,
int unit,
int power,
int angle) {
144 for (
int i = 0; i < 9; i++) {
145 if (patternInstance::comparePatterns(theList[i], patternToMatch)) {
150 delete patternToMatch;
153 return PATTERN_FOUND;
Definition: ai_pattern.h:30
Definition: ai_pattern.h:109