X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FCharacter.hh;h=00e5a4b2b6912dc8ceae0b27643d5f67496102ea;hp=5aeaeba0a7af1b8a5ea6e1c6f7f53fbee43c48e2;hb=df541170776dc4ac4f241ca480812bd70bcb6eca;hpb=57b78ebe21b1b48acd337daa5a1cb8c383959cfa diff --git a/src/Character.hh b/src/Character.hh index 5aeaeba..00e5a4b 100644 --- a/src/Character.hh +++ b/src/Character.hh @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include @@ -111,6 +111,9 @@ struct Character : public Mf::Entity recalculate(); } + // these two operator overloads all using the state in generic + // interpolator implementations + State operator*(Mf::Scalar scalar) const { State state = *this; @@ -120,7 +123,7 @@ struct Character : public Mf::Entity return state; } - State operator+(State state) const + State operator+(const State& state) const { State newState = *this; newState.position += state.position; @@ -153,7 +156,7 @@ public: } Character(const std::string& name); - virtual ~Character(); + inline virtual ~Character() {} void update(Mf::Scalar t, Mf::Scalar dt); void handleEvent(const Mf::Event& event); @@ -164,15 +167,15 @@ public: }; -inline Character::State operator*(Mf::Scalar scalar, - const Character::State& state) -{ - Character::State newState = state; - newState.position *= scalar; - newState.momentum *= scalar; - newState.recalculate(); - return newState; -} +//inline Character::State operator*(Mf::Scalar scalar, + //const Character::State& state) +//{ + //Character::State newState = state; + //newState.position *= scalar; + //newState.momentum *= scalar; + //newState.recalculate(); + //return newState; +//} #endif // _CHARACTER_HH_