Skyscraper 2.0
SBS::Shaft Class Reference

#include <shaft.h>

Inheritance diagram for SBS::Shaft:
Collaboration diagram for SBS::Shaft:

Classes

class  Level
 

Public Member Functions

 Shaft (Object *parent, int number, Real CenterX, Real CenterZ, int startfloor, int endfloor)
 
 ~Shaft ()
 
void EnableWhole (bool value, bool EnableShaftDoors, bool force=false)
 
bool IsInside (const Vector3 &position)
 
void CutFloors (bool relative, const Vector2 &start, const Vector2 &end, Real startvoffset, Real endvoffset)
 
void EnableRange (int floor, int range, bool value, bool EnableShaftDoors)
 
void AddShowFloor (int floor)
 
void RemoveShowFloor (int floor)
 
bool IsShowFloor (int floor)
 
void AddShowOutside (int floor)
 
void RemoveShowOutside (int floor)
 
bool IsShowOutside (int floor)
 
void AddShowInterfloor (int floor)
 
void RemoveShowInterfloor (int floor)
 
bool IsShowInterfloor (int floor)
 
bool IsValidFloor (int floor)
 
void AddElevator (int number)
 
void RemoveElevator (int number)
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
void ReplaceTexture (const std::string &oldtexture, const std::string &newtexture)
 
void OnInit ()
 
void Check (Vector3 position, int current_floor)
 
void Loop ()
 
DynamicMeshGetShaftDoorContainer ()
 
void SetShowFull (bool value)
 
bool GetShowFull ()
 
LevelGetLevel (int floor)
 
DynamicMeshGetDynamicMesh ()
 
DynamicMeshGetDoorWrapper ()
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
virtual void Enabled (bool value)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 

Public Attributes

int ShaftNumber
 
int startfloor
 
int endfloor
 
std::vector< int > elevators
 
bool InsideShaft
 
Real bottom
 
Real top
 
Vector2 cutstart
 
Vector2 cutend
 
bool IsEnabled
 
int ShowFloors
 
bool ShowOutside
 
bool ShowInterfloors
 
bool EnableCheck
 
- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 

Private Attributes

std::vector< Level * > Levels
 
std::vector< int > ShowFloorsList
 
std::vector< int > ShowOutsideList
 
std::vector< int > ShowInterfloorsList
 
bool ShowFullShaft
 
DynamicMeshDoorWrapper
 
DynamicMeshShaftDoorContainer
 
Vector3 lastposition
 
bool lastcheckresult
 
bool checkfirstrun
 
bool InElevator
 
bool ShowFloorsFull_Enabled
 
DynamicMeshdynamic_mesh
 

Additional Inherited Members

- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file shaft.h.

Constructor & Destructor Documentation

◆ Shaft()

◆ ~Shaft()

SBS::Shaft::~Shaft ( )

Definition at line 105 of file shaft.cpp.

References DoorWrapper, dynamic_mesh, SBS::SBS::FastDelete, Levels, SBS::Object::parent_deleting, SBS::SBS::RemoveShaft(), SBS::ObjectBase::sbs, and ShaftDoorContainer.

Here is the call graph for this function:

Member Function Documentation

◆ AddElevator()

void SBS::Shaft::AddElevator ( int number)

Definition at line 446 of file shaft.cpp.

References elevators.

Referenced by SBS::Elevator::CreateElevator().

◆ AddShowFloor()

void SBS::Shaft::AddShowFloor ( int floor)

Definition at line 322 of file shaft.cpp.

References IsShowFloor(), and ShowFloorsList.

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

Here is the call graph for this function:

◆ AddShowInterfloor()

void SBS::Shaft::AddShowInterfloor ( int floor)

Definition at line 396 of file shaft.cpp.

References IsShowInterfloor(), and ShowInterfloorsList.

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

Here is the call graph for this function:

◆ AddShowOutside()

void SBS::Shaft::AddShowOutside ( int floor)

Definition at line 359 of file shaft.cpp.

References IsShowOutside(), and ShowOutsideList.

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

Here is the call graph for this function:

◆ Check()

◆ CutFloors()

void SBS::Shaft::CutFloors ( bool relative,
const Vector2 & start,
const Vector2 & end,
Real startvoffset,
Real endvoffset )

◆ EnableRange()

void SBS::Shaft::EnableRange ( int floor,
int range,
bool value,
bool EnableShaftDoors )

◆ EnableWhole()

void SBS::Shaft::EnableWhole ( bool value,
bool EnableShaftDoors,
bool force = false )

