#include "Terrain.h"
#include "Sprite.h"
#include <cmath>
+#include <memory>
#include "Weapons.h"
#include "Animation.h"
#define rabbittype 0
#define wolftype 1
-class Person
+class Person : public enable_shared_from_this<Person>
{
public:
+ static std::vector<std::shared_ptr<Person>> players;
+
int whichpatchx;
int whichpatchz;
float grabdelay;
- Person *victim;
+ std::shared_ptr<Person> victim;
bool hasvictim;
float updatedelay;
- // convenience
- Joint& joint(int);
- XYZ& jointPos(int);
- XYZ& jointVel(int);
+ // convenience functions
+ inline Joint& joint(int bodypart) { return skeleton.joints[skeleton.jointlabels[bodypart]]; }
+ inline XYZ& jointPos(int bodypart) { return joint(bodypart).position; }
+ inline XYZ& jointVel(int bodypart) { return joint(bodypart).velocity; }
+
void CheckKick();
void CatchFire();
};
const int maxplayers = 10;
-extern Person player[maxplayers];
+//~ extern Person player[maxplayers];
+
#endif