Skyscraper 2.0
Skyscraper::EngineContext Class Reference

#include <enginecontext.h>

Collaboration diagram for Skyscraper::EngineContext:

Public Member Functions

 EngineContext (EngineContext *parent, VM *vm, Ogre::SceneManager *mSceneManager, FMOD::System *fmodsystem, const Vector3 &position=Vector3::ZERO, Real rotation=0.0, const Vector3 &area_min=Vector3::ZERO, const Vector3 &area_max=Vector3::ZERO)
 
 EngineContext (EngineContext *parent, VM *vm, Ogre::SceneManager *mSceneManager, const Vector3 &position=Vector3::ZERO, Real rotation=0.0, const Vector3 &area_min=Vector3::ZERO, const Vector3 &area_max=Vector3::ZERO)
 
 ~EngineContext ()
 
void Init (EngineContext *parent, VM *vm, Ogre::SceneManager *mSceneManager, const Vector3 &position, Real rotation, const Vector3 &area_min, const Vector3 &area_max)
 
ScriptProcessorGetScriptProcessor ()
 
::SBS::SBSGetSystem ()
 
bool IsCameraActive ()
 
bool Run ()
 
void Shutdown ()
 
bool GetShutdownState ()
 
bool Load (std::string filename)
 
bool IsLoading ()
 
bool IsRunning ()
 
bool IsReloading ()
 
void DoReload ()
 
std::string GetFilename ()
 
bool Start (std::vector< Ogre::Camera * > &cameras)
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
bool ReportFatalError (const std::string &message)
 
bool IsLoadingFinished ()
 
bool UpdateProgress (int percent)
 
int GetProgress ()
 
int GetNumber ()
 
::SBS::CameraState GetCameraState ()
 
void SetCameraState (const ::SBS::CameraState &state, bool set_floor=true)
 
bool IsInside ()
 
bool IsInside (const Vector3 &position)
 
void DetachCamera (bool reset_building=false)
 
void AttachCamera (std::vector< Ogre::Camera * > &cameras, bool init_state=true)
 
void RefreshCamera ()
 
void ResetCamera ()
 
void RevertMovement ()
 
Vector3 GetCameraPosition ()
 
void OnEnter ()
 
void OnExit ()
 
void CutForEngine (EngineContext *engine)
 
void AddChild (EngineContext *engine)
 
void RemoveChild (EngineContext *engine)
 
void RemoveParent ()
 
void Move (Vector3 &position, bool move_children=false)
 
EngineContextGetParent ()
 
bool IsParent (EngineContext *engine, bool recursive=false)
 
VMGetVM ()
 
bool InRunloop ()
 
bool IsRoot ()
 
bool InitSim ()
 
bool LoadDefault ()
 
void Boot ()
 
void GatherReset ()
 
void Gather ()
 
void ResetPrepare ()
 

Public Attributes

bool Reload
 
bool Moved
 
bool started
 
bool NewEngine
 
unsigned long current_time
 
unsigned long time_stat
 

Private Member Functions

void StartSim ()
 
void UnloadSim ()
 
void Init ()
 

Private Attributes

ScriptProcessorprocessor
 
::SBS::SBSSimcore
 
int instance
 
EngineContextparent
 
unsigned long finish_time
 
bool shutdown
 
bool loading
 
bool running
 
bool reloading
 
bool raised
 
int progress
 
bool inside
 
std::string InstancePrompt
 
bool prepared
 
::SBS::CameraStatereload_state
 
Ogre::SceneManager * mSceneManager
 
FMOD::System * fmodsystem
 
Vector3 position
 
Vector3 area_min
 
Vector3 area_max
 
Real rotation
 
std::vector< EngineContext * > children
 
VMvm
 

Detailed Description

Definition at line 32 of file enginecontext.h.

Constructor & Destructor Documentation

◆ EngineContext() [1/2]

Skyscraper::EngineContext::EngineContext ( EngineContext * parent,
VM * vm,
Ogre::SceneManager * mSceneManager,
FMOD::System * fmodsystem,
const Vector3 & position = Vector3::ZERO,
Real rotation = 0.0,
const Vector3 & area_min = Vector3::ZERO,
const Vector3 & area_max = Vector3::ZERO )

