Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

LevelScript Class Reference

Inheritance diagram for LevelScript:

Inheritance graph
[legend]
Collaboration diagram for LevelScript:

Collaboration graph
[legend]

Detailed Description

Handle plan for dialogs and planned actions.

Definition at line 19 of file LevelScript.h.

Public Member Functions

 LevelScript (Level *aLevel)
 Create new plan holder.
void updateScript ()
 Update level (plan dialogs, do anim, .
virtual void interruptPlan ()
Levellevel ()
CommandcreateCommand (int funcRef)
 Create ScriptCmd for show.
int addModel (Cube *new_model, Unit *new_unit)
 Add model at scene.
CubegetModel (int model_index)
CubeaskField (const V2 &loc)
 Returns model at location.
void addSound (const std::string &name, const Path &file)
void playSound (const std::string &name, int volume)


Constructor & Destructor Documentation

LevelScript::LevelScript Level aLevel  ) 
 

Create new plan holder.

Definition at line 29 of file LevelScript.cpp.

00030 {
00031     m_level = aLevel;
00032     registerGameFuncs();
00033 }


Member Function Documentation

int LevelScript::addModel Cube new_model,
Unit new_unit
 

Add model at scene.

Parameters:
new_model new object
new_unit driver for the object or NULL
Returns:
model index
Exceptions:
LogicException when room is not created yet

Definition at line 76 of file LevelScript.cpp.

00077 {
00078     std::auto_ptr<Cube> ptr_model(new_model);
00079     std::auto_ptr<Unit> ptr_unit(new_unit);
00080 
00081     ptr_model->takeDialogs(dialogs());
00082     return room()->addModel(ptr_model.release(), ptr_unit.release());
00083 }

void LevelScript::addSound const std::string &  name,
const Path file
 

Definition at line 102 of file LevelScript.cpp.

00103 {
00104     room()->addSound(name, file);
00105 }

Cube * LevelScript::askField const V2 loc  ) 
 

Returns model at location.

Definition at line 95 of file LevelScript.cpp.

00096 {
00097     return room()->askField(loc);
00098 }

Command * LevelScript::createCommand int  funcRef  ) 
 

Create ScriptCmd for show.

Command will be executed in this script context.

Parameters:
funcRef index of lua function
Returns:
new command

Definition at line 42 of file LevelScript.cpp.

00043 {
00044     return new ScriptCmd(m_script, funcRef);
00045 }

Cube * LevelScript::getModel int  model_index  ) 
 

Definition at line 86 of file LevelScript.cpp.

00087 {
00088     return room()->getModel(model_index);
00089 }

void LevelScript::interruptPlan  )  [virtual]
 

Reimplemented from Planner.

Definition at line 59 of file LevelScript.cpp.

00060 {
00061     Planner::interruptPlan();
00062     //NOTE: checkActive is before unBusyUnits to allow script
00063     // make busy unwanted fishes
00064     room()->checkActive();
00065     room()->unBusyUnits();
00066 }

Level* LevelScript::level  )  [inline]
 

Definition at line 31 of file LevelScript.h.

00031 { return m_level; }

void LevelScript::playSound const std::string &  name,
int  volume
 

Definition at line 108 of file LevelScript.cpp.

00109 {
00110     room()->playSound(name, volume);
00111 }

void LevelScript::updateScript  ) 
 

Update level (plan dialogs, do anim, .

..).

Definition at line 52 of file LevelScript.cpp.

00053 {
00054     m_script->doString("script_update()");
00055     satisfyPlan();
00056 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:55:46 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2