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