Exemplo n.º 1
0
 /* ---------------------------- On Functions ---------------------------- */
 void Entity::OnAdd(Entity* _entity) {
     parent = _entity;
     SetRenderTarget(parent->GetRenderTarget());
     SetResourceManager(parent->GetResourceManager());
     SetInputManager(parent->GetInputManager());
     rootWindow = parent->GetRootWindow();
     
     // Call BeenAdded functions on all the components
     for (auto it = components.begin(); it != components.end(); ++it) {
         (*it)->OnBeenAdded(this);
     }
 }
Exemplo n.º 2
0
 void Entity::OnRemove(Entity* _entity) {
     parent = NULL;
     SetRenderTarget(NULL);
     SetResourceManager(NULL);
     SetInputManager(NULL);
     rootWindow = NULL;
     
     // Call BeenRemoved functions on all the components
     for (auto it = components.begin(); it != components.end(); ++it) {
         (*it)->OnBeenRemoved(this);
     }
 }
Exemplo n.º 3
0
 /* ---------------------------- Init ------------------------------------ */
 void Entity::Init() {
     // Set default values
     SetResourceManager(NULL);
     SetRenderTarget(NULL);
     SetInputManager(NULL);
     rootWindow = NULL;
     
     // Set default positions
     SetPosition(sf::Vector2f());
     SetCenter(sf::Vector2f());
     SetRotation(0.0f);
     SetScale(sf::Vector2f(1.0f, 1.0f));
 }
Exemplo n.º 4
0
void InitSDLResourceManager()
{
	ResourceManagerIface * man= new SDLResourceManager();
	SetResourceManager(man);
}