#ifndef _HPP_KUNGFLOW_TILE
#define _HPP_KUNGFLOW_TILE

#include "physicsobject.hpp"

#include "gaia/gaia.hpp"
using namespace gaia;

class PlayState;

/*
enum e_TileType {
  e_TileType_Traversable,
  e_TileType_NonTraversable
}
*/

class Tile : public PhysicsObject {

  public:

    Tile(const PlayState *playState, const std::string &filename, e_FilterMode filterMode, int x, int y, float zPosition, bool traversable);
    virtual ~Tile();

    virtual void GetSpriteBounds(Vector2 &center, Vector2 &radius) const override;

    virtual void OnStepPhysicsTime() override;
    //virtual void PostStepPhysicsTime() override;
    virtual void Draw(const Viewport &viewport, const Camera &camera) const override;
    
    // PhysicsObject basics
    virtual Vector2 GetPosition() const override { return Vector2(x, y); }
    virtual void SetPosition(const Vector2 &newPosition) { this->x = newPosition.coords[0]; this->y = newPosition.coords[1]; }
    virtual float GetZPosition() const override { return this->zPosition; }
    virtual void SetZPosition(float newZPosition) override { this->zPosition = newZPosition; }
    virtual Vector2 GetMovement() const override { return Vector2(0); }
    virtual void SetMovement(const Vector2 &newMovement) override {}
    virtual float GetZMovement() const override { return 0; }
    virtual void SetZMovement(float newZMovement) {};
    virtual float GetRadius() const override { return 0.5f; }
    virtual float GetHeight() const override { return 0.0f; }

    bool IsTraversable() { return traversable; }
    Object *GetObject() const { return object; }

  private:

    int x;
    int y;
    float zPosition;
    bool traversable;

    Object *object;
    Sprite *sprite;

};

#endif