◆ GetDoorWrapper()

DynamicMesh * SBS::Shaft::GetDoorWrapper ( )

Definition at line 659 of file shaft.cpp.

References DoorWrapper.

◆ GetDynamicMesh()

DynamicMesh * SBS::Shaft::GetDynamicMesh ( )

Definition at line 654 of file shaft.cpp.

References dynamic_mesh.

Referenced by SBS::Shaft::Level::Level().

◆ GetLevel()

◆ GetShaftDoorContainer()

DynamicMesh * SBS::Shaft::GetShaftDoorContainer ( )
inline

Definition at line 73 of file shaft.h.

Referenced by SBS::ElevatorDoor::AddDoorComponent().

◆ GetShowFull()

bool SBS::Shaft::GetShowFull ( )
inline

◆ IsInside()

bool SBS::Shaft::IsInside ( const Vector3 & position)

Definition at line 175 of file shaft.cpp.

References bottom, checkfirstrun, lastcheckresult, lastposition, Levels, and top.

Referenced by Check().

◆ IsShowFloor()

bool SBS::Shaft::IsShowFloor ( int floor)

Definition at line 347 of file shaft.cpp.

References ShowFloorsList.

Referenced by AddShowFloor(), SBS::SBS::EnableFloorRange(), and SBS::ElevatorDoor::MoveDoors().

◆ IsShowInterfloor()

bool SBS::Shaft::IsShowInterfloor ( int floor)

Definition at line 421 of file shaft.cpp.

References ShowInterfloorsList.

Referenced by AddShowInterfloor().

◆ IsShowOutside()

bool SBS::Shaft::IsShowOutside ( int floor)

Definition at line 384 of file shaft.cpp.

References ShowOutsideList.

Referenced by AddShowOutside(), and Check().

◆ IsValidFloor()

bool SBS::Shaft::IsValidFloor ( int floor)

Definition at line 433 of file shaft.cpp.

References endfloor, and GetLevel().

Referenced by SBS::ElevatorCar::CheckServicedFloors(), SBS::SBS::DeleteObject(), and SBS::Floor::GetShaftList().

Here is the call graph for this function:

◆ Loop()

void SBS::Shaft::Loop ( )
virtual

Reimplemented from SBS::Object.

Definition at line 647 of file shaft.cpp.

References SBS::Object::LoopChildren().

Here is the call graph for this function:

◆ OnInit()

void SBS::Shaft::OnInit ( )
virtual

Reimplemented from SBS::Object.

Definition at line 491 of file shaft.cpp.

References EnableWhole(), and ShowFullShaft.

Here is the call graph for this function:

◆ RemoveElevator()

void SBS::Shaft::RemoveElevator ( int number)

Definition at line 460 of file shaft.cpp.

References elevators.

◆ RemoveShowFloor()

void SBS::Shaft::RemoveShowFloor ( int floor)

Definition at line 333 of file shaft.cpp.

References ShowFloorsList.

◆ RemoveShowInterfloor()

void SBS::Shaft::RemoveShowInterfloor ( int floor)

Definition at line 407 of file shaft.cpp.

References ShowInterfloorsList.

◆ RemoveShowOutside()

void SBS::Shaft::RemoveShowOutside ( int floor)

Definition at line 370 of file shaft.cpp.

References ShowOutsideList.

◆ ReplaceTexture()

void SBS::Shaft::ReplaceTexture ( const std::string & oldtexture,
const std::string & newtexture )

Definition at line 485 of file shaft.cpp.

References Levels, and ReplaceTexture().

Referenced by ReplaceTexture(), and SBS::Action::Run().

Here is the call graph for this function:

◆ Report()

void SBS::Shaft::Report ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 473 of file shaft.cpp.

References SBS::ObjectBase::Report(), ShaftNumber, and SBS::ToString().

Referenced by CutFloors(), and Shaft().

Here is the call graph for this function:

◆ ReportError()

bool SBS::Shaft::ReportError ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 479 of file shaft.cpp.

References SBS::ObjectBase::ReportError(), ShaftNumber, and SBS::ToString().

Here is the call graph for this function:

◆ SetShowFull()

void SBS::Shaft::SetShowFull ( bool value)

Member Data Documentation

◆ bottom

Real SBS::Shaft::bottom

Definition at line 39 of file shaft.h.

Referenced by SBS::Shaft::Level::AddFloor(), IsInside(), and Shaft().

◆ checkfirstrun

bool SBS::Shaft::checkfirstrun
private