Definition at line 53 of file enginecontext.cpp.

References area_max, area_min, fmodsystem, Init(), mSceneManager, parent, position, rotation, and vm.

Here is the call graph for this function:

◆ EngineContext() [2/2]

Skyscraper::EngineContext::EngineContext ( EngineContext * parent,
VM * vm,
Ogre::SceneManager * mSceneManager,
const Vector3 & position = Vector3::ZERO,
Real rotation = 0.0,
const Vector3 & area_min = Vector3::ZERO,
const Vector3 & area_max = Vector3::ZERO )

Definition at line 59 of file enginecontext.cpp.

References area_max, area_min, Init(), mSceneManager, parent, position, rotation, and vm.

Here is the call graph for this function:

◆ ~EngineContext()

Skyscraper::EngineContext::~EngineContext ( )

Definition at line 64 of file enginecontext.cpp.

References children, Skyscraper::VM::IsValidEngine(), parent, reload_state, RemoveChild(), UnloadSim(), and vm.

Here is the call graph for this function:

Member Function Documentation

◆ AddChild()

void Skyscraper::EngineContext::AddChild ( EngineContext * engine)

Definition at line 697 of file enginecontext.cpp.

References children.

Referenced by Init().

◆ AttachCamera()

void Skyscraper::EngineContext::AttachCamera ( std::vector< Ogre::Camera * > & cameras,
bool init_state = true )

Definition at line 586 of file enginecontext.cpp.

References SBS::SBS::AttachCamera(), IsInside(), ResetCamera(), and Simcore.

Referenced by Skyscraper::VM::SetActiveEngine().

Here is the call graph for this function:

◆ Boot()

void Skyscraper::EngineContext::Boot ( )

Definition at line 258 of file enginecontext.cpp.

References processor, and Skyscraper::ScriptProcessor::Start().

Referenced by Skyscraper::VMConsole::Process().

Here is the call graph for this function:

◆ CutForEngine()

◆ DetachCamera()

void Skyscraper::EngineContext::DetachCamera ( bool reset_building = false)

Definition at line 576 of file enginecontext.cpp.

References SBS::SBS::DetachCamera(), SBS::SBS::ResetState(), and Simcore.

Referenced by Skyscraper::VM::SetActiveEngine().

Here is the call graph for this function:

◆ DoReload()

void Skyscraper::EngineContext::DoReload ( )

Definition at line 330 of file enginecontext.cpp.

References SBS::SBS::BuildingFilename, GetCameraState(), Load(), Reload, reload_state, reloading, Simcore, StartSim(), and UnloadSim().

Here is the call graph for this function:

◆ Gather()

void Skyscraper::EngineContext::Gather ( )

Definition at line 781 of file enginecontext.cpp.

References current_time, Skyscraper::HAL::GetCurrentTime(), Skyscraper::VM::GetHAL(), time_stat, and vm.

Here is the call graph for this function:

◆ GatherReset()

void Skyscraper::EngineContext::GatherReset ( )

Definition at line 774 of file enginecontext.cpp.

References current_time, Skyscraper::HAL::GetCurrentTime(), Skyscraper::VM::GetHAL(), and vm.

Here is the call graph for this function:

◆ GetCameraPosition()

Vector3 Skyscraper::EngineContext::GetCameraPosition ( )

Definition at line 614 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::GetPosition(), Simcore, and SBS::SBS::ToGlobal().

Referenced by IsInside().

Here is the call graph for this function:

◆ GetCameraState()

CameraState Skyscraper::EngineContext::GetCameraState ( )

Definition at line 538 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::GetCameraState(), and Simcore.

Referenced by DoReload(), and Skyscraper::VM::SetActiveEngine().

Here is the call graph for this function:

◆ GetFilename()

std::string Skyscraper::EngineContext::GetFilename ( )

◆ GetNumber()

int Skyscraper::EngineContext::GetNumber ( )
inline

◆ GetParent()

EngineContext * Skyscraper::EngineContext::GetParent ( )
inline

Definition at line 83 of file enginecontext.h.

Referenced by IsParent(), IsRoot(), and Skyscraper::VM::SwitchEngines().

◆ GetProgress()

int Skyscraper::EngineContext::GetProgress ( )
inline

