Skyscraper 2.0
SBS::Door Class Reference

#include <door.h>

Inheritance diagram for SBS::Door:
Collaboration diagram for SBS::Door:

Classes

class  Timer
 

Public Member Functions

 Door (Object *parent, DynamicMesh *wrapper, const std::string &name, const std::string &open_sound, const std::string &close_sound, bool rotate)
 
 ~Door ()
 
bool Open (Vector3 &position, bool playsound=true, bool force=false)
 
void Close (bool playsound=true)
 
bool IsOpen ()
 
void Enabled (bool value)
 
bool IsEnabled ()
 
void Loop ()
 
void ClickDoor (Vector3 &position)
 
void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
bool GetDoorChanged ()
 
bool GetPreviousOpen ()
 
DoorWrapperCreateDoor (bool open_state, const std::string &texture, const std::string &side_texture, Real thickness, const std::string &face_direction, const std::string &open_direction, Real open_speed, Real close_speed, Real CenterX, Real CenterZ, Real width, Real height, Real voffset, Real tw, Real th, Real side_tw, Real side_th)
 
DoorWrapperAddDoorComponent (const std::string &name, const std::string &texture, const std::string &sidetexture, Real thickness, const std::string &face_direction, const std::string &open_direction, bool OpenClockwise, Real OpenSpeed, Real CloseSpeed, Real x1, Real z1, Real x2, Real z2, Real height, Real voffset, Real tw, Real th, Real side_tw, Real side_th)
 
DoorWrapperFinishDoor (bool open_state)
 
void AutoClose (int interval)
 
- 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 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)
 
virtual void OnInit ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
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 Member Functions inherited from SBS::DoorLock
 DoorLock (Object *parent)
 
virtual ~DoorLock ()
 
void SetDirection (bool direction)
 
void SetLocked (int side, int keyid)
 
bool GetSide (const Vector3 &position)
 
bool IsLocked (const Vector3 &position)
 
bool ToggleLock (const Vector3 &position, bool force=false)
 
int GetKeyID ()
 

Public Attributes

bool DoorDirection
 
bool OpenState
 
bool IsMoving
 
bool OpenDoor
 
std::string OpenSound
 
std::string CloseSound
 
- 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 Member Functions

void MoveDoor ()
 

Private Attributes

DoorWrapperdoor
 
DynamicMeshwrapper
 
Soundsound
 
bool is_enabled
 
bool door_changed
 
bool previous_open
 
bool running
 
Timertimer
 
int timer_interval
 

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 33 of file door.h.

Constructor & Destructor Documentation

◆ Door()

SBS::Door::Door ( Object * parent,
DynamicMesh * wrapper,
const std::string & name,
const std::string & open_sound,
const std::string & close_sound,
bool rotate )

Definition at line 53 of file door.cpp.

References CloseSound, door, door_changed, DoorDirection, is_enabled, IsMoving, OpenDoor, OpenSound, OpenState, previous_open, running, SBS::Object::SetValues(), sound, timer, timer_interval, and wrapper.

Here is the call graph for this function:

◆ ~Door()

Member Function Documentation

◆ AddDoorComponent()

DoorWrapper * SBS::Door::AddDoorComponent ( const std::string & name,
const std::string & texture,
const std::string & sidetexture,
Real thickness,
const std::string & face_direction,
const std::string & open_direction,
bool OpenClockwise,
Real OpenSpeed,
Real CloseSpeed,
Real x1,
Real z1,
Real x2,
Real z2,
Real height,
Real voffset,
Real tw,
Real th,
Real side_tw,
Real side_th )

◆ AutoClose()

void SBS::Door::AutoClose ( int interval)

Definition at line 493 of file door.cpp.

References SBS::TimerObject::Start(), SBS::TimerObject::Stop(), timer, and timer_interval.

Referenced by Open(), SBS::Action::Run(), and Skyscraper::ScriptProcessor::CommandsSection::Run().

Here is the call graph for this function:

◆ ClickDoor()

void SBS::Door::ClickDoor ( Vector3 & position)

Definition at line 239 of file door.cpp.

References Close(), IsMoving, IsOpen(), and Open().

Referenced by OnClick().

Here is the call graph for this function:

◆ Close()

void SBS::Door::Close ( bool playsound = true)

◆ CreateDoor()

DoorWrapper * SBS::Door::CreateDoor ( bool open_state,
const std::string & texture,
const std::string & side_texture,
Real thickness,
const std::string & face_direction,
const std::string & open_direction,
Real open_speed,
Real close_speed,
Real CenterX,
Real CenterZ,
Real width,
Real height,
Real voffset,
Real tw,
Real th,
Real side_tw,
Real side_th )

◆ Enabled()

void SBS::Door::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 189 of file door.cpp.

References door, SBS::DoorWrapper::Enabled(), and is_enabled.

