The Nebula Device 3: Script::Dialog Class Reference

The Nebula Device 3

Script::Dialog Class Reference

#include <dialog.h>

Inheritance diagram for Script::Dialog:

Core::RefCounted

Detailed Description

Contains the runtime structure of a complete dialog.

(C) 2006 Radon Labs GmbH

Public Member Functions

 Dialog ()
 constructor
virtual ~Dialog ()
 destructor
virtual Ptr< DialogTakeCreateDialogTake ()
 create a Take (override if needed)
void LoadDialogContent (Ptr< DialogDesc > dialogDesc)
 load dialog content, takes and so on, after that Dialog content is usable (param group is optional )
bool ActivateDialog (const Ptr< DialogTake > &startTake=0)
 activates the dialog
void DeactivateDialog ()
 deactivates the dialog
const Util::GuidGetGuid () const
 get dialog guid
const Util::StringGetId () const
 get dialog id
const Util::StringGetSpeaker () const
 get dialog speaker
const Util::StringGetGroup () const
 get dialog speaker group
bool IsLoaded () const
 return true if a dialog is loaded
bool IsActive () const
 return true if a dialog was activated
bool IsSpeaker (const Util::String &name) const
 check if someone is a possible speaker (doesnt need to actually say anything!)
void SetCurrentTake (const Ptr< DialogTake > &take)
 set current Dialog Take Pointer
const Ptr< DialogTake > & GetCurrentTake () const
 get current Dialog Take Pointer, the dialog must be active
const Util::Array< Util::String > & GetDialogTexts () const
 get current take text array
const Util::Array< Util::String > & GetResponseTexts () const
 get response text array
const Util::Array< Util::String > & GetShortResponseTexts () const
 get short response text array
const Util::StringGetTakeSoundID () const
 get the CueId of the current take
const Util::Array< Util::String > & GetResponseSoundIDs () const
 get a array with the CueIDs of the current responses
const Util::StringGetTakeSpeaker () const
 get the Speaker of the current take
const Util::Array< Util::String > & GetResponseSpeakers () const
 get a array with the Speaker's of the current responses
const Util::Array< bool > & GetResponsePassedStates () const
 gets a array with the passed state of the current responses
const Ptr< DialogTake > & GetResponseAtIndex (int index) const
 get index of Storage Take in Response
bool HasNextTakeLayer (const Ptr< DialogTake > &responseTake)
 has a following layer, an NPC Take, in the dialog hierarchy (FIXME Floh:????)
Ptr< DialogTakeNavigateToNextLayer (const Ptr< DialogTake > &responseTake)
 navigates to the next layer in the dialog hierarchy, returns pointer to next DialogTake
void UpdateDialogData ()
 updates the dialog-data, refresh ResponseTexts, DialogTexts and ResponseIndex
bool AssertDialog ()
 executes the assert function from the take's of the current dialog
Ptr< DialogTakeGetTakeById (const Util::String &id)
 returns a take by id
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Member Function Documentation

void Script::Dialog::LoadDialogContent ( Ptr< DialogDesc desc  ) 

load dialog content, takes and so on, after that Dialog content is usable (param group is optional )

Load the dialog's content from the database.

bool Script::Dialog::ActivateDialog ( const Ptr< DialogTake > &  startTake = 0  ) 

activates the dialog

Activates the current Dialog. That means, we set the pointer to the first valid DialogTake in the start take list, where valid means evaluation of take condition returns true. Activation will fail, and return false if dialog has no valid DialogTakes If a start take is given, set it as start take.

bool Script::Dialog::HasNextTakeLayer ( const Ptr< DialogTake > &  responseTake  ) 

has a following layer, an NPC Take, in the dialog hierarchy (FIXME Floh:????)

navigates to the next layer in the dialog hierarchy may return 0 if no following take is found

Ptr< DialogTake > Script::Dialog::NavigateToNextLayer ( const Ptr< DialogTake > &  responseTake  ) 

navigates to the next layer in the dialog hierarchy, returns pointer to next DialogTake

navigates to the next layer in the dialog hierarchy may return 0 if no following take is found

void Script::Dialog::UpdateDialogData (  ) 

updates the dialog-data, refresh ResponseTexts, DialogTexts and ResponseIndex

Updates the response and dialog texts for the current state of the dialog.

bool Script::Dialog::AssertDialog (  ) 

executes the assert function from the take's of the current dialog

Executes the assert functions of the takes of the current dialog. Additionally it collects errors in the info log object and in case of errors returns false instead of closing the application.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.