Definition at line 64 of file enginecontext.h.

Referenced by Skyscraper::VM::UpdateProgress().

◆ GetScriptProcessor()

◆ GetShutdownState()

bool Skyscraper::EngineContext::GetShutdownState ( )
inline

Definition at line 51 of file enginecontext.h.

References Skyscraper::shutdown.

Referenced by Skyscraper::EngineManager::Loop().

◆ GetSystem()

◆ GetVM()

◆ Init() [1/2]

void Skyscraper::EngineContext::Init ( )
private

Referenced by EngineContext(), and EngineContext().

◆ Init() [2/2]

void Skyscraper::EngineContext::Init ( EngineContext * parent,
VM * vm,
Ogre::SceneManager * mSceneManager,
const Vector3 & position,
Real rotation,
const Vector3 & area_min,
const Vector3 & area_max )

◆ InitSim()

bool Skyscraper::EngineContext::InitSim ( )

Definition at line 243 of file enginecontext.cpp.

References SBS::SBS::Initialize(), processor, Skyscraper::ScriptProcessor::Reset(), and Simcore.

Referenced by Load(), and LoadDefault().

Here is the call graph for this function:

◆ InRunloop()

bool Skyscraper::EngineContext::InRunloop ( )

Definition at line 758 of file enginecontext.cpp.

References Skyscraper::ScriptProcessor::InRunloop(), and processor.

Referenced by Run().

Here is the call graph for this function:

◆ IsCameraActive()

bool Skyscraper::EngineContext::IsCameraActive ( )

Definition at line 136 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::IsActive(), and Simcore.

Referenced by Skyscraper::VM::CheckCamera(), Skyscraper::EngineManager::Loop(), and Skyscraper::VM::SetActiveEngine().

Here is the call graph for this function:

◆ IsInside() [1/2]

bool Skyscraper::EngineContext::IsInside ( )

Definition at line 552 of file enginecontext.cpp.

References Skyscraper::VM::GetActiveEngine(), GetCameraPosition(), SBS::SBS::IsInside(), IsInside(), Simcore, and vm.

Referenced by AttachCamera(), IsInside(), Run(), and Skyscraper::VM::SwitchEngines().

Here is the call graph for this function:

◆ IsInside() [2/2]

bool Skyscraper::EngineContext::IsInside ( const Vector3 & position)

Definition at line 566 of file enginecontext.cpp.

References SBS::SBS::FromGlobal(), SBS::SBS::IsInside(), position, and Simcore.

Here is the call graph for this function:

◆ IsLoading()

bool Skyscraper::EngineContext::IsLoading ( )
inline

◆ IsLoadingFinished()

bool Skyscraper::EngineContext::IsLoadingFinished ( )

◆ IsParent()

bool Skyscraper::EngineContext::IsParent ( EngineContext * engine,
bool recursive = false )

Definition at line 732 of file enginecontext.cpp.

References GetParent(), and IsParent().

Referenced by IsParent(), and OnEnter().

Here is the call graph for this function:

◆ IsReloading()

bool Skyscraper::EngineContext::IsReloading ( )
inline

Definition at line 55 of file enginecontext.h.

Referenced by Skyscraper::ScriptProcessor::ProcessSections().

◆ IsRoot()

bool Skyscraper::EngineContext::IsRoot ( )

Definition at line 767 of file enginecontext.cpp.

References GetParent().

Referenced by Skyscraper::ScriptProcessor::BuildingsSection::Run(), and Skyscraper::ScriptProcessor::GlobalsSection::Run().

Here is the call graph for this function:

◆ IsRunning()

◆ Load()

bool Skyscraper::EngineContext::Load ( std::string filename)

◆ LoadDefault()

bool Skyscraper::EngineContext::LoadDefault ( )

◆ Move()

void Skyscraper::EngineContext::Move ( Vector3 & position,
bool move_children = false )

Definition at line 715 of file enginecontext.cpp.

References children, SBS::Object::Move(), position, and Simcore.

Referenced by Skyscraper::ScriptProcessor::GlobalsSection::Run().

Here is the call graph for this function:

◆ OnEnter()

void Skyscraper::EngineContext::OnEnter ( )

Definition at line 621 of file enginecontext.cpp.

