aozhiwei 4f4a2bacd1 1
2019-04-15 14:09:52 +08:00

63 lines
1.2 KiB
C++

#pragma once
namespace cs
{
class MFObjectPart;
class MFObjectFull;
}
enum EntityType_e
{
ET_None = 0,
ET_Player = 1,
ET_Obstacle = 2,
ET_Building = 3,
ET_LootSpawner = 4,
ET_Loot = 5,
ET_DeadBody = 6,
ET_Decal = 7,
ET_Projectile = 8,
ET_Smoke = 9,
ET_Bullet = 20,
ET_MAX
};
enum EntitySubType_e
{
EST_None = 0,
EST_Player = 1,
EST_Android = 2,
};
class Room;
class Obstacle;
class ColliderComponent;
class Entity
{
public:
unsigned short entity_uniid = 0;
EntityType_e entity_type = ET_None;
EntitySubType_e entity_subtype = EST_None;
long long create_frameno = 0;
Room* room = nullptr;
Vector2D pos;
int updated_times = 0;
std::list<ColliderComponent*> colliders;
bool deleted = false;
a8::XTimerAttacher xtimer_attacher;
Obstacle* last_collision_door = nullptr;
Entity();
virtual ~Entity();
virtual void Initialize();
virtual void Update(int delta_time) {};
virtual void FillMFObjectPart(cs::MFObjectPart* part_data) {};
virtual void FillMFObjectFull(cs::MFObjectFull* full_data) {};
virtual float GetSpeed() { return 1.0f;};
bool TestCollision(Entity* b);
void ClearColliders();
};