00001 // ///////////////////////////////////////////////////////////////////////////// 00002 // 00003 // Name: EntityComponent.h 00004 // Author: Michael Bartsch (ZCCdark203) 00005 // 00006 // Desc : Declaration of the EntityComponent class. 00007 // 00008 // License: Copyright (C) 2009 Michael Bartsch and Contributors 00009 // 00010 // This program is free software: you can redistribute it 00011 // and/or modify it under the terms of the zlib/libpng License. 00012 // See main.cpp for conditions of distribution and use. 00013 // 00014 // ///////////////////////////////////////////////////////////////////////////// 00015 00016 #ifndef __ENTITYCOMPONENT_H__ 00017 #define __ENTITYCOMPONENT_H__ 00018 00019 // Include files 00020 #include "../dependencies.h" 00021 #include "ReferenceCounted.h" 00022 #include "Entity.h" 00023 00024 // Forward declarations 00025 class Entity; 00026 00027 00028 // EntityComponent class 00030 class EntityComponent : public sigslot::has_slots<>, public ReferenceCounted 00031 { 00032 public: 00033 00034 // Initialisation and deinitialisation 00037 EntityComponent(Entity *parent); 00039 virtual ~EntityComponent(); 00040 00041 // Methods 00043 u32 getID() const; 00044 00046 const std::string& getName() const; 00048 const Entity* getParent(); 00049 00051 void setName(const std::string &name); 00052 00053 protected: 00054 00055 // Normal members 00056 Entity *pParent; 00057 00058 u32 mID; 00059 std::string mName; 00060 00061 private: 00062 00063 // Static members 00064 static u32 mIDCount; 00065 }; 00066 00067 #endif