References Skyscraper::VM::GetActiveEngine(), inside, instance, IsParent(), Skyscraper::VM::SetActiveEngine(), and vm.

Referenced by Run().

Here is the call graph for this function:

◆ OnExit()

void Skyscraper::EngineContext::OnExit ( )

Definition at line 640 of file enginecontext.cpp.

References inside.

Referenced by Run().

◆ RefreshCamera()

void Skyscraper::EngineContext::RefreshCamera ( )

Definition at line 597 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::Refresh(), and Simcore.

Referenced by Skyscraper::VM::DeleteEngine().

Here is the call graph for this function:

◆ RemoveChild()

void Skyscraper::EngineContext::RemoveChild ( EngineContext * engine)

Definition at line 703 of file enginecontext.cpp.

References children.

Referenced by ~EngineContext().

◆ RemoveParent()

void Skyscraper::EngineContext::RemoveParent ( )
inline

Definition at line 81 of file enginecontext.h.

◆ Report()

◆ ReportError()

bool Skyscraper::EngineContext::ReportError ( const std::string & message)

Definition at line 505 of file enginecontext.cpp.

References Skyscraper::VM::GetHAL(), InstancePrompt, Skyscraper::HAL::ReportError(), and vm.

Referenced by ReportFatalError(), Run(), Skyscraper::ScriptProcessor::ScriptError(), and Start().

Here is the call graph for this function:

◆ ReportFatalError()

bool Skyscraper::EngineContext::ReportFatalError ( const std::string & message)

Definition at line 510 of file enginecontext.cpp.

References Skyscraper::VM::GetGUI(), ReportError(), Skyscraper::GUI::ShowError(), and vm.

Referenced by Skyscraper::ScriptProcessor::LoadDataFile().

Here is the call graph for this function:

◆ ResetCamera()

void Skyscraper::EngineContext::ResetCamera ( )

Definition at line 602 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::SetToStartPosition(), and Simcore.

Referenced by AttachCamera().

Here is the call graph for this function:

◆ ResetPrepare()

void Skyscraper::EngineContext::ResetPrepare ( )

Definition at line 796 of file enginecontext.cpp.

References prepared.

Referenced by Skyscraper::ScriptProcessor::Run().

◆ RevertMovement()

void Skyscraper::EngineContext::RevertMovement ( )

Definition at line 608 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::RevertMovement(), and Simcore.

Referenced by Skyscraper::VM::SwitchEngines().

Here is the call graph for this function:

◆ Run()

◆ SetCameraState()

void Skyscraper::EngineContext::SetCameraState ( const ::SBS::CameraState & state,
bool set_floor = true )

Definition at line 545 of file enginecontext.cpp.

References SBS::SBS::camera, SBS::Camera::SetCameraState(), and Simcore.

Referenced by Skyscraper::VM::SetActiveEngine(), and Start().

Here is the call graph for this function:

◆ Shutdown()

void Skyscraper::EngineContext::Shutdown ( )

◆ Start()

◆ StartSim()

◆ UnloadSim()

void Skyscraper::EngineContext::UnloadSim ( )
private

Definition at line 421 of file enginecontext.cpp.

References fmodsystem, instance, loading, Moved, processor, raised, Report(), running, Simcore, started, and SBS::ToString().

Referenced by DoReload(), and ~EngineContext().

Here is the call graph for this function:

◆ UpdateProgress()

bool Skyscraper::EngineContext::UpdateProgress ( int percent)

Definition at line 529 of file enginecontext.cpp.

References progress, Skyscraper::VM::UpdateProgress(), and vm.

Referenced by Skyscraper::ScriptProcessor::ProcessFunctionParameters().

Here is the call graph for this function:

Member Data Documentation

◆ area_max

Vector3 Skyscraper::EngineContext::area_max
private

Definition at line 123 of file enginecontext.h.

Referenced by EngineContext(), EngineContext(), Init(), and StartSim().

◆ area_min

Vector3 Skyscraper::EngineContext::area_min
private

Definition at line 122 of file enginecontext.h.

Referenced by EngineContext(), EngineContext(), Init(), and StartSim().

◆ children

std::vector<EngineContext*> Skyscraper::EngineContext::children
private

