-
Notifications
You must be signed in to change notification settings - Fork 0
/
Intention.nut
60 lines (50 loc) · 1.09 KB
/
Intention.nut
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
All intentions should extend this class. Thus, when executing an intention, calling Intention.Execute is sufficient.
*/
class Intention {
/**
* Tests whether the Intention is executable.
* @return bool Whether the Intention is executable
*/
function Test();
/**
* Executes the Intention
* @return bool Whether the execution was successful
*/
function Execute();
/**
* Any actions to be executed after the Intention is successfully executed (ie. Execute returns true).
* @return bool success.
*/
function PostExecute();
/**
* Gets the Intention Priority
* @return int The priority of the Intention (between -1 and 100)
*/
function GetPrio();
/**
* Gets the cost of the Intention
* @return int the Intention Cost (> 0)
*/
function GetCost();
constructor() {
}
}
function Intention::Test() {
return false;
}
function Intention::Execute() {
return false;
}
function Intention::PostExecute() {
return false;
}
function Intention::GetPrio() {
return 5;
}
function Intention::Equals(intention) {
return false;
}
function Intention::GetCost() {
return 0;
}