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 friend class ScriptedEntityComponent; 00033 00034 public: 00035 00036 // Initialisation and deinitialisation 00039 EntityComponent(Entity *parent); 00041 virtual ~EntityComponent(); 00042 00043 // Methods 00045 u32 getID() const; 00046 00048 const std::string& getName() const; 00050 const Entity* getParent(); 00051 00052 protected: 00053 00054 // Normal members 00055 Entity *pParent; 00056 00057 u32 mID; 00058 std::string mName; 00059 00060 private: 00061 00062 // Static members 00063 static u32 mIDCount; 00064 }; 00065 00066 #endif
1.5.8