X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FCharacter.hh;h=5dfde01922860cbbbe6759f00eacc5a13b1f2bee;hb=5918751f97a3eb976a7b24647786109edc58234c;hp=b1965ce7dd129076ff82b3af3484ae3599157270;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4;p=chaz%2Fyoink diff --git a/src/Character.hh b/src/Character.hh index b1965ce..5dfde01 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -29,37 +29,47 @@ #ifndef _CHARACTER_HH_ #define _CHARACTER_HH_ -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include + +#include "Animation.hh" +#include "Tilemap.hh" + + + +struct Character; +typedef boost::shared_ptr CharacterP; /** - * Parent class of animate objects with "personalities." + * Parent class of animate objects with "personalities." This basically + * includes the heroine herself and the bad guys. */ -class Character : public Mf::Drawable +class Character : public Mf::RigidBody2, public Mf::OctreeInsertable { public: - Character(const std::string& name); - ~Character(); - void draw(Mf::Scalar alpha); + Character(const std::string& name); + virtual ~Character() {} - Mf::Tilemap& getTilemap(); - Mf::Animation& getAnimation(); + virtual void update(Mf::Scalar t, Mf::Scalar dt); + virtual void draw(Mf::Scalar alpha) const; + virtual int getOctant(const Mf::Aabb& aabb) const; - struct Exception : public std::runtime_error - { - explicit Exception(const std::string& what_arg) : - std::runtime_error(what_arg) {} - }; + Tilemap tilemap; + Animation animation; private: - Mf::Tilemap tilemap; - Mf::Animation animation; + + static const Mf::Scalar z = 96.0; };