Definition at line 127 of file enginecontext.h.

Referenced by AddChild(), Move(), RemoveChild(), Start(), and ~EngineContext().

◆ current_time

unsigned long Skyscraper::EngineContext::current_time

Definition at line 40 of file enginecontext.h.

Referenced by Gather(), and GatherReset().

◆ finish_time

unsigned long Skyscraper::EngineContext::finish_time
private

Definition at line 105 of file enginecontext.h.

Referenced by Init(), and Run().

◆ fmodsystem

FMOD::System* Skyscraper::EngineContext::fmodsystem
private

Definition at line 120 of file enginecontext.h.

Referenced by EngineContext(), StartSim(), and UnloadSim().

◆ inside

bool Skyscraper::EngineContext::inside
private

Definition at line 112 of file enginecontext.h.

Referenced by Init(), OnEnter(), OnExit(), and Run().

◆ instance

int Skyscraper::EngineContext::instance
private

Definition at line 103 of file enginecontext.h.

Referenced by Init(), OnEnter(), StartSim(), and UnloadSim().

◆ InstancePrompt

std::string Skyscraper::EngineContext::InstancePrompt
private

Definition at line 113 of file enginecontext.h.

Referenced by Init(), Report(), and ReportError().

◆ loading

bool Skyscraper::EngineContext::loading
private

Definition at line 107 of file enginecontext.h.

Referenced by Init(), IsLoadingFinished(), Load(), LoadDefault(), Run(), Start(), and UnloadSim().

◆ Moved

bool Skyscraper::EngineContext::Moved

◆ mSceneManager

Ogre::SceneManager* Skyscraper::EngineContext::mSceneManager
private

Definition at line 119 of file enginecontext.h.

Referenced by EngineContext(), EngineContext(), Init(), and StartSim().

◆ NewEngine

bool Skyscraper::EngineContext::NewEngine

Definition at line 39 of file enginecontext.h.

Referenced by Init().

◆ parent

EngineContext* Skyscraper::EngineContext::parent
private

◆ position

Vector3 Skyscraper::EngineContext::position
private

Definition at line 121 of file enginecontext.h.

Referenced by EngineContext(), EngineContext(), Init(), IsInside(), Move(), and StartSim().

◆ prepared

bool Skyscraper::EngineContext::prepared
private

Definition at line 114 of file enginecontext.h.

Referenced by Init(), ResetPrepare(), and Run().

◆ processor

ScriptProcessor* Skyscraper::EngineContext::processor
private

◆ progress

int Skyscraper::EngineContext::progress
private

Definition at line 111 of file enginecontext.h.

Referenced by Init(), and UpdateProgress().

◆ raised

bool Skyscraper::EngineContext::raised
private

Definition at line 110 of file enginecontext.h.

Referenced by Init(), Run(), and UnloadSim().

◆ Reload

bool Skyscraper::EngineContext::Reload

◆ reload_state

::SBS::CameraState* Skyscraper::EngineContext::reload_state
private

Definition at line 117 of file enginecontext.h.

Referenced by DoReload(), Init(), Start(), and ~EngineContext().

◆ reloading

bool Skyscraper::EngineContext::reloading
private

Definition at line 109 of file enginecontext.h.

Referenced by DoReload(), Init(), and Start().

◆ rotation

Real Skyscraper::EngineContext::rotation
private

Definition at line 124 of file enginecontext.h.

Referenced by EngineContext(), EngineContext(), Init(), and StartSim().

◆ running

bool Skyscraper::EngineContext::running
private

Definition at line 108 of file enginecontext.h.

Referenced by Init(), Run(), Start(), and UnloadSim().

◆ shutdown

bool Skyscraper::EngineContext::shutdown
private

Definition at line 106 of file enginecontext.h.

Referenced by Init(), and Shutdown().

◆ Simcore

◆ started

bool Skyscraper::EngineContext::started

Definition at line 38 of file enginecontext.h.

Referenced by Init(), StartSim(), and UnloadSim().

◆ time_stat

unsigned long Skyscraper::EngineContext::time_stat

Definition at line 40 of file enginecontext.h.

Referenced by Gather(), and Skyscraper::VM::RegisterEngine().

◆ vm


The documentation for this class was generated from the following files: