X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=50c3da51a6418582569a88145be462acc5b017d6;hp=2894c5ebcd35f0591840b9cf33a6514a915358f4;hb=64bd443538f57ad1bdff6c6b35953e72141129b2;hpb=16d1a05b0777e97a45c48e2874aa4e5cc791282e diff --git a/src/Character.hh b/src/Character.hh index 2894c5e..50c3da5 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -29,30 +29,58 @@ #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 +struct Character : public Mf::Entity, public Mf::OctreeInsertable { +protected: + + Mf::Vector2 userForce; + public: + Character(const std::string& name); - ~Character(); + virtual ~Character() {} + + virtual void update(Mf::Scalar t, Mf::Scalar dt); + virtual void draw(Mf::Scalar alpha) const; - void draw(Mf::Scalar alpha); + virtual bool isInsideAabb(const Mf::Aabb& aabb) const; + virtual int getOctant(const Mf::Aabb& aabb) const; - Mf::Tilemap& getTilemap(); - Mf::Animation& getAnimation(); + Mf::State2 previous; + Mf::State2 current; + + Tilemap tilemap; + Animation animation; + + Mf::Aabb aabb_; + Mf::Sphere sphere_; private: - Mf::Tilemap tilemap; - Mf::Animation animation; + + static const Mf::Scalar z = 96.0; };