
#ifndef ENTITY_H
#define ENTITY_H

#include <Box2D/Box2D.h>

class Entity {
public:
    static string s_objectName;//eg. "Entity"
    static string s_scriptObjectName;//eg. "Script_Entity"
    static class asIObjectType *s_scriptObjectType;

    class asIScriptObject* m_scriptObject;
    class asIScriptContext *m_scriptContext;

    int m_tickTimeout;

    string m_tostring;
    string m_name;
    b2Vec2 m_pos;
    b2Vec2 m_vel;
    b2Color m_color;

    bool m_nearWall;

public:
    Entity();
    virtual ~Entity();

    void AddRef() {} //script must not intanciate!
    void Release() {}

    static bool loadScript(const char* objectName/*, const char* scriptFile*/);

    virtual bool instanciate();
    virtual bool script_init();
    virtual float script_message(int msg, Entity* e);
    virtual string script_tostring();

    virtual void setTostring(string s);
    virtual string getTostring();
    virtual void setName(string s);
    virtual string getName();
    virtual void setPos(b2Vec2 v);
    virtual b2Vec2 getPos();
    virtual void setVel(b2Vec2 v);
    virtual b2Vec2 getVel();
    virtual void setColor(b2Color v);

    void step();
};

#endif
