-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.c
More file actions
107 lines (105 loc) · 2.63 KB
/
structs.c
File metadata and controls
107 lines (105 loc) · 2.63 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
typedef struct pythonCallback{
struct pythonCallback * nextCallback;
int id, selectedName, mouseX, mouseY, leftButtonDown, deltaTicks, isAnimating, leftmostCharPos, rightmostCharPos, nameValue;
char keyArray[200];
}PYTHONCALLBACK;
typedef struct uiElementStruct{
struct uiElementStruct * nextElement;
struct uiElementStruct * childElements;
int name;
float xPosition,yPosition,width,height,textSize,textXPosition,textYPosition;
int textureIndex,cursorPosition,leftmostCharPos,rightmostCharPos;
char hidden,cursorIndex,fontIndex,focused, recalculateText;
char * realText;
char * text;
char * textColor;
char * color;
char * mouseOverColor;
}UIELEMENTSTRUCT;
typedef struct unit{
char * id;
struct unit * nextUnit;
double xPos,yPos,xPosDraw,yPosDraw;
int health,maxHealth;
char textureIndex,isNextUnit,visible,level,player;
}UNIT;
typedef struct node{
// UNIT * unit;
int name;
uint hash;
float xPos;
float yPos;
char xIndex;
char yIndex;
char tileValue;
// char pyRoadValue;
// char city;
char playerStartValue;
// char selected;
// char onMovePath;
// char cursorIndex;
char visible;
char * debugColor;
}NODE;
typedef struct cityNodeListElem{
struct cityNodeListElem * nextCity;
NODE * node;
}CITYNODELISTELEM;
typedef struct map{
struct node * nodes;
int polarity;
int height;
int width;
int size;
}MAP;
typedef struct movePathNode{
struct movePathNode * nextNode;
float xPos;
float yPos;
}MOVEPATHNODE;
typedef struct selectedNode{
float xPos;
float yPos;
}SELECTEDNODE;
typedef struct sound{
struct sound * nextSound;
int index;
}SOUND;
typedef struct animation{
Uint32 time;
int type;
float xPos, yPos;
long damage;
struct unit * unit;
}ANIMATION;
//typedef struct animation animation;
struct listelement{
ANIMATION * item;
struct listelement * link;
};
typedef struct listelement listelement;
listelement * AddItem(listelement * listpointer, ANIMATION * animation){
listelement * lp = listpointer;
if(listpointer != 0) {
while(listpointer->link != 0)
listpointer = listpointer->link;
listpointer->link = (struct listelement *)malloc(sizeof(listelement));
listpointer = listpointer->link;
listpointer->link = 0;
listpointer->item = animation;
return lp;
}
else {
listpointer = (struct listelement *)malloc(sizeof(listelement));
listpointer->link = 0;
listpointer->item = animation;
return listpointer;
}
}
listelement * RemoveItem(listelement * listpointer) {
listelement * tempp;
// printf("Element removed is %d\n", listpointer->item);
tempp = listpointer->link;
free(listpointer);
return tempp;
}