X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=6507906d067cf9c3d78162dd6a32916fafa9b76e;hp=b1965ce7dd129076ff82b3af3484ae3599157270;hb=b357615aba1dbde81e3c6999366604e6001010a7;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Character.hh b/src/Character.hh index b1965ce..6507906 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -29,37 +29,46 @@ #ifndef _CHARACTER_HH_ #define _CHARACTER_HH_ -#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: - 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; + 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<3>& aabb) const; -private: - Mf::Tilemap tilemap; - Mf::Animation animation; + Tilemap tilemap; + Animation animation; };