/* * PlayerController.h * * Created on: Nov 27, 2016 * Author: tibi */ #ifndef CONTROLLER_PLAYERCONTROLLER_H_ #define CONTROLLER_PLAYERCONTROLLER_H_ #include #include #include #include #include #define MAX_INVENTORY_SIZE 50 namespace farmlands { namespace components { namespace player { class PlayerInventory; class PlayerMovement : public model::Component { public: PlayerMovement(); virtual ~PlayerMovement(); virtual model::Component* clone() override; virtual void dump(unsigned level) override; virtual void onInitialize() override; virtual void onUpdateLogic() override; virtual void onPreRender() override; model::Direction facingDirection; bool walking, running; private: static model::Direction getDirection(float vx, float vy); bool canMove(float x, float y); // Movement basic::Transform* m_transform; // For getting speed PlayerInventory* m_inventory; }; } } /* namespace components */ } /* namespace farmlands */ #endif /* CONTROLLER_PLAYERCONTROLLER_H_ */