kick
/Users/morten/Programmering/cpp/kick/src/kick/scene/component.cpp
00001 //
00002 //  component.cpp
00003 //  KickCPP
00004 //
00005 //  Created by morten on 8/12/13.
00006 //  Copyright (c) 2013 Morten Nobel-Joergensen. All rights reserved.
00007 //
00008 
00009 #include "kick/scene/engine_uniforms.h"
00010 #include "kick/scene/component.h"
00011 #include "kick/scene/game_object.h"
00012 
00013 using namespace std;
00014 
00015 namespace kick {
00016     
00017     Component::Component(GameObject* gameObject)
00018     : mGameObject(gameObject)
00019     {}
00020     
00021     Component::Component(Component&& component)
00022     : mGameObject(move(component.mGameObject))
00023     {
00024     }
00025 
00026     Component::~Component() {
00027 
00028     }
00029 
00030     Component& Component::operator=(const Component& other){
00031         if (this != &other){
00032             mGameObject = move(other.mGameObject);
00033         }
00034         return *this;
00035     }
00036     
00037     std::shared_ptr<Transform> Component::transform(){
00038         return mGameObject->transform();
00039     }
00040 
00041     GameObject *Component::gameObject() {
00042         return mGameObject;
00043     }
00044 
00045     bool Component::enabled() const {
00046         return mEnabled;
00047     }
00048 
00049     void Component::setEnabled(bool enabled) {
00050         if (Component::mEnabled != enabled){
00051             Component::mEnabled = enabled;
00052 
00053         }
00054     }
00055 }
 All Classes Functions Variables