ccdevnet / openc2e

openc2e

This URL has Read+Write access

openc2e / SkeletalCreature.h
100644 54 lines (43 sloc) 1.53 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
#include "creaturesImage.h"
#include "attFile.h"
 
// for enum lifestage (0 to 6)
#include "genome.h"
 
#include "openc2e.h"
#include "Creature.h"
 
class SkeletalCreature : public Creature {
private:
unsigned int species;
unsigned int breed;
lifestage stage;
 
unsigned int direction;
unsigned int pose[14];
unsigned int facialexpression;
unsigned int pregnancy;
bool eyesclosed;
 
creaturesImage *images[14];
attFile att[14];
 
int width, height, adjustx, adjusty;
int partx[14], party[14];
 
std::string dataString(unsigned int _stage, bool sprite);
 
unsigned int gaiti;
creatureGait *gaitgene;
 
public:
SkeletalCreature(genomeFile *g, unsigned char _family, bool is_female, unsigned char _variant, unsigned int s, unsigned int b, lifestage t);
void render(SDLBackend *renderer, int xoffset, int yoffset);
void recalculateSkeleton();
unsigned int getPose(unsigned int i) { return pose[i]; }
void setPose(unsigned int p);
void setPose(std::string s);
void setPoseGene(unsigned int p);
void setGaitGene(unsigned int g);
void gaitTick();
unsigned int getPregnancy() { return pregnancy; }
void setPregnancy(unsigned int p) { assert(p < 4); pregnancy = p; }
bool getEyesClosed() { return eyesclosed; }
void setEyesClosed(bool e) { eyesclosed = e; }
unsigned int getFacialExpression() { return facialexpression; }
void setFacialExpression(unsigned int f) { assert (f < 6); facialexpression = f; }
unsigned int getWidth() { return width; }
unsigned int getHeight() { return height; }
};
 
/* vim: set noet: */