71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "SGameScene.h"
|
|
|
|
namespace rp {
|
|
|
|
class SGameSceneGroup : public SGameScene
|
|
{
|
|
public:
|
|
|
|
/// 생성자
|
|
SGameSceneGroup(
|
|
SGameSceneManager& sceneMgr
|
|
, SGameScene* parent = 0
|
|
, const char* sceneName = "" );
|
|
|
|
/// 소멸자
|
|
virtual ~SGameSceneGroup();
|
|
|
|
/// 씬 등록 콜백
|
|
virtual void onEnter();
|
|
|
|
/// 씬 해제 콜백
|
|
virtual void onLeave();
|
|
|
|
/// 씬 활성화 콜백
|
|
virtual void onActivate();
|
|
|
|
/// 씬 비활성화 콜백
|
|
virtual void onDeactivate();
|
|
|
|
/// 씬 틱 콜백
|
|
virtual void onTick();
|
|
|
|
/// 씬 렌더 콜백
|
|
virtual void onRender( KViewportObject* viewport );
|
|
|
|
/// 자식 씬 추가
|
|
void addChild( SGameScene* scene );
|
|
|
|
/// 자식 씬 제거
|
|
void removeChild( SGameScene* scene );
|
|
|
|
/// 자식 씬 이름으로 얻기
|
|
SGameScene* getChildByName( const char* sceneName );
|
|
|
|
/// 자식 씬 인덱스로 얻기
|
|
SGameScene* getChildByIndex( unsigned int index );
|
|
|
|
/// 자식 씬 개수 얻기
|
|
unsigned int getSize() const;
|
|
|
|
/// 자식 씬 존재 여부 묻기
|
|
bool isEmpty() const;
|
|
|
|
private:
|
|
|
|
/// 씬 Finder
|
|
struct SceneFinder {
|
|
SceneFinder( const char* name ) : mName( name ) {}
|
|
bool operator () ( const SGameScene* scene ) const { return mName == scene->getName(); }
|
|
std::string mName;
|
|
};
|
|
|
|
typedef std::vector< SGameSceneIPtr > children_t; ///< 자식 씬 컨테이너 타입
|
|
|
|
children_t mChildren; ///< 자식 씬 컨테이너
|
|
|
|
};
|
|
|
|
} |