Definition at line 172 of file shaft.h.

Referenced by IsInside(), and Shaft().

◆ cutend

Vector2 SBS::Shaft::cutend

Definition at line 42 of file shaft.h.

Referenced by CutFloors(), and Shaft().

◆ cutstart

Vector2 SBS::Shaft::cutstart

Definition at line 41 of file shaft.h.

Referenced by CutFloors(), and Shaft().

◆ DoorWrapper

DynamicMesh* SBS::Shaft::DoorWrapper
private

Definition at line 164 of file shaft.h.

Referenced by GetDoorWrapper(), and ~Shaft().

◆ dynamic_mesh

DynamicMesh* SBS::Shaft::dynamic_mesh
private

Definition at line 177 of file shaft.h.

Referenced by EnableWhole(), GetDynamicMesh(), SetShowFull(), Shaft(), and ~Shaft().

◆ elevators

std::vector<int> SBS::Shaft::elevators

Definition at line 37 of file shaft.h.

Referenced by AddElevator(), and RemoveElevator().

◆ EnableCheck

bool SBS::Shaft::EnableCheck

Definition at line 47 of file shaft.h.

Referenced by EnableWhole(), and Shaft().

◆ endfloor

int SBS::Shaft::endfloor

◆ InElevator

bool SBS::Shaft::InElevator
private

Definition at line 173 of file shaft.h.

Referenced by Check(), and Shaft().

◆ InsideShaft

bool SBS::Shaft::InsideShaft

Definition at line 38 of file shaft.h.

Referenced by Check(), and Shaft().

◆ IsEnabled

bool SBS::Shaft::IsEnabled

◆ lastcheckresult

bool SBS::Shaft::lastcheckresult
private

Definition at line 171 of file shaft.h.

Referenced by IsInside(), and Shaft().

◆ lastposition

Vector3 SBS::Shaft::lastposition
private

Definition at line 170 of file shaft.h.

Referenced by IsInside(), and Shaft().

◆ Levels

std::vector<Level*> SBS::Shaft::Levels
private

Definition at line 157 of file shaft.h.

Referenced by GetLevel(), IsInside(), ReplaceTexture(), Shaft(), and ~Shaft().

◆ ShaftDoorContainer

DynamicMesh* SBS::Shaft::ShaftDoorContainer
private

Definition at line 167 of file shaft.h.

Referenced by EnableWhole(), SetShowFull(), Shaft(), and ~Shaft().

◆ ShaftNumber

int SBS::Shaft::ShaftNumber

◆ ShowFloors

◆ ShowFloorsFull_Enabled

bool SBS::Shaft::ShowFloorsFull_Enabled
private

Definition at line 174 of file shaft.h.

Referenced by Check(), and Shaft().

◆ ShowFloorsList

std::vector<int> SBS::Shaft::ShowFloorsList
private

Definition at line 158 of file shaft.h.

Referenced by AddShowFloor(), Check(), IsShowFloor(), and RemoveShowFloor().

◆ ShowFullShaft

bool SBS::Shaft::ShowFullShaft
private

Definition at line 161 of file shaft.h.

Referenced by Check(), EnableRange(), EnableWhole(), OnInit(), SetShowFull(), and Shaft().

◆ ShowInterfloors

bool SBS::Shaft::ShowInterfloors

Definition at line 46 of file shaft.h.

Referenced by Check(), Skyscraper::ScriptProcessor::CommandsSection::Run(), and Shaft().

◆ ShowInterfloorsList

std::vector<int> SBS::Shaft::ShowInterfloorsList
private

Definition at line 160 of file shaft.h.

Referenced by AddShowInterfloor(), Check(), IsShowInterfloor(), and RemoveShowInterfloor().

◆ ShowOutside

bool SBS::Shaft::ShowOutside

Definition at line 45 of file shaft.h.

Referenced by Check(), Skyscraper::ScriptProcessor::CommandsSection::Run(), and Shaft().

◆ ShowOutsideList

std::vector<int> SBS::Shaft::ShowOutsideList
private

Definition at line 159 of file shaft.h.

Referenced by AddShowOutside(), IsShowOutside(), and RemoveShowOutside().

◆ startfloor

int SBS::Shaft::startfloor

Definition at line 35 of file shaft.h.

Referenced by CutFloors(), EnableRange(), EnableWhole(), and Shaft().

◆ top

Real SBS::Shaft::top

Definition at line 40 of file shaft.h.

Referenced by IsInside(), and Shaft().


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