Here is the call graph for this function:

◆ FinishDoor()

◆ GetDoorChanged()

bool SBS::Door::GetDoorChanged ( )

Definition at line 284 of file door.cpp.

References door_changed.

Referenced by SBS::DoorComponent::MoveDoors().

◆ GetPreviousOpen()

bool SBS::Door::GetPreviousOpen ( )

Definition at line 289 of file door.cpp.

References previous_open.

Referenced by SBS::DoorComponent::MoveDoors().

◆ IsEnabled()

bool SBS::Door::IsEnabled ( )
inline

Definition at line 50 of file door.h.

◆ IsOpen()

bool SBS::Door::IsOpen ( )

Definition at line 184 of file door.cpp.

References OpenState.

Referenced by ClickDoor().

◆ Loop()

void SBS::Door::Loop ( )
virtual

Reimplemented from SBS::Object.

Definition at line 198 of file door.cpp.

References SBS::Object::EnableLoop(), IsMoving, MoveDoor(), and SBS_PROFILE.

Here is the call graph for this function:

◆ MoveDoor()

void SBS::Door::MoveDoor ( )
private

Definition at line 208 of file door.cpp.

References SBS::DoorWrapper::CheckDoorsOpen(), door, door_changed, SBS::DoorWrapper::IsFinished(), IsMoving, SBS::DoorWrapper::MoveDoors(), OpenDoor, OpenState, previous_open, and running.

Referenced by Loop().

Here is the call graph for this function:

◆ OnClick()

void SBS::Door::OnClick ( Vector3 & position,
bool shift,
bool ctrl,
bool alt,
bool right )
virtual

Reimplemented from SBS::Object.

Definition at line 260 of file door.cpp.

References ClickDoor(), and SBS::DoorLock::ToggleLock().

Referenced by SBS::DoorWrapper::OnClick().

Here is the call graph for this function:

◆ Open()

bool SBS::Door::Open ( Vector3 & position,
bool playsound = true,
bool force = false )

◆ Report()

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

Reimplemented from SBS::ObjectBase.

Definition at line 272 of file door.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::Report().

Referenced by Close(), and Open().

Here is the call graph for this function:

◆ ReportError()

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

Reimplemented from SBS::ObjectBase.

Definition at line 278 of file door.cpp.

References SBS::ObjectBase::GetName(), and SBS::ObjectBase::ReportError().

Referenced by FinishDoor(), and Open().

Here is the call graph for this function:

Member Data Documentation

◆ CloseSound

std::string SBS::Door::CloseSound

Definition at line 42 of file door.h.

Referenced by Close(), and Door().

◆ door

DoorWrapper* SBS::Door::door
private

Definition at line 66 of file door.h.

Referenced by AddDoorComponent(), Close(), CreateDoor(), Door(), Enabled(), FinishDoor(), MoveDoor(), Open(), and ~Door().

◆ door_changed

bool SBS::Door::door_changed
private

Definition at line 73 of file door.h.

Referenced by Door(), GetDoorChanged(), and MoveDoor().

◆ DoorDirection

bool SBS::Door::DoorDirection

◆ is_enabled

bool SBS::Door::is_enabled
private

Definition at line 72 of file door.h.

Referenced by Door(), and Enabled().

◆ IsMoving

bool SBS::Door::IsMoving

Definition at line 39 of file door.h.

Referenced by ClickDoor(), Close(), Door(), Loop(), MoveDoor(), and Open().

◆ OpenDoor

bool SBS::Door::OpenDoor

Definition at line 40 of file door.h.

Referenced by Close(), Door(), MoveDoor(), and Open().

◆ OpenSound

std::string SBS::Door::OpenSound

Definition at line 41 of file door.h.

Referenced by Door(), and Open().

◆ OpenState

bool SBS::Door::OpenState

Definition at line 38 of file door.h.

Referenced by Close(), Door(), IsOpen(), MoveDoor(), and Open().

◆ previous_open

bool SBS::Door::previous_open
private

Definition at line 74 of file door.h.

Referenced by Door(), GetPreviousOpen(), and MoveDoor().

◆ running

bool SBS::Door::running
private

Definition at line 75 of file door.h.

Referenced by Door(), and MoveDoor().

◆ sound

Sound* SBS::Door::sound
private

Definition at line 70 of file door.h.

Referenced by Close(), Door(), Open(), and ~Door().

◆ timer

Timer* SBS::Door::timer
private

Definition at line 79 of file door.h.

Referenced by AutoClose(), Door(), and ~Door().

◆ timer_interval

int SBS::Door::timer_interval
private

Definition at line 80 of file door.h.

Referenced by AutoClose(), Door(), and Open().

◆ wrapper

DynamicMesh* SBS::Door::wrapper
private

Definition at line 67 of file door.h.

Referenced by AddDoorComponent(), and Door().


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