X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=28e588b627da8ccc0b45b49dc80cbac1b37fc258;hp=b1965ce7dd129076ff82b3af3484ae3599157270;hb=2fdb5f5824826a6c54f5afde8c62eafd24c1a152;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Character.hh b/src/Character.hh index b1965ce..28e588b 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -29,37 +29,53 @@ #ifndef _CHARACTER_HH_ #define _CHARACTER_HH_ -#include -#include -#include -#include +#include + +#include +#include +#include +#include +#include +#include + +#include "Animation.hh" +#include "Tilemap.hh" + + + +class 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(); + virtual ~Character() {} - void draw(Mf::Scalar alpha); + virtual void update(Mf::Scalar t, Mf::Scalar dt); + virtual void draw(Mf::Scalar alpha) const; - Mf::Tilemap& getTilemap(); - Mf::Animation& getAnimation(); + void setZCoord(Mf::Scalar z); + void addImpulse(Mf::Vector2 impulse); + void addForce(Mf::Vector2 force); + void setPosition(Mf::Vector2 position); - struct Exception : public std::runtime_error - { - explicit Exception(const std::string& what_arg) : - std::runtime_error(what_arg) {} - }; + virtual int getOctant(const Mf::Aabb& aabb) const; + + Tilemap tilemap; + Animation animation; private: - Mf::Tilemap tilemap; - Mf::Animation animation; + + mutable Mf::Scalar mZCoord; };