2 |
==================== |
==================== |
3 |
pod.h |
pod.h |
4 |
==================== |
==================== |
5 |
version 0.1 |
version 0.0.2 |
6 |
==================== |
==================== |
7 |
|
|
8 |
This is the basic class for AXIS pods. Pods are the moving components on the map and contain individual shapes. |
This is the basic class for AXIS pods. Pods are the moving components on the map and contain individual shapes. |
13 |
|
|
14 |
CHANGELOG: |
CHANGELOG: |
15 |
---------------------- |
---------------------- |
16 |
0.1 - March 31, 2003 |
0.0.2 - June 3, 2003 |
17 |
|
too many changes to comment on. basic mission interface installed. |
18 |
|
0.0.1 - May 31, 2003 |
19 |
base pod class. still lots to do, but basic functionality is in. pods can be given paths and can walk across the map. |
base pod class. still lots to do, but basic functionality is in. pods can be given paths and can walk across the map. |
20 |
stats are all just static dummy values for testing. |
stats are all just static dummy values for testing. |
21 |
no static scope pod vector, shape contents, or mission logic / interface implemented yet. |
no static scope pod vector, shape contents, or mission logic / interface implemented yet. |
33 |
=============================================================== |
=============================================================== |
34 |
*/ |
*/ |
35 |
|
|
36 |
|
#ifndef POD_H |
37 |
|
#define POD_H |
38 |
|
|
39 |
|
|
40 |
#include "../blotchmaker/stlastar.h" |
#include "../blotchmaker/stlastar.h" |
41 |
#include <string> |
#include <string> |
42 |
#include <vector> |
#include <vector> |
43 |
|
#include "missions.h" |
44 |
|
|
45 |
// defined elsewhere |
// defined elsewhere |
46 |
class MapSearchNode_Pod; |
class MapSearchNode_Pod; |
47 |
class Map; |
class Map; |
48 |
|
|
49 |
|
|
|
enum mission { |
|
|
IDLE=0, |
|
|
HALT, |
|
|
PATROL, |
|
|
INTERCEPT, |
|
|
DEFEND, |
|
|
FOLLOW, |
|
|
HARVEST, |
|
|
FLAG, |
|
|
SCOUT, |
|
|
EXPLORE, |
|
|
BERSERK |
|
|
}; |
|
|
|
|
50 |
|
|
51 |
class Pod { |
class Pod { |
52 |
public: |
public: |
66 |
int GetSpd(); |
int GetSpd(); |
67 |
int GetXPos(); |
int GetXPos(); |
68 |
int GetYPos(); |
int GetYPos(); |
69 |
|
int GetAvoid(); |
70 |
|
int GetEngage(); |
71 |
|
int GetXp(); |
72 |
|
|
73 |
// set functions |
// set functions |
74 |
void SetMovementGoal(int x, int y); // sets the goal we want to move to |
void SetMovementGoal(int x, int y); // sets the goal we want to move to |
75 |
void SetMission(mission m /*optional mission perams*/); |
void SetMission(mission_type m); |
76 |
void SetEngagement(int x); |
void SetEngage(int x); |
77 |
void SetAvoidence(int x); |
void SetAvoid(int x); |
78 |
|
bool Place(int x, int y); // returns 1 if succesfull, 0 if could not place |
79 |
|
|
80 |
// shape management: |
// shape management: |
81 |
// add shape |
// add shape |
85 |
bool CreatePath(int x1, int y1, int x2, int y2); //creates a path from a start and end point. path is stored in path variable |
bool CreatePath(int x1, int y1, int x2, int y2); //creates a path from a start and end point. path is stored in path variable |
86 |
bool Walk(); // walks the assigned path until it runs out of juice. |
bool Walk(); // walks the assigned path until it runs out of juice. |
87 |
|
|
88 |
// misc functions |
// Mission Interface - returns a pointer to the pod's mission. The actual mission pointer is private |
89 |
// void KillMe(); // PENDING FUNCTION - destroys the pod, but not it's record in the vector. |
// so this function facilitates a public mission interface. use it like so: |
90 |
|
// pod->Misn()->Exe(); |
91 |
|
Mission* Misn(); |
92 |
|
|
93 |
// GENERAL POD GOODIES |
// GENERAL POD GOODIES |
94 |
static void SetMapPointer(Map &incoming_map); // give all pods in existence a pointer to the map to work from |
static void SetMapPointer(Map &incoming_map); // give all pods in existence a pointer to the map to work from |
105 |
int acu; // acuity bonus multiplier |
int acu; // acuity bonus multiplier |
106 |
int size; // size total - sum of shapes' size |
int size; // size total - sum of shapes' size |
107 |
int spd; // speed - average of shape's speed - possibly lowest of the group? |
int spd; // speed - average of shape's speed - possibly lowest of the group? |
108 |
|
int xp; // pod experience - seperate from mission experience. |
109 |
|
|
110 |
int x_pos; // current x position on map |
int x_pos; // current x position on map |
111 |
int y_pos; // current y position on map |
int y_pos; // current y position on map |
112 |
|
|
113 |
int align; // AXIS alignment. you need to decode the color/number via some kind of AXIS class if needed |
int align; // AXIS alignment. you need to decode the color/number via some kind of AXIS class if needed |
114 |
|
|
|
mission misn; // current mission. needs a queue though |
|
|
|
|
115 |
int avoid; // avoidence level. 0-9, 9=high |
int avoid; // avoidence level. 0-9, 9=high |
116 |
int engage; // engagement priority. 0=none, 1=weaker, 2=stronger, 3=all |
int engage; // engagement priority. 0=none, 1=weaker, 2=stronger, 3=all |
117 |
|
|
118 |
AStarSearch<MapSearchNode_Pod>* path; // the path we want to walk - a pointer to an A* search |
AStarSearch<MapSearchNode_Pod>* path; // the path we want to walk - a pointer to an A* search |
119 |
|
|
120 |
// --> list of shapes in the pod <-- |
// --> list of shapes in the pod <-- |
121 |
|
int num_shapes; // number of shapes in pod |
122 |
|
|
123 |
|
Mission* misn; // current mission. TODO: needs a queue eventually |
124 |
|
|
125 |
//FUNCTIONS |
//FUNCTIONS |
126 |
void PromptEngagement(); |
void PromptEngagement(); |
127 |
|
|
128 |
|
|
129 |
// GENERAL POD VARS |
// GENERAL POD VARS |
130 |
static Map* map; // a pointer to the map we are working on. static makes it available to all pods in use. |
static Map* map; // a pointer to the map we are working on. static makes it available to all pods in use. |
131 |
static int pod_count; // total pods on the map number - doubles as a pod ID counter |
static int pod_count; // total pods on the map number - doubles as a pod ID counter |
132 |
|
// TODO: |
133 |
static vector<Pod*> pod_index; // a vector of pointers to pods. now we can look them up by ID number |
static vector<Pod*> pod_index; // a vector of pointers to pods. now we can look them up by ID number |
134 |
|
|
135 |
// GENERAL POD FUNCTIONS |
// GENERAL POD FUNCTIONS |
139 |
|
|
140 |
}; |
}; |
141 |
|
|
142 |
|
#endif |
143 |
|
|
144 |
|
|
145 |
|
|