|
@@ -2,86 +2,139 @@
|
|
|
#include "Trigger.h"
|
|
|
#include "Spiel.h"
|
|
|
|
|
|
-Aktion::Aktion( AktionTyp typ )
|
|
|
+
|
|
|
+Aktion::Aktion( AktionTyp typ, RCArray< Aktion > *subActions )
|
|
|
: Variable( AKTION )
|
|
|
{
|
|
|
+ this->subActions = subActions;
|
|
|
+ for( int i = 0; i < subActions->getEintragAnzahl(); i++ )
|
|
|
+ erlaubteTypen.add( ALLE );
|
|
|
this->typ = typ;
|
|
|
}
|
|
|
|
|
|
Aktion::~Aktion()
|
|
|
+{
|
|
|
+ subActions->release();
|
|
|
+}
|
|
|
+
|
|
|
+Variable *Aktion::zEvaluatedParam( int number, LocalMemory *zMemory, ProgramCounter *zPC )
|
|
|
+{
|
|
|
+ return zMemory->zVariable( zPC->getUniqueString() + "R" + number + "__" );
|
|
|
+}
|
|
|
+
|
|
|
+Variable *Aktion::getEvaluatedParam( int number, LocalMemory *zMemory, ProgramCounter *zPC )
|
|
|
+{
|
|
|
+ return zMemory->getVariable( zPC->getUniqueString() + "R" + number + "__" );
|
|
|
+}
|
|
|
+
|
|
|
+bool Aktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ if( waitCount > 0 )
|
|
|
+ return 0;
|
|
|
+ zPC->stepIn();
|
|
|
+ // evaluate parameters
|
|
|
+ for( int i = zPC->currentPosition(); i < subActions->getEintragAnzahl(); i++ )
|
|
|
+ {
|
|
|
+ if( !subActions->z( i )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ {
|
|
|
+ zPC->stepOut();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ Variable *result = zMemory->zVariable( "__return__" );
|
|
|
+ if( ( !result && erlaubteTypen.get( i ) != NICHTS ) || result->getVariableTyp() != erlaubteTypen.get( i ) )
|
|
|
+ {
|
|
|
+ zPC->stepOut();
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ if( result )
|
|
|
+ zMemory->setVar( zPC->getUniqueString() + "R" + i + "__", result->getThis() );
|
|
|
+ zPC->count();
|
|
|
+ if( waitCount > 0 )
|
|
|
+ {
|
|
|
+ zPC->stepOut();
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if( zPC->currentPosition() == subActions->getEintragAnzahl() )
|
|
|
+ {
|
|
|
+ // evaluate result
|
|
|
+ run( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
+ zPC->stepOut();
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ zPC->stepOut();
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+void Aktion::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{}
|
|
|
|
|
|
|
|
|
KonstantNichts::KonstantNichts()
|
|
|
- : Aktion( KONSTANT_NICHTS )
|
|
|
+ : Aktion( KONSTANT_NICHTS, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool KonstantNichts::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantNichts::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", new Variable( NICHTS ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
KonstantInteger::KonstantInteger( int val )
|
|
|
- : Aktion( KONSTANT_INTEGER )
|
|
|
+ : Aktion( KONSTANT_INTEGER, new RCArray< Aktion >() )
|
|
|
{
|
|
|
this->value = val;
|
|
|
}
|
|
|
|
|
|
-bool KonstantInteger::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantInteger::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", new Integer( value ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
KonstantBoolean::KonstantBoolean( bool val )
|
|
|
- : Aktion( KONSTANT_BOOLEAN )
|
|
|
+ : Aktion( KONSTANT_BOOLEAN, new RCArray< Aktion >() )
|
|
|
{
|
|
|
value = val;
|
|
|
}
|
|
|
|
|
|
-bool KonstantBoolean::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantBoolean::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", new Boolean( value ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
KonstantString::KonstantString( Text val )
|
|
|
- : Aktion( KONSTANT_STRING )
|
|
|
+ : Aktion( KONSTANT_STRING, new RCArray< Aktion >() )
|
|
|
{
|
|
|
value = val;
|
|
|
}
|
|
|
|
|
|
-bool KonstantString::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantString::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", new String( value ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
KonstantFloat::KonstantFloat( float val )
|
|
|
- : Aktion( KONSTANT_FLOAT )
|
|
|
+ : Aktion( KONSTANT_FLOAT, new RCArray< Aktion >() )
|
|
|
{
|
|
|
value = val;
|
|
|
}
|
|
|
|
|
|
-bool KonstantFloat::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantFloat::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", new Float( value ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
KonstantVariable::KonstantVariable( Text name )
|
|
|
- : Aktion( KONSTANT_VARIABLE )
|
|
|
+ : Aktion( KONSTANT_VARIABLE, new RCArray< Aktion >() )
|
|
|
{
|
|
|
this->name = name;
|
|
|
}
|
|
|
|
|
|
-bool KonstantVariable::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void KonstantVariable::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
if( zMemory->zVariable( name ) )
|
|
|
zMemory->setVar( "__return__", zMemory->getVariable( name ) );
|
|
@@ -91,61 +144,37 @@ bool KonstantVariable::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory
|
|
|
zMemory->setVar( "__return__", zSpiel->getVariable( name ) );
|
|
|
else
|
|
|
zMemory->setVar( "__return__", new Variable( NICHTS ) );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
-Warten::Warten( Aktion *seconds )
|
|
|
- : Aktion( WARTEN )
|
|
|
+Warten::Warten( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( WARTEN, subActions )
|
|
|
{
|
|
|
- this->seconds = seconds;
|
|
|
+ this->erlaubteTypen.add( FLOAT );
|
|
|
}
|
|
|
|
|
|
Warten::~Warten()
|
|
|
-{
|
|
|
- seconds->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool Warten::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void Warten::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- bool finished = seconds->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
- if( finished )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- waitCount += ( (Float *)t )->getValue();
|
|
|
- }
|
|
|
- return finished;
|
|
|
+ waitCount += ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue();
|
|
|
}
|
|
|
|
|
|
|
|
|
-WennDannSonst::WennDannSonst( Aktion *wenn, Aktion *dann, Aktion *sonst )
|
|
|
- : Aktion( WENN_DANN_SONST )
|
|
|
-{
|
|
|
- this->wenn = wenn;
|
|
|
- this->dann = dann;
|
|
|
- this->sonst = sonst;
|
|
|
-}
|
|
|
+WennDannSonst::WennDannSonst( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( WENN_DANN_SONST, subActions )
|
|
|
+{}
|
|
|
|
|
|
WennDannSonst::~WennDannSonst()
|
|
|
-{
|
|
|
- wenn->release();
|
|
|
- if( dann )
|
|
|
- dann->release();
|
|
|
- if( sonst )
|
|
|
- sonst->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zPC->stepIn();
|
|
|
if( zPC->currentPosition() == 0 )
|
|
|
{
|
|
|
- bool finished = wenn->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
+ bool finished = subActions->z( 0 )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
if( finished )
|
|
|
{
|
|
|
Variable *ret = zMemory->zVariable( "__return__" );
|
|
@@ -153,7 +182,7 @@ bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
if( !isTrue( ret ) )
|
|
|
{
|
|
|
zPC->count();
|
|
|
- if( !sonst )
|
|
|
+ if( !subActions->z( 2 ) )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
@@ -161,7 +190,7 @@ bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if( !dann )
|
|
|
+ if( !subActions->z( 1 ) )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
@@ -171,7 +200,7 @@ bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
{
|
|
|
- bool finished = dann->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
+ bool finished = subActions->z( 1 )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
if( finished )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
@@ -180,7 +209,7 @@ bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
{
|
|
|
- bool finished = sonst->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
+ bool finished = subActions->z( 2 )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
if( finished )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
@@ -192,51 +221,37 @@ bool WennDannSonst::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
|
|
|
|
|
|
-SetVariable::SetVariable( Text name, Aktion *value )
|
|
|
- : Aktion( SET_VARIABLE )
|
|
|
+SetVariable::SetVariable( Text name, RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SET_VARIABLE, subActions )
|
|
|
{
|
|
|
this->name = name;
|
|
|
- this->value = value;
|
|
|
}
|
|
|
|
|
|
SetVariable::~SetVariable()
|
|
|
-{
|
|
|
- value->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool SetVariable::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void SetVariable::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- bool finished = value->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount );
|
|
|
- if( finished )
|
|
|
- {
|
|
|
- if( zMemory->zVariable( name ) || zEreignis->zParameter( name ) || !zSpiel->zVariable( name ) )
|
|
|
- zMemory->setVar( name, zMemory->getVariable( "__return__" ) );
|
|
|
- else
|
|
|
- zSpiel->setVariable( name, zMemory->getVariable( "__return__" ) );
|
|
|
- }
|
|
|
- return finished;
|
|
|
+ if( zMemory->zVariable( name ) || zEreignis->zParameter( name ) || !zSpiel->zVariable( name ) )
|
|
|
+ zMemory->setVar( name, getEvaluatedParam( 0, zMemory, zPC ) );
|
|
|
+ else
|
|
|
+ zSpiel->setVariable( name, getEvaluatedParam( 0, zMemory, zPC ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-TriggerAktion::TriggerAktion( Aktion *number, Aktion *triggerName )
|
|
|
- : Aktion( TRIGGER_AKTION )
|
|
|
-{
|
|
|
- this->number = number;
|
|
|
- trigger = triggerName;
|
|
|
-}
|
|
|
+TriggerAktion::TriggerAktion( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TRIGGER_AKTION, subActions )
|
|
|
+{}
|
|
|
|
|
|
TriggerAktion::~TriggerAktion()
|
|
|
-{
|
|
|
- number->release();
|
|
|
- trigger->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
bool TriggerAktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zPC->stepIn();
|
|
|
if( zPC->currentPosition() == 0 )
|
|
|
{
|
|
|
- if( number->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ if( subActions->z( 0 )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
if( !t || t->getVariableTyp() != INTEGER )
|
|
@@ -250,7 +265,7 @@ bool TriggerAktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
{
|
|
|
- if( trigger->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ if( subActions->z( 1 )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
if( !t || t->getVariableTyp() != TRIGGER )
|
|
@@ -258,7 +273,7 @@ bool TriggerAktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- int id = ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue();
|
|
|
+ int id = ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue();
|
|
|
if( id >= ( (Trigger *)t )->getAktionAnzahl() )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
@@ -270,7 +285,7 @@ bool TriggerAktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
{
|
|
|
- if( ( (Aktion *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ if( ( (Aktion *)zEvaluatedParam( 0, zMemory, zPC ) )->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
@@ -281,3023 +296,1145 @@ bool TriggerAktion::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerNachricht::SpielerNachricht( Aktion *spieler, Aktion *nachricht )
|
|
|
- : Aktion( SPIELER_NACHRICHT )
|
|
|
+SpielerNachricht::SpielerNachricht( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_NACHRICHT, subActions )
|
|
|
{
|
|
|
- this->spieler = spieler;
|
|
|
- this->nachricht = nachricht;
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
+ erlaubteTypen.add( STRING );
|
|
|
}
|
|
|
|
|
|
SpielerNachricht::~SpielerNachricht()
|
|
|
-{
|
|
|
- spieler->release();
|
|
|
- nachricht->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool SpielerNachricht::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void SpielerNachricht::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( nachricht->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( t->getVariableTyp() != STRING )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- // this is handeld on client side directly (no need to send the message to the player)
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ // this is handeld on client side directly (no need to send the message to the player)
|
|
|
}
|
|
|
|
|
|
|
|
|
-DisplayText::DisplayText( Aktion *x, Aktion *y, Aktion *f, Aktion *dauer, Aktion *nachricht )
|
|
|
- : Aktion( DISPLAY_TEXT )
|
|
|
+DisplayText::DisplayText( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( DISPLAY_TEXT, subActions )
|
|
|
{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->color = f;
|
|
|
- this->dauer = dauer;
|
|
|
- this->nachricht = nachricht;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( STRING );
|
|
|
}
|
|
|
|
|
|
DisplayText::~DisplayText()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- color->release();
|
|
|
- dauer->release();
|
|
|
- nachricht->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool DisplayText::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void DisplayText::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( dauer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R2__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 3 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( color->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || ( t->getVariableTyp() != INTEGER ) )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R3__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 4 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( color->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || ( t->getVariableTyp() != STRING ) )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- //Float *xv = (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" );
|
|
|
- //Float *yv = (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" );
|
|
|
- //Float *dauerv = (Float *)zMemory->zVariable( zPC->getUniqueString() + "R2__" );
|
|
|
- //Integer *farbev = (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R3__" );
|
|
|
- // do nothing because the server does not need to show text
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ // do nothing because the server does not need to show text
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielPause::SpielPause( Aktion *paused )
|
|
|
- : Aktion( SPIEL_PAUSE )
|
|
|
+SpielPause::SpielPause( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIEL_PAUSE, subActions )
|
|
|
{
|
|
|
- this->paused = paused;
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
}
|
|
|
|
|
|
SpielPause::~SpielPause()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielPause::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- paused->release();
|
|
|
+ zSpiel->setPausiert( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool SpielPause::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+SpielEnde::SpielEnde( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIEL_ENDE, subActions )
|
|
|
+{}
|
|
|
+
|
|
|
+SpielEnde::~SpielEnde()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielEnde::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( paused->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || ( t->getVariableTyp() != BOOLEAN ) )
|
|
|
- return 1;
|
|
|
- zSpiel->setPausiert( ( (Boolean *)t )->getValue() );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ Variable *t = zEvaluatedParam( 0, zMemory, zPC );
|
|
|
+ if( t->getVariableTyp() != NICHTS && t->getVariableTyp() != TEAM )
|
|
|
+ t = 0;
|
|
|
+ zSpiel->setEnde( t->getVariableTyp() == NICHTS ? 0 : (Team *)t );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielEnde::SpielEnde( Aktion *gewinnerTeam )
|
|
|
- : Aktion( SPIEL_ENDE )
|
|
|
+SpielerSetLevel::SpielerSetLevel( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_LEVEL, subActions )
|
|
|
{
|
|
|
- this->gewinnerTeam = gewinnerTeam;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielEnde::~SpielEnde()
|
|
|
+SpielerSetLevel::~SpielerSetLevel()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetLevel::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- gewinnerTeam->release();
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setLevel( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool SpielEnde::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+SpielerGiveItem::SpielerGiveItem( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_GIVE_ITEM, subActions )
|
|
|
{
|
|
|
- if( gewinnerTeam->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || ( t->getVariableTyp() != TEAM && t->getVariableTyp() != NICHTS ) )
|
|
|
- return 1;
|
|
|
- zSpiel->setEnde( t->getVariableTyp() == NICHTS ? 0 : (Team *)t );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( GEGENSTAND_TYP );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
+SpielerGiveItem::~SpielerGiveItem()
|
|
|
+{}
|
|
|
|
|
|
-SpielerSetLevel::SpielerSetLevel( Aktion *level, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_LEVEL )
|
|
|
+void SpielerGiveItem::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->level = level;
|
|
|
- this->spieler = spieler;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 2, zMemory, zPC ) )->addItem( ( (GegenstandTypVar *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue(),
|
|
|
+ ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue(), zSpiel );
|
|
|
}
|
|
|
|
|
|
-SpielerSetLevel::~SpielerSetLevel()
|
|
|
+
|
|
|
+SpielerRemoveItem::SpielerRemoveItem( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_REMOVE_ITEM, subActions )
|
|
|
{
|
|
|
- level->release();
|
|
|
- spieler->release();
|
|
|
+ erlaubteTypen.add( GEGENSTAND_TYP );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-bool SpielerSetLevel::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+SpielerRemoveItem::~SpielerRemoveItem()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerRemoveItem::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( level->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setLevel( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 2, zMemory, zPC ) )->removeItem( ( (GegenstandTypVar *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue(),
|
|
|
+ ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerGiveItem::SpielerGiveItem( Aktion *item, Aktion *anzahl, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_GIVE_ITEM )
|
|
|
+SpielerSetLeben::SpielerSetLeben( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_LEBEN, subActions )
|
|
|
{
|
|
|
- this->item = item;
|
|
|
- this->anzahl = anzahl;
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielerGiveItem::~SpielerGiveItem()
|
|
|
+SpielerSetLeben::~SpielerSetLeben()
|
|
|
{}
|
|
|
|
|
|
-bool SpielerGiveItem::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void SpielerSetLeben::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( item->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GEGENSTAND_TYP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( anzahl->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->addItem( ( (GegenstandTypVar *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue(),
|
|
|
- ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue(), zSpiel );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setLeben( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerRemoveItem::SpielerRemoveItem( Aktion *item, Aktion *anzahl, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_REMOVE_ITEM )
|
|
|
+SpielerSetMaxLeben::SpielerSetMaxLeben( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_LEBEN, subActions )
|
|
|
{
|
|
|
- this->item = item;
|
|
|
- this->anzahl = anzahl;
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielerRemoveItem::~SpielerRemoveItem()
|
|
|
+SpielerSetMaxLeben::~SpielerSetMaxLeben()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetMaxLeben::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- item->release();
|
|
|
- anzahl->release();
|
|
|
- spieler->release();
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setMaxLeben( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool SpielerRemoveItem::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+SpielerSetErfahrung::SpielerSetErfahrung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_ERFAHRUNG, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( item->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GEGENSTAND_TYP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( anzahl->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->removeItem( ( (GegenstandTypVar *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue(),
|
|
|
- ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
+SpielerSetErfahrung::~SpielerSetErfahrung()
|
|
|
+{}
|
|
|
|
|
|
-SpielerSetLeben::SpielerSetLeben( Aktion *leben, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_LEBEN )
|
|
|
+void SpielerSetErfahrung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->leben = leben;
|
|
|
- this->spieler = spieler;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setErfahrung( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-SpielerSetLeben::~SpielerSetLeben()
|
|
|
-{
|
|
|
- leben->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
|
|
|
-bool SpielerSetLeben::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+SpielerSetMaxErfahrung::SpielerSetMaxErfahrung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_MAX_ERFAHRUNG, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( leben->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setLeben( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
+SpielerSetMaxErfahrung::~SpielerSetMaxErfahrung()
|
|
|
+{}
|
|
|
|
|
|
-SpielerSetMaxLeben::SpielerSetMaxLeben( Aktion *leben, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_LEBEN )
|
|
|
+void SpielerSetMaxErfahrung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->leben = leben;
|
|
|
- this->spieler = spieler;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setMaxErfahrung( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-SpielerSetMaxLeben::~SpielerSetMaxLeben()
|
|
|
+
|
|
|
+SpielerSetTempo::SpielerSetTempo( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_TEMPO, subActions )
|
|
|
{
|
|
|
- leben->release();
|
|
|
- spieler->release();
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-bool SpielerSetMaxLeben::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+SpielerSetTempo::~SpielerSetTempo()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetTempo::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( leben->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setMaxLeben( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setLaufTempo( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerSetErfahrung::SpielerSetErfahrung( Aktion *erfahrung, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_ERFAHRUNG )
|
|
|
+SpielerSetWaffenTempo::SpielerSetWaffenTempo( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_GESCHOSS_TEMPO, subActions )
|
|
|
{
|
|
|
- this->erfahrung = erfahrung;
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielerSetErfahrung::~SpielerSetErfahrung()
|
|
|
+SpielerSetWaffenTempo::~SpielerSetWaffenTempo()
|
|
|
{}
|
|
|
|
|
|
-bool SpielerSetErfahrung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void SpielerSetWaffenTempo::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( erfahrung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setErfahrung( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setGeschossTempo( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerSetMaxErfahrung::SpielerSetMaxErfahrung( Aktion *erfahrung, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_MAX_ERFAHRUNG )
|
|
|
+SpielerSetArmor::SpielerSetArmor( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_ARMOR, subActions )
|
|
|
{
|
|
|
- this->erfahrung = erfahrung;
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielerSetMaxErfahrung::~SpielerSetMaxErfahrung()
|
|
|
+SpielerSetArmor::~SpielerSetArmor()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetArmor::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- erfahrung->release();
|
|
|
- spieler->release();
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setArmor( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool SpielerSetMaxErfahrung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+SpielerSetSchadenBonus::SpielerSetSchadenBonus( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_SCHADEN_BONUS, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( erfahrung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setMaxErfahrung( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
+SpielerSetSchadenBonus::~SpielerSetSchadenBonus()
|
|
|
+{}
|
|
|
|
|
|
-SpielerSetTempo::SpielerSetTempo( Aktion *tempo, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_TEMPO )
|
|
|
+void SpielerSetSchadenBonus::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->tempo = tempo;
|
|
|
- this->spieler = spieler;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setSchadenBonus( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-SpielerSetTempo::~SpielerSetTempo()
|
|
|
+
|
|
|
+SpielerSetLebensraub::SpielerSetLebensraub( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_LEBENSRAUB, subActions )
|
|
|
{
|
|
|
- tempo->release();
|
|
|
- spieler->release();
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-bool SpielerSetTempo::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+SpielerSetLebensraub::~SpielerSetLebensraub()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetLebensraub::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( tempo->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setLaufTempo( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setLebensRaub( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerSetWaffenTempo::SpielerSetWaffenTempo( Aktion *tempo, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_GESCHOSS_TEMPO )
|
|
|
+SpielerSetLebensregeneration::SpielerSetLebensregeneration( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_LEBENSRAUB, subActions )
|
|
|
{
|
|
|
- this->tempo = tempo;
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
-SpielerSetWaffenTempo::~SpielerSetWaffenTempo()
|
|
|
+SpielerSetLebensregeneration::~SpielerSetLebensregeneration()
|
|
|
+{}
|
|
|
+
|
|
|
+void SpielerSetLebensregeneration::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- tempo->release();
|
|
|
- spieler->release();
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setLebensRegeneration( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool SpielerSetWaffenTempo::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+SpielerSetAbklingzeitverringerung::SpielerSetAbklingzeitverringerung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SPIELER_SET_ABKLINGZEITVERRINGERUNG, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( tempo->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setGeschossTempo( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
+SpielerSetAbklingzeitverringerung::~SpielerSetAbklingzeitverringerung()
|
|
|
+{}
|
|
|
|
|
|
-SpielerSetArmor::SpielerSetArmor( Aktion *armor, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_ARMOR )
|
|
|
+void SpielerSetAbklingzeitverringerung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->armor = armor;
|
|
|
- this->spieler = spieler;
|
|
|
+ ( (Spieler *)zEvaluatedParam( 1, zMemory, zPC ) )->setAbklingZeitVerringerung( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-SpielerSetArmor::~SpielerSetArmor()
|
|
|
+
|
|
|
+DropSetTime::DropSetTime( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( DROP_SET_TIME, subActions )
|
|
|
{
|
|
|
- armor->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetArmor::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( armor->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setArmor( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SpielerSetSchadenBonus::SpielerSetSchadenBonus( Aktion *bonus, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_SCHADEN_BONUS )
|
|
|
-{
|
|
|
- this->bonus = bonus;
|
|
|
- this->spieler = spieler;
|
|
|
-}
|
|
|
-
|
|
|
-SpielerSetSchadenBonus::~SpielerSetSchadenBonus()
|
|
|
-{
|
|
|
- bonus->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetSchadenBonus::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( bonus->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setSchadenBonus( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SpielerSetLebensraub::SpielerSetLebensraub( Aktion *lebensraub, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_LEBENSRAUB )
|
|
|
-{
|
|
|
- this->lebensraub = lebensraub;
|
|
|
- this->spieler = spieler;
|
|
|
-}
|
|
|
-
|
|
|
-SpielerSetLebensraub::~SpielerSetLebensraub()
|
|
|
-{
|
|
|
- lebensraub->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetLebensraub::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( lebensraub->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setLebensRaub( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SpielerSetLebensregeneration::SpielerSetLebensregeneration( Aktion *regeneration, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_LEBENSRAUB )
|
|
|
-{
|
|
|
- this->regeneration = regeneration;
|
|
|
- this->spieler = spieler;
|
|
|
-}
|
|
|
-
|
|
|
-SpielerSetLebensregeneration::~SpielerSetLebensregeneration()
|
|
|
-{
|
|
|
- regeneration->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetLebensregeneration::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( regeneration->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setLebensRegeneration( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SpielerSetAbklingzeitverringerung::SpielerSetAbklingzeitverringerung( Aktion *verringerung, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_ABKLINGZEITVERRINGERUNG )
|
|
|
-{
|
|
|
- this->verringerung = verringerung;
|
|
|
- this->spieler = spieler;
|
|
|
-}
|
|
|
-
|
|
|
-SpielerSetAbklingzeitverringerung::~SpielerSetAbklingzeitverringerung()
|
|
|
-{
|
|
|
- verringerung->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetAbklingzeitverringerung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( verringerung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setAbklingZeitVerringerung( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-DropSetTime::DropSetTime( Aktion *time, Aktion *drop )
|
|
|
- : Aktion( DROP_SET_TIME )
|
|
|
-{
|
|
|
- this->time = time;
|
|
|
- this->drop = drop;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
DropSetTime::~DropSetTime()
|
|
|
-{
|
|
|
- time->release();
|
|
|
- drop->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool DropSetTime::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( time->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Drop *)t )->setTime( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-DropSetMaxTime::DropSetMaxTime( Aktion *time, Aktion *drop )
|
|
|
- : Aktion( DROP_SET_MAX_TIME )
|
|
|
-{
|
|
|
- this->time = time;
|
|
|
- this->drop = drop;
|
|
|
-}
|
|
|
-
|
|
|
-DropSetMaxTime::~DropSetMaxTime()
|
|
|
-{
|
|
|
- time->release();
|
|
|
- drop->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool DropSetMaxTime::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( time->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Drop *)t )->setMaxTime( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-DropSetArea::DropSetArea( Aktion *minX, Aktion *maxX, Aktion *minY, Aktion *maxY, Aktion *drop )
|
|
|
- : Aktion( DROP_SET_AREA )
|
|
|
-{
|
|
|
- this->minX = minX;
|
|
|
- this->maxX = maxX;
|
|
|
- this->minY = minY;
|
|
|
- this->maxY = maxY;
|
|
|
- this->drop = drop;
|
|
|
-}
|
|
|
-
|
|
|
-DropSetArea::~DropSetArea()
|
|
|
-{
|
|
|
- minX->release();
|
|
|
- maxX->release();
|
|
|
- minY->release();
|
|
|
- maxY->release();
|
|
|
- drop->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool DropSetArea::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( minX->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( maxX->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( minY->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R2__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 3 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( maxY->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R3__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 4 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Drop *)t )->setMinX( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Drop *)t )->setMaxX( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- ( (Drop *)t )->setMinY( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R2__" ) )->getValue() );
|
|
|
- ( (Drop *)t )->setMaxY( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R3__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-DropDoDrop::DropDoDrop( Aktion *drop )
|
|
|
- : Aktion( DROP_DO_DROP )
|
|
|
-{
|
|
|
- this->drop = drop;
|
|
|
-}
|
|
|
-
|
|
|
-DropDoDrop::~DropDoDrop()
|
|
|
{}
|
|
|
-
|
|
|
-bool DropDoDrop::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Drop *)t )->doDrop( zSpiel );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-BariereBewegung::BariereBewegung( Aktion *bariere )
|
|
|
- : Aktion( BARIERE_BEWEGUNG )
|
|
|
-{
|
|
|
- this->bariere = bariere;
|
|
|
-}
|
|
|
-
|
|
|
-BariereBewegung::~BariereBewegung()
|
|
|
-{
|
|
|
- bariere->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool BariereBewegung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BARIERE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Bariere *)t )->startAutoVerschiebung( zSpiel );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-BariereSetEingeschaltet::BariereSetEingeschaltet( Aktion *eingeschaltet, Aktion *bariere )
|
|
|
- : Aktion( BARIERE_SET_EINGESCHALTET )
|
|
|
-{
|
|
|
- this->eingeschaltet = eingeschaltet;
|
|
|
- this->bariere = bariere;
|
|
|
-}
|
|
|
-
|
|
|
-BariereSetEingeschaltet::~BariereSetEingeschaltet()
|
|
|
-{
|
|
|
- eingeschaltet->release();
|
|
|
- bariere->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool BariereSetEingeschaltet::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( eingeschaltet->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BARIERE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Bariere *)t )->setEingeschaltet( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-GameObjektSetPosition::GameObjektSetPosition( Aktion *x, Aktion *y, Aktion *objekt )
|
|
|
- : Aktion( GAME_OBJEKT_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->objekt = objekt;
|
|
|
-}
|
|
|
-
|
|
|
-GameObjektSetPosition::~GameObjektSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- objekt->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool GameObjektSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( objekt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BARIERE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (GameObject *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (GameObject *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-GameObjektSetSize::GameObjektSetSize( Aktion *x, Aktion *y, Aktion *objekt )
|
|
|
- : Aktion( GAME_OBJEKT_SET_SIZE )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->objekt = objekt;
|
|
|
-}
|
|
|
-
|
|
|
-GameObjektSetSize::~GameObjektSetSize()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- objekt->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool GameObjektSetSize::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( objekt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BARIERE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (GameObject *)t )->setWidth( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (GameObject *)t )->setHeight( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-BariereSetTeam::BariereSetTeam( Aktion *team, Aktion *bariere )
|
|
|
- : Aktion( BARIERE_SET_TEAM )
|
|
|
-{
|
|
|
- this->team = team;
|
|
|
- this->bariere = bariere;
|
|
|
-}
|
|
|
-
|
|
|
-BariereSetTeam::~BariereSetTeam()
|
|
|
-{
|
|
|
- team->release();
|
|
|
- bariere->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool BariereSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( team->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TEAM )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BARIERE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Bariere *)t )->setTeam( ( (Team *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SchalterSetErlaubt::SchalterSetErlaubt( Aktion *erlaubt, Aktion *schalter )
|
|
|
- : Aktion( SCHALTER_SET_ERLAUBT )
|
|
|
-{
|
|
|
- this->erlaubt = erlaubt;
|
|
|
- this->schalter = schalter;
|
|
|
-}
|
|
|
-
|
|
|
-SchalterSetErlaubt::~SchalterSetErlaubt()
|
|
|
-{
|
|
|
- erlaubt->release();
|
|
|
- schalter->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SchalterSetErlaubt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( erlaubt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( schalter->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SCHALTER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Schalter *)t )->setAktive( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-SchalterAktivieren::SchalterAktivieren( Aktion *schalter )
|
|
|
- : Aktion( SCHALTER_AKTIVIEREN )
|
|
|
-{
|
|
|
- this->schalter = schalter;
|
|
|
-}
|
|
|
-
|
|
|
-SchalterAktivieren::~SchalterAktivieren()
|
|
|
-{
|
|
|
- schalter->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SchalterAktivieren::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- if( schalter->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SCHALTER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zSpiel->activateShalter( ( (Schalter *)t )->getId() );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-TunnelSetZielPosition::TunnelSetZielPosition( Aktion *x, Aktion *y, Aktion *tunnel )
|
|
|
- : Aktion( TUNNEL_SET_ZIEL_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->tunnel = tunnel;
|
|
|
-}
|
|
|
-
|
|
|
-TunnelSetZielPosition::~TunnelSetZielPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- tunnel->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool TunnelSetZielPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( tunnel->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TUNNEL )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Tunnel *)t )->setZielX( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Tunnel *)t )->setZielY( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-TunnelSetErlaubt::TunnelSetErlaubt( Aktion *erlaubt, Aktion *tunnel )
|
|
|
- : Aktion( TUNNEL_SET_ERLAUBT )
|
|
|
-{
|
|
|
- this->erlaubt = erlaubt;
|
|
|
- this->tunnel = tunnel;
|
|
|
-}
|
|
|
-
|
|
|
-TunnelSetErlaubt::~TunnelSetErlaubt()
|
|
|
-{
|
|
|
- erlaubt->release();
|
|
|
- tunnel->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool TunnelSetErlaubt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( erlaubt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( tunnel->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TUNNEL )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Tunnel *)t )->setAktiv( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+
|
|
|
+void DropSetTime::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ ( (Drop *)zEvaluatedParam( 1, zMemory, zPC ) )->setTime( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-UmlenkungSetRichtung::UmlenkungSetRichtung( Aktion *richtung, Aktion *umlenkung )
|
|
|
- : Aktion( UMLENKUNG_SET_RICHTUNG )
|
|
|
+DropSetMaxTime::DropSetMaxTime( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( DROP_SET_MAX_TIME, subActions )
|
|
|
{
|
|
|
- this->richtung = richtung;
|
|
|
- this->umlenkung = umlenkung;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
-UmlenkungSetRichtung::~UmlenkungSetRichtung()
|
|
|
+DropSetMaxTime::~DropSetMaxTime()
|
|
|
+{}
|
|
|
+
|
|
|
+void DropSetMaxTime::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- richtung->release();
|
|
|
- umlenkung->release();
|
|
|
+ ( (Drop *)zEvaluatedParam( 1, zMemory, zPC ) )->setMaxTime( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool UmlenkungSetRichtung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+DropSetArea::DropSetArea( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( DROP_SET_AREA, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( richtung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != RICHTUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( umlenkung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != UMLENKUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Umlenkung *)t )->setRichtung( getRichtungFromString( ( (String *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
+DropSetArea::~DropSetArea()
|
|
|
+{}
|
|
|
|
|
|
-UmlenkungSetMaxAbk::UmlenkungSetMaxAbk( Aktion *abk, Aktion *umlenkung )
|
|
|
- : Aktion( UMLENKUNG_SET_MAX_ABK )
|
|
|
+void DropSetArea::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->abk = abk;
|
|
|
- this->umlenkung = umlenkung;
|
|
|
+ ( (Drop *)zEvaluatedParam( 4, zMemory, zPC ) )->setMinX( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (Drop *)zEvaluatedParam( 4, zMemory, zPC ) )->setMaxX( ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (Drop *)zEvaluatedParam( 4, zMemory, zPC ) )->setMinY( ( (Integer *)zEvaluatedParam( 2, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (Drop *)zEvaluatedParam( 4, zMemory, zPC ) )->setMaxY( ( (Integer *)zEvaluatedParam( 3, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-UmlenkungSetMaxAbk::~UmlenkungSetMaxAbk()
|
|
|
+
|
|
|
+DropDoDrop::DropDoDrop( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( DROP_DO_DROP, subActions )
|
|
|
{
|
|
|
- abk->release();
|
|
|
- umlenkung->release();
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
-bool UmlenkungSetMaxAbk::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+DropDoDrop::~DropDoDrop()
|
|
|
+{}
|
|
|
+
|
|
|
+void DropDoDrop::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( abk->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( umlenkung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != UMLENKUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Umlenkung *)t )->setMaxAbklingzeit( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Drop *)zEvaluatedParam( 0, zMemory, zPC ) )->doDrop( zSpiel );
|
|
|
}
|
|
|
|
|
|
|
|
|
-UmlenkungSetEnabled::UmlenkungSetEnabled( Aktion *enabled, Aktion *umlenkung )
|
|
|
- : Aktion( UMLENKUNG_SET_ERLAUBT )
|
|
|
+BariereBewegung::BariereBewegung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( BARIERE_BEWEGUNG, subActions )
|
|
|
{
|
|
|
- this->enabled = enabled;
|
|
|
- this->umlenkung = umlenkung;
|
|
|
+ erlaubteTypen.add( BARIERE );
|
|
|
}
|
|
|
|
|
|
-UmlenkungSetEnabled::~UmlenkungSetEnabled()
|
|
|
+BariereBewegung::~BariereBewegung()
|
|
|
+{}
|
|
|
+
|
|
|
+void BariereBewegung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- enabled->release();
|
|
|
- umlenkung->release();
|
|
|
+ ( (Bariere *)zEvaluatedParam( 0, zMemory, zPC ) )->startAutoVerschiebung( zSpiel );
|
|
|
}
|
|
|
|
|
|
-bool UmlenkungSetEnabled::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+BariereSetEingeschaltet::BariereSetEingeschaltet( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( BARIERE_SET_EINGESCHALTET, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( enabled->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( umlenkung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != UMLENKUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Umlenkung *)t )->setAktiv( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
+BariereSetEingeschaltet::~BariereSetEingeschaltet()
|
|
|
+{}
|
|
|
|
|
|
-BaseSetTeam::BaseSetTeam( Aktion *team, Aktion *base )
|
|
|
- : Aktion( BASE_SET_TEAM )
|
|
|
+void BariereSetEingeschaltet::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->team = team;
|
|
|
- this->base = base;
|
|
|
+ ( (Bariere *)zEvaluatedParam( 1, zMemory, zPC ) )->setEingeschaltet( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-BaseSetTeam::~BaseSetTeam()
|
|
|
+
|
|
|
+GameObjektSetPosition::GameObjektSetPosition( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GAME_OBJEKT_SET_POSITION, subActions )
|
|
|
{
|
|
|
- team->release();
|
|
|
- base->release();
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( GAME_OBJEKT );
|
|
|
}
|
|
|
|
|
|
-bool BaseSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+GameObjektSetPosition::~GameObjektSetPosition()
|
|
|
+{}
|
|
|
+
|
|
|
+void GameObjektSetPosition::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( team->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TEAM )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( base->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BASE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Base *)t )->setTeam( ( (Team *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (GameObject *)zEvaluatedParam( 2, zMemory, zPC ) )->setX( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (GameObject *)zEvaluatedParam( 2, zMemory, zPC ) )->setY( ( (Float *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-TriggerRunStart::TriggerRunStart( Aktion *trigger )
|
|
|
- : Aktion( TRIGGER_RUN_START )
|
|
|
+
|
|
|
+GameObjektSetSize::GameObjektSetSize( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GAME_OBJEKT_SET_SIZE, subActions )
|
|
|
{
|
|
|
- this->trigger = trigger;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( GAME_OBJEKT );
|
|
|
}
|
|
|
|
|
|
-TriggerRunStart::~TriggerRunStart()
|
|
|
+GameObjektSetSize::~GameObjektSetSize()
|
|
|
+{}
|
|
|
+
|
|
|
+void GameObjektSetSize::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- trigger->release();
|
|
|
+ ( (GameObject *)zEvaluatedParam( 2, zMemory, zPC ) )->setWidth( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (GameObject *)zEvaluatedParam( 2, zMemory, zPC ) )->setHeight( ( (Float *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool TriggerRunStart::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+BariereSetTeam::BariereSetTeam( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( BARIERE_SET_TEAM, subActions )
|
|
|
{
|
|
|
- if( trigger->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TRIGGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zSpiel->addTriggerRun( ( (Trigger *)t )->runTrigger( zEreignis->getThis(), zSpiel ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( TEAM );
|
|
|
+ erlaubteTypen.add( BARIERE );
|
|
|
}
|
|
|
|
|
|
+BariereSetTeam::~BariereSetTeam()
|
|
|
+{}
|
|
|
|
|
|
-TriggerSetEnabled::TriggerSetEnabled( Aktion *enabled, Aktion *trigger )
|
|
|
- : Aktion( TRIGGER_SET_ENABLED )
|
|
|
+void BariereSetTeam::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->enabled = enabled;
|
|
|
- this->trigger = trigger;
|
|
|
+ ( (Bariere *)zEvaluatedParam( 1, zMemory, zPC ) )->setTeam( ( (Team *)zEvaluatedParam( 0, zMemory, zPC ) ) );
|
|
|
}
|
|
|
|
|
|
-TriggerSetEnabled::~TriggerSetEnabled()
|
|
|
+
|
|
|
+SchalterSetErlaubt::SchalterSetErlaubt( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SCHALTER_SET_ERLAUBT, subActions )
|
|
|
{
|
|
|
- enabled->release();
|
|
|
- trigger->release();
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( SCHALTER );
|
|
|
}
|
|
|
|
|
|
-bool TriggerSetEnabled::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+SchalterSetErlaubt::~SchalterSetErlaubt()
|
|
|
+{}
|
|
|
+
|
|
|
+void SchalterSetErlaubt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( enabled->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( trigger->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TRIGGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Trigger *)t )->setAktiv( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Schalter *)zEvaluatedParam( 1, zMemory, zPC ) )->setAktive( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-TeamSetPunkte::TeamSetPunkte( Aktion *punkte, Aktion *team )
|
|
|
- : Aktion( TEAM_SET_PUNKTE )
|
|
|
+SchalterAktivieren::SchalterAktivieren( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( SCHALTER_AKTIVIEREN, subActions )
|
|
|
{
|
|
|
- this->punkte = punkte;
|
|
|
- this->team = team;
|
|
|
+ erlaubteTypen.add( SCHALTER );
|
|
|
}
|
|
|
|
|
|
-TeamSetPunkte::~TeamSetPunkte()
|
|
|
+SchalterAktivieren::~SchalterAktivieren()
|
|
|
+{}
|
|
|
+
|
|
|
+void SchalterAktivieren::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- punkte->release();
|
|
|
- team->release();
|
|
|
+ zSpiel->activateShalter( ( (Schalter *)zEvaluatedParam( 0, zMemory, zPC ) )->getId() );
|
|
|
}
|
|
|
|
|
|
-bool TeamSetPunkte::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+TunnelSetZielPosition::TunnelSetZielPosition( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TUNNEL_SET_ZIEL_POSITION, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( punkte->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( team->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TEAM )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Team *)t )->setPunkte( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( TUNNEL );
|
|
|
}
|
|
|
|
|
|
+TunnelSetZielPosition::~TunnelSetZielPosition()
|
|
|
+{}
|
|
|
|
|
|
-TimerSetPause::TimerSetPause( Aktion *pause, Aktion *timer )
|
|
|
- : Aktion( TIMER_SET_PAUSE )
|
|
|
+void TunnelSetZielPosition::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->pause = pause;
|
|
|
- this->timer = timer;
|
|
|
+ ( (Tunnel *)zEvaluatedParam( 2, zMemory, zPC ) )->setZielX( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+ ( (Tunnel *)zEvaluatedParam( 2, zMemory, zPC ) )->setZielY( ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-TimerSetPause::~TimerSetPause()
|
|
|
+
|
|
|
+TunnelSetErlaubt::TunnelSetErlaubt( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TUNNEL_SET_ERLAUBT, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( TUNNEL );
|
|
|
+}
|
|
|
+
|
|
|
+TunnelSetErlaubt::~TunnelSetErlaubt()
|
|
|
+{}
|
|
|
+
|
|
|
+void TunnelSetErlaubt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- pause->release();
|
|
|
- timer->release();
|
|
|
+ ( (Tunnel *)zEvaluatedParam( 1, zMemory, zPC ) )->setAktiv( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool TimerSetPause::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+UmlenkungSetRichtung::UmlenkungSetRichtung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( UMLENKUNG_SET_RICHTUNG, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( pause->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( timer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TIMER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Timer *)t )->setPause( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( RICHTUNG );
|
|
|
+ erlaubteTypen.add( UMLENKUNG );
|
|
|
}
|
|
|
|
|
|
+UmlenkungSetRichtung::~UmlenkungSetRichtung()
|
|
|
+{}
|
|
|
|
|
|
-TimerStart::TimerStart( Aktion *timer )
|
|
|
- : Aktion( TIMER_START )
|
|
|
+void UmlenkungSetRichtung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->timer = timer;
|
|
|
+ ( (Umlenkung *)zEvaluatedParam( 1, zMemory, zPC ) )->setRichtung( getRichtungFromString( ( (String *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() ) );
|
|
|
}
|
|
|
|
|
|
-TimerStart::~TimerStart()
|
|
|
+
|
|
|
+UmlenkungSetMaxAbk::UmlenkungSetMaxAbk( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( UMLENKUNG_SET_MAX_ABK, subActions )
|
|
|
{
|
|
|
- timer->release();
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( UMLENKUNG );
|
|
|
}
|
|
|
|
|
|
-bool TimerStart::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+UmlenkungSetMaxAbk::~UmlenkungSetMaxAbk()
|
|
|
+{}
|
|
|
+
|
|
|
+void UmlenkungSetMaxAbk::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( timer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TIMER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Timer *)t )->start( zSpiel );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ ( (Umlenkung *)zEvaluatedParam( 1, zMemory, zPC ) )->setMaxAbklingzeit( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-TimerSetZeit::TimerSetZeit( Aktion *zeit, Aktion *timer )
|
|
|
- : Aktion( TIMER_SET_ZEIT )
|
|
|
+UmlenkungSetEnabled::UmlenkungSetEnabled( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( UMLENKUNG_SET_ERLAUBT, subActions )
|
|
|
{
|
|
|
- this->zeit = zeit;
|
|
|
- this->timer = timer;
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( UMLENKUNG );
|
|
|
}
|
|
|
|
|
|
-TimerSetZeit::~TimerSetZeit()
|
|
|
+UmlenkungSetEnabled::~UmlenkungSetEnabled()
|
|
|
+{}
|
|
|
+
|
|
|
+void UmlenkungSetEnabled::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zeit->release();
|
|
|
- timer->release();
|
|
|
+ ( (Umlenkung *)zEvaluatedParam( 1, zMemory, zPC ) )->setAktiv( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool TimerSetZeit::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+BaseSetTeam::BaseSetTeam( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( BASE_SET_TEAM, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( zeit->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( timer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TIMER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Timer *)t )->setZeit( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( TEAM );
|
|
|
+ erlaubteTypen.add( BASE );
|
|
|
}
|
|
|
|
|
|
+BaseSetTeam::~BaseSetTeam()
|
|
|
+{}
|
|
|
|
|
|
-TimerSetSichtbar::TimerSetSichtbar( Aktion *sichtbar, Aktion *timer )
|
|
|
- : Aktion( TIMER_SET_SICHTBAR )
|
|
|
+void BaseSetTeam::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->sichtbar = sichtbar;
|
|
|
- this->timer = timer;
|
|
|
+ ( (Base *)zEvaluatedParam( 1, zMemory, zPC ) )->setTeam( ( (Team *)zEvaluatedParam( 0, zMemory, zPC ) ) );
|
|
|
}
|
|
|
|
|
|
-TimerSetSichtbar::~TimerSetSichtbar()
|
|
|
+TriggerRunStart::TriggerRunStart( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TRIGGER_RUN_START, subActions )
|
|
|
{
|
|
|
- sichtbar->release();
|
|
|
- timer->release();
|
|
|
+ erlaubteTypen.add( TRIGGER );
|
|
|
}
|
|
|
|
|
|
-bool TimerSetSichtbar::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+TriggerRunStart::~TriggerRunStart()
|
|
|
+{}
|
|
|
+
|
|
|
+void TriggerRunStart::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( sichtbar->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BOOLEAN )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( timer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TIMER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Timer *)t )->setSichtbar( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ zSpiel->addTriggerRun( ( (Trigger *)zEvaluatedParam( 0, zMemory, zPC ) )->runTrigger( zEreignis->getThis(), zSpiel ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-GeschossNeu::GeschossNeu( Aktion *x, Aktion *y, Aktion *typ, Aktion *richtung )
|
|
|
- : Aktion( GESCHOSS_NEU )
|
|
|
+TriggerSetEnabled::TriggerSetEnabled( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TRIGGER_SET_ENABLED, subActions )
|
|
|
{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->typ = typ;
|
|
|
- this->richtung = richtung;
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( TRIGGER );
|
|
|
}
|
|
|
|
|
|
-GeschossNeu::~GeschossNeu()
|
|
|
+TriggerSetEnabled::~TriggerSetEnabled()
|
|
|
+{}
|
|
|
+
|
|
|
+void TriggerSetEnabled::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- typ->release();
|
|
|
- richtung->release();
|
|
|
+ ( (Trigger *)zEvaluatedParam( 1, zMemory, zPC ) )->setAktiv( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-bool GeschossNeu::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+TeamSetPunkte::TeamSetPunkte( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TEAM_SET_PUNKTE, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( y->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( typ->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS_TYP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R2__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 3 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( richtung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != RICHTUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- Geschoss *g = new Geschoss( zSpiel->getNextId(), 0,
|
|
|
- getGeschossTypFromString( ( (String *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() ),
|
|
|
- getRichtungFromString( ( (String *)t )->getValue() ),
|
|
|
- ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue(),
|
|
|
- ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue(), 0 );
|
|
|
- zSpiel->addGeschoss( (Geschoss *)g->getThis() );
|
|
|
- zMemory->setVar( "__return__", g );
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( TEAM );
|
|
|
}
|
|
|
|
|
|
+TeamSetPunkte::~TeamSetPunkte()
|
|
|
+{}
|
|
|
|
|
|
-GeschossSetSpeed::GeschossSetSpeed( Aktion *speed, Aktion *geschoss )
|
|
|
- : Aktion( GESCHOSS_SET_SPEED )
|
|
|
+void TeamSetPunkte::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->speed = speed;
|
|
|
- this->geschoss = geschoss;
|
|
|
+ ( (Team *)zEvaluatedParam( 1, zMemory, zPC ) )->setPunkte( ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-GeschossSetSpeed::~GeschossSetSpeed()
|
|
|
+
|
|
|
+TimerSetPause::TimerSetPause( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TIMER_SET_PAUSE, subActions )
|
|
|
{
|
|
|
- speed->release();
|
|
|
- geschoss->release();
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( TIMER );
|
|
|
}
|
|
|
|
|
|
-bool GeschossSetSpeed::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+TimerSetPause::~TimerSetPause()
|
|
|
+{}
|
|
|
+
|
|
|
+void TimerSetPause::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( speed->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( geschoss->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Geschoss *)t )->setSpeed( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Timer *)zEvaluatedParam( 1, zMemory, zPC ) )->setPause( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
|
|
|
-GeschossSetPlayer::GeschossSetPlayer( Aktion *player, Aktion *geschoss )
|
|
|
- : Aktion( GESCHOSS_SET_PLAYER )
|
|
|
+TimerStart::TimerStart( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TIMER_START, subActions )
|
|
|
{
|
|
|
- this->player = player;
|
|
|
- this->geschoss = geschoss;
|
|
|
+ erlaubteTypen.add( TIMER );
|
|
|
}
|
|
|
|
|
|
-GeschossSetPlayer::~GeschossSetPlayer()
|
|
|
+TimerStart::~TimerStart()
|
|
|
+{}
|
|
|
+
|
|
|
+void TimerStart::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- player->release();
|
|
|
- geschoss->release();
|
|
|
+ ( (Timer *)zEvaluatedParam( 0, zMemory, zPC ) )->start( zSpiel );
|
|
|
}
|
|
|
|
|
|
-bool GeschossSetPlayer::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+
|
|
|
+TimerSetZeit::TimerSetZeit( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TIMER_SET_ZEIT, subActions )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( player->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( geschoss->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Geschoss *)t )->setBesitzer( ( (Spieler *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( TIMER );
|
|
|
}
|
|
|
|
|
|
+TimerSetZeit::~TimerSetZeit()
|
|
|
+{}
|
|
|
|
|
|
-GeschossSetRichtung::GeschossSetRichtung( Aktion *richtung, Aktion *geschoss )
|
|
|
- : Aktion( GESCHOSS_SET_RICHTUNG )
|
|
|
+void TimerSetZeit::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->richtung = richtung;
|
|
|
- this->geschoss = geschoss;
|
|
|
+ ( (Timer *)zEvaluatedParam( 1, zMemory, zPC ) )->setZeit( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
}
|
|
|
|
|
|
-GeschossSetRichtung::~GeschossSetRichtung()
|
|
|
+
|
|
|
+TimerSetSichtbar::TimerSetSichtbar( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( TIMER_SET_SICHTBAR, subActions )
|
|
|
{
|
|
|
- richtung->release();
|
|
|
- geschoss->release();
|
|
|
+ erlaubteTypen.add( BOOLEAN );
|
|
|
+ erlaubteTypen.add( TIMER );
|
|
|
}
|
|
|
|
|
|
-bool GeschossSetRichtung::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+TimerSetSichtbar::~TimerSetSichtbar()
|
|
|
+{}
|
|
|
+
|
|
|
+void TimerSetSichtbar::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( richtung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != RICHTUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( geschoss->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Geschoss *)t )->setRichtung( getRichtungFromString( ( (String *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Timer *)zEvaluatedParam( 1, zMemory, zPC ) )->setSichtbar( ( (Boolean *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossNeu::GeschossNeu( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GESCHOSS_NEU, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( GESCHOSS_TYP );
|
|
|
+ erlaubteTypen.add( RICHTUNG );
|
|
|
+}
|
|
|
+
|
|
|
+GeschossNeu::~GeschossNeu()
|
|
|
+{}
|
|
|
+
|
|
|
+void GeschossNeu::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ Geschoss *g = new Geschoss( zSpiel->getNextId(), 0,
|
|
|
+ getGeschossTypFromString( ( (String *)zEvaluatedParam( 2, zMemory, zPC ) )->getValue() ),
|
|
|
+ getRichtungFromString( ( (String *)zEvaluatedParam( 3, zMemory, zPC ) )->getValue() ),
|
|
|
+ ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue(),
|
|
|
+ ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue(), 0 );
|
|
|
+ zSpiel->addGeschoss( (Geschoss *)g->getThis() );
|
|
|
+ zMemory->setVar( "__return__", g );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetSpeed::GeschossSetSpeed( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GESCHOSS_SET_SPEED, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( FLOAT );
|
|
|
+ erlaubteTypen.add( GESCHOSS );
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetSpeed::~GeschossSetSpeed()
|
|
|
+{}
|
|
|
+
|
|
|
+void GeschossSetSpeed::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ ( (Geschoss *)zEvaluatedParam( 1, zMemory, zPC ) )->setSpeed( ( (Float *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetPlayer::GeschossSetPlayer( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GESCHOSS_SET_PLAYER, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
+ erlaubteTypen.add( GESCHOSS );
|
|
|
}
|
|
|
|
|
|
+GeschossSetPlayer::~GeschossSetPlayer()
|
|
|
+{}
|
|
|
|
|
|
-GeschossSetType::GeschossSetType( Aktion *type, Aktion *geschoss )
|
|
|
- : Aktion( GESCHOSS_SET_TYPE )
|
|
|
+void GeschossSetPlayer::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- this->type = type;
|
|
|
- this->geschoss = geschoss;
|
|
|
+ ( (Geschoss *)zEvaluatedParam( 1, zMemory, zPC ) )->setBesitzer( ( (Spieler *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
}
|
|
|
|
|
|
-GeschossSetType::~GeschossSetType()
|
|
|
+
|
|
|
+GeschossSetRichtung::GeschossSetRichtung( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GESCHOSS_SET_RICHTUNG, subActions )
|
|
|
{
|
|
|
- type->release();
|
|
|
- geschoss->release();
|
|
|
+ erlaubteTypen.add( RICHTUNG );
|
|
|
+ erlaubteTypen.add( GESCHOSS );
|
|
|
}
|
|
|
|
|
|
-bool GeschossSetType::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+GeschossSetRichtung::~GeschossSetRichtung()
|
|
|
+{}
|
|
|
+
|
|
|
+void GeschossSetRichtung::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( type->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS_TYP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( geschoss->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Geschoss *)t )->setTyp( getGeschossTypFromString( ( (String *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ ( (Geschoss *)zEvaluatedParam( 1, zMemory, zPC ) )->setRichtung( getRichtungFromString( ( (String *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() ) );
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetType::GeschossSetType( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( GESCHOSS_SET_TYPE, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( GESCHOSS_TYP );
|
|
|
+ erlaubteTypen.add( GESCHOSS );
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetType::~GeschossSetType()
|
|
|
+{}
|
|
|
+
|
|
|
+void GeschossSetType::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ ( (Geschoss *)zEvaluatedParam( 1, zMemory, zPC ) )->setTyp( getGeschossTypFromString( ( (String *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
TriggerZufall::TriggerZufall()
|
|
|
- : Aktion( TRIGGER_ZUFALL )
|
|
|
+ : Aktion( TRIGGER_ZUFALL, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool TriggerZufall::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void TriggerZufall::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getRandomTrigger() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
TriggerLastRunned::TriggerLastRunned()
|
|
|
- : Aktion( TRIGGER_LAST_RUNNED )
|
|
|
+ : Aktion( TRIGGER_LAST_RUNNED, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool TriggerLastRunned::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void TriggerLastRunned::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getLastRunnedTrigger() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BariereZufall::BariereZufall()
|
|
|
- : Aktion( BARIERE_ZUFALL )
|
|
|
+ : Aktion( BARIERE_ZUFALL, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BariereZufall::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BariereZufall::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getRandomBariere() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BariereZuletztEingeschaltet::BariereZuletztEingeschaltet()
|
|
|
- : Aktion( BARIERE_ZULETZT_EINGESCHALTET )
|
|
|
+ : Aktion( BARIERE_ZULETZT_EINGESCHALTET, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BariereZuletztEingeschaltet::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BariereZuletztEingeschaltet::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getZuletztEingeschalteteBariere() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BariereZuletztAusgeschaltet::BariereZuletztAusgeschaltet()
|
|
|
- : Aktion( BARIERE_ZULETZT_AUSGESCHALTET )
|
|
|
+ : Aktion( BARIERE_ZULETZT_AUSGESCHALTET, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BariereZuletztAusgeschaltet::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BariereZuletztAusgeschaltet::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getZuletztAusgeschalteteBariere() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BariereZuletztBewegt::BariereZuletztBewegt()
|
|
|
- : Aktion( BARIERE_ZULETZT_BEWEGT )
|
|
|
+ : Aktion( BARIERE_ZULETZT_BEWEGT, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BariereZuletztBewegt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BariereZuletztBewegt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getZuletztBewegteBariere() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BaseZufall::BaseZufall()
|
|
|
- : Aktion( BASE_ZUFALL )
|
|
|
+ : Aktion( BASE_ZUFALL, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BaseZufall::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BaseZufall::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getRandomBase() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
BaseZuletztBesitzerGewechselt::BaseZuletztBesitzerGewechselt()
|
|
|
- : Aktion( BASE_ZULETZT_BESITZER_GEWECHSELT )
|
|
|
+ : Aktion( BASE_ZULETZT_BESITZER_GEWECHSELT, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool BaseZuletztBesitzerGewechselt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void BaseZuletztBesitzerGewechselt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getLastTeamChangedBase() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
DropZufall::DropZufall()
|
|
|
- : Aktion( DROP_ZUFALL )
|
|
|
+ : Aktion( DROP_ZUFALL, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool DropZufall::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void DropZufall::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getRandomDrop() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
DropZuletztGedropt::DropZuletztGedropt()
|
|
|
- : Aktion( DROP_ZULETZT_GEDROPT )
|
|
|
+ : Aktion( DROP_ZULETZT_GEDROPT, new RCArray< Aktion >() )
|
|
|
{}
|
|
|
|
|
|
-bool DropZuletztGedropt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void DropZuletztGedropt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zMemory->setVar( "__return__", zSpiel->getLastDrop() );
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerRechnen::IntegerRechnen( Aktion *left, Aktion *right, Operator op )
|
|
|
- : Aktion( INTEGER_RECHNEN )
|
|
|
+IntegerRechnen::IntegerRechnen( RCArray< Aktion > *subActions, Operator op )
|
|
|
+ : Aktion( INTEGER_RECHNEN, subActions )
|
|
|
{
|
|
|
- this->left = left;
|
|
|
- this->right = right;
|
|
|
- this->op = op;
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
}
|
|
|
|
|
|
IntegerRechnen::~IntegerRechnen()
|
|
|
-{
|
|
|
- left->release();
|
|
|
- if( right )
|
|
|
- right->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool IntegerRechnen::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
-{
|
|
|
- zPC->stepIn();
|
|
|
- bool finished = 0;
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( left->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- if( !isBinary( op ) )
|
|
|
- finished = 1;
|
|
|
- else
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( right->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R1__", t->getThis() );
|
|
|
- finished = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- if( finished )
|
|
|
- {
|
|
|
- Integer *l = (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" );
|
|
|
- Integer *r = (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R1__" );
|
|
|
- switch( op )
|
|
|
- {
|
|
|
- case PLUS:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() + r->getValue() ) );
|
|
|
- break;
|
|
|
- case MINUS:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() - r->getValue() ) );
|
|
|
- break;
|
|
|
- case MAHL:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() * r->getValue() ) );
|
|
|
- break;
|
|
|
- case GETEILT:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() / r->getValue() ) );
|
|
|
- break;
|
|
|
- case HOCH:
|
|
|
- zMemory->setVar( "__return__", new Integer( (int)pow( l->getValue(), r->getValue() ) ) );
|
|
|
- break;
|
|
|
- case WURZEL:
|
|
|
- zMemory->setVar( "__return__", new Integer( (int)pow( l->getValue(), 1.0 / r->getValue() ) ) );
|
|
|
- break;
|
|
|
- case BIT_ODER:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() | r->getValue() ) );
|
|
|
- break;
|
|
|
- case BIT_UND:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() & r->getValue() ) );
|
|
|
- break;
|
|
|
- case BIT_XOR:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() ^ r->getValue() ) );
|
|
|
- break;
|
|
|
- case BIT_FLIP:
|
|
|
- zMemory->setVar( "__return__", new Integer( ~l->getValue() ) );
|
|
|
- break;
|
|
|
- case BIT_SHIFT_LEFT:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() << r->getValue() ) );
|
|
|
- break;
|
|
|
- case BIT_SHIFT_RIGHT:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() >> r->getValue() ) );
|
|
|
- break;
|
|
|
- case INVERT_SIGN:
|
|
|
- zMemory->setVar( "__return__", new Integer( -l->getValue() ) );
|
|
|
- break;
|
|
|
- case PLUS_PLUS_LEFT:
|
|
|
- l->setValue( l->getValue() + 1 );
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() ) );
|
|
|
- break;
|
|
|
- case PLUS_PLUS_RIGHT:
|
|
|
- {
|
|
|
- int tmp = l->getValue();
|
|
|
- l->setValue( l->getValue() + 1 );
|
|
|
- zMemory->setVar( "__return__", new Integer( tmp ) );
|
|
|
- break;
|
|
|
- }
|
|
|
- case MINUS_MINUS_LEFT:
|
|
|
- l->setValue( l->getValue() - 1 );
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() ) );
|
|
|
- break;
|
|
|
- case MINUS_MINUS_RIGHT:
|
|
|
- {
|
|
|
- int tmp = l->getValue();
|
|
|
- l->setValue( l->getValue() - 1 );
|
|
|
- zMemory->setVar( "__return__", new Integer( tmp ) );
|
|
|
- break;
|
|
|
- }
|
|
|
- case LOGARITHM:
|
|
|
- zMemory->setVar( "__return__", new Integer( (int)( log( l->getValue() ) / log( r->getValue() ) ) ) );
|
|
|
- break;
|
|
|
- case MODULO:
|
|
|
- zMemory->setVar( "__return__", new Integer( l->getValue() % r->getValue() ) );
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
+{}
|
|
|
|
|
|
-IntegerZufall::IntegerZufall( Aktion *min, Aktion *max )
|
|
|
- : Aktion( INTEGER_ZUFALL )
|
|
|
-{
|
|
|
- this->min = 0;
|
|
|
- this->max = 0;
|
|
|
+void IntegerRechnen::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ Integer *l = (Integer *)zEvaluatedParam( 0, zMemory, zPC );
|
|
|
+ Integer *r = (Integer *)zEvaluatedParam( 1, zMemory, zPC );
|
|
|
+ switch( op )
|
|
|
+ {
|
|
|
+ case PLUS:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() + r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case MINUS:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() - r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case MAHL:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() * r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case GETEILT:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() / r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case HOCH:
|
|
|
+ zMemory->setVar( "__return__", new Integer( (int)pow( l->getValue(), r->getValue() ) ) );
|
|
|
+ break;
|
|
|
+ case WURZEL:
|
|
|
+ zMemory->setVar( "__return__", new Integer( (int)pow( l->getValue(), 1.0 / r->getValue() ) ) );
|
|
|
+ break;
|
|
|
+ case BIT_ODER:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() | r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case BIT_UND:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() & r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case BIT_XOR:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() ^ r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case BIT_FLIP:
|
|
|
+ zMemory->setVar( "__return__", new Integer( ~l->getValue() ) );
|
|
|
+ break;
|
|
|
+ case BIT_SHIFT_LEFT:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() << r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case BIT_SHIFT_RIGHT:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() >> r->getValue() ) );
|
|
|
+ break;
|
|
|
+ case INVERT_SIGN:
|
|
|
+ zMemory->setVar( "__return__", new Integer( -l->getValue() ) );
|
|
|
+ break;
|
|
|
+ case PLUS_PLUS_LEFT:
|
|
|
+ l->setValue( l->getValue() + 1 );
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() ) );
|
|
|
+ break;
|
|
|
+ case PLUS_PLUS_RIGHT:
|
|
|
+ {
|
|
|
+ int tmp = l->getValue();
|
|
|
+ l->setValue( l->getValue() + 1 );
|
|
|
+ zMemory->setVar( "__return__", new Integer( tmp ) );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case MINUS_MINUS_LEFT:
|
|
|
+ l->setValue( l->getValue() - 1 );
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() ) );
|
|
|
+ break;
|
|
|
+ case MINUS_MINUS_RIGHT:
|
|
|
+ {
|
|
|
+ int tmp = l->getValue();
|
|
|
+ l->setValue( l->getValue() - 1 );
|
|
|
+ zMemory->setVar( "__return__", new Integer( tmp ) );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case LOGARITHM:
|
|
|
+ zMemory->setVar( "__return__", new Integer( (int)( log( l->getValue() ) / log( r->getValue() ) ) ) );
|
|
|
+ break;
|
|
|
+ case MODULO:
|
|
|
+ zMemory->setVar( "__return__", new Integer( l->getValue() % r->getValue() ) );
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+IntegerZufall::IntegerZufall( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_ZUFALL, subActions )
|
|
|
+{
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
+ erlaubteTypen.add( INTEGER );
|
|
|
}
|
|
|
|
|
|
IntegerZufall::~IntegerZufall()
|
|
|
-{
|
|
|
- min->release();
|
|
|
- max->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerZufall::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerZufall::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- zPC->stepIn();
|
|
|
- if( zPC->currentPosition() == 0 )
|
|
|
- {
|
|
|
- if( min->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( zPC->getUniqueString() + "R0__", t->getThis() );
|
|
|
- zPC->count();
|
|
|
- }
|
|
|
- }
|
|
|
- if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
- {
|
|
|
- if( max->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != INTEGER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- int mi = ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue();
|
|
|
- int ma = ( (Integer *)t )->getValue();
|
|
|
- zMemory->setVar( "__return__", new Integer( (int)( zSpiel->getRand() * ( ma - mi ) + mi ) ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
+ int mi = ( (Integer *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue();
|
|
|
+ int ma = ( (Integer *)zEvaluatedParam( 1, zMemory, zPC ) )->getValue();
|
|
|
+ zMemory->setVar( "__return__", new Integer( (int)( zSpiel->getRand() * ( ma - mi ) + mi ) ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerAusText::IntegerAusText( Aktion *text )
|
|
|
- : Aktion( INTEGER_AUS_TEXT )
|
|
|
+IntegerAusText::IntegerAusText( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_AUS_TEXT, subActions )
|
|
|
{
|
|
|
- this->text = text;
|
|
|
+ erlaubteTypen.add( STRING );
|
|
|
}
|
|
|
|
|
|
IntegerAusText::~IntegerAusText()
|
|
|
-{
|
|
|
- this->text->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerAusText::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerAusText::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( text->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != STRING )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (String *)t )->getValue() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (String *)zEvaluatedParam( 0, zMemory, zPC ) )->getValue() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-FloatXVonGameObjekt::FloatXVonGameObjekt( Aktion *objekt )
|
|
|
- : Aktion( FLOAT_X_VON_GAME_OBJEKT )
|
|
|
+FloatXVonGameObjekt::FloatXVonGameObjekt( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( FLOAT_X_VON_GAME_OBJEKT, subActions )
|
|
|
{
|
|
|
- this->objekt = objekt;
|
|
|
+ erlaubteTypen.add( GAME_OBJEKT );
|
|
|
}
|
|
|
|
|
|
FloatXVonGameObjekt::~FloatXVonGameObjekt()
|
|
|
-{
|
|
|
- objekt->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool FloatXVonGameObjekt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void FloatXVonGameObjekt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( objekt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GAME_OBJEKT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Float( ( (GameObject *)t )->getX() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Float( ( (GameObject *)zEvaluatedParam( 0, zMemory, zPC ) )->getX() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-FloatYVonGameObjekt::FloatYVonGameObjekt( Aktion *objekt )
|
|
|
- : Aktion( FLOAT_Y_VON_GAME_OBJEKT )
|
|
|
+FloatYVonGameObjekt::FloatYVonGameObjekt( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( FLOAT_Y_VON_GAME_OBJEKT, subActions )
|
|
|
{
|
|
|
- this->objekt = objekt;
|
|
|
+ erlaubteTypen.add( GAME_OBJEKT );
|
|
|
}
|
|
|
|
|
|
FloatYVonGameObjekt::~FloatYVonGameObjekt()
|
|
|
-{
|
|
|
- objekt->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool FloatYVonGameObjekt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void FloatYVonGameObjekt::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( objekt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GAME_OBJEKT )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Float( ( (GameObject *)t )->getY() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Float( ( (GameObject *)zEvaluatedParam( 0, zMemory, zPC ) )->getY() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerXVonTunnelZiel::IntegerXVonTunnelZiel( Aktion *tunnel )
|
|
|
- : Aktion( INTEGER_X_VON_TUNNEL_ZIEL )
|
|
|
+IntegerXVonTunnelZiel::IntegerXVonTunnelZiel( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_X_VON_TUNNEL_ZIEL, subActions )
|
|
|
{
|
|
|
- this->tunnel = tunnel;
|
|
|
+ erlaubteTypen.add( TUNNEL );
|
|
|
}
|
|
|
|
|
|
IntegerXVonTunnelZiel::~IntegerXVonTunnelZiel()
|
|
|
-{
|
|
|
- tunnel->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerXVonTunnelZiel::runNext( Spiel * zSpiel, Ereignis * zEreignis, LocalMemory * zMemory, ProgramCounter * zPC, double &waitCount )
|
|
|
+void IntegerXVonTunnelZiel::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( tunnel->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TUNNEL )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Tunnel *)t )->getZielX() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Tunnel *)zEvaluatedParam( 0, zMemory, zPC ) )->getZielX() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerYVonTunnelZiel::IntegerYVonTunnelZiel( Aktion *tunnel )
|
|
|
- : Aktion( INTEGER_Y_VON_TUNNEL_ZIEL )
|
|
|
+IntegerYVonTunnelZiel::IntegerYVonTunnelZiel( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_Y_VON_TUNNEL_ZIEL, subActions )
|
|
|
{
|
|
|
- this->tunnel = tunnel;
|
|
|
+ erlaubteTypen.add( TUNNEL );
|
|
|
}
|
|
|
|
|
|
IntegerYVonTunnelZiel::~IntegerYVonTunnelZiel()
|
|
|
-{
|
|
|
- tunnel->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerYVonTunnelZiel::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerYVonTunnelZiel::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( tunnel->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TUNNEL )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Tunnel *)t )->getZielY() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Tunnel *)zEvaluatedParam( 0, zMemory, zPC ) )->getZielY() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerMinXVonDrop::IntegerMinXVonDrop( Aktion *drop )
|
|
|
- : Aktion( INTEGER_MIN_X_VON_DROP )
|
|
|
+IntegerMinXVonDrop::IntegerMinXVonDrop( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_MIN_X_VON_DROP, subActions )
|
|
|
{
|
|
|
- this->drop = drop;
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
IntegerMinXVonDrop::~IntegerMinXVonDrop()
|
|
|
-{
|
|
|
- drop->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerMinXVonDrop::runNext( Spiel * zSpiel, Ereignis * zEreignis, LocalMemory * zMemory, ProgramCounter * zPC, double &waitCount )
|
|
|
+void IntegerMinXVonDrop::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Drop *)t )->getMinX() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Drop *)zEvaluatedParam( 0, zMemory, zPC ) )->getMinX() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerMinYVonDrop::IntegerMinYVonDrop( Aktion *drop )
|
|
|
- : Aktion( INTEGER_MIN_Y_VON_DROP )
|
|
|
+IntegerMinYVonDrop::IntegerMinYVonDrop( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_MIN_Y_VON_DROP, subActions )
|
|
|
{
|
|
|
- this->drop = drop;
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
IntegerMinYVonDrop::~IntegerMinYVonDrop()
|
|
|
-{
|
|
|
- drop->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerMinYVonDrop::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerMinYVonDrop::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Drop *)t )->getMinY() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Drop *)zEvaluatedParam( 0, zMemory, zPC ) )->getMinY() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerMaxXVonDrop::IntegerMaxXVonDrop( Aktion *drop )
|
|
|
- : Aktion( INTEGER_MAX_X_VON_DROP )
|
|
|
+IntegerMaxXVonDrop::IntegerMaxXVonDrop( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_MAX_X_VON_DROP, subActions )
|
|
|
{
|
|
|
- this->drop = drop;
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
IntegerMaxXVonDrop::~IntegerMaxXVonDrop()
|
|
|
-{
|
|
|
- drop->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerMaxXVonDrop::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerMaxXVonDrop::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Drop *)t )->getMaxX() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Drop *)zEvaluatedParam( 0, zMemory, zPC ) )->getMaxX() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerMaxYVonDrop::IntegerMaxYVonDrop( Aktion *drop )
|
|
|
- : Aktion( INTEGER_MAX_Y_VON_DROP )
|
|
|
+IntegerMaxYVonDrop::IntegerMaxYVonDrop( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_MAX_Y_VON_DROP, subActions )
|
|
|
{
|
|
|
- this->drop = drop;
|
|
|
+ erlaubteTypen.add( DROP );
|
|
|
}
|
|
|
|
|
|
IntegerMaxYVonDrop::~IntegerMaxYVonDrop()
|
|
|
-{
|
|
|
- drop->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerMaxYVonDrop::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void IntegerMaxYVonDrop::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( drop->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != DROP )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Drop *)t )->getMaxY() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Drop *)zEvaluatedParam( 0, zMemory, zPC ) )->getMaxY() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-IntegerSpielerLevel::IntegerSpielerLevel( Aktion *spieler )
|
|
|
- : Aktion( INTEGER_SPIELER_LEVEL )
|
|
|
+IntegerSpielerLevel::IntegerSpielerLevel( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( INTEGER_SPIELER_LEVEL, subActions )
|
|
|
{
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
IntegerSpielerLevel::~IntegerSpielerLevel()
|
|
|
-{
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool IntegerSpielerLevel::runNext( Spiel * zSpiel, Ereignis * zEreignis, LocalMemory * zMemory, ProgramCounter * zPC, double &waitCount )
|
|
|
+void IntegerSpielerLevel::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Integer( ( (Spieler *)t )->getLevel() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Integer( ( (Spieler *)zEvaluatedParam( 0, zMemory, zPC ) )->getLevel() ) );
|
|
|
}
|
|
|
|
|
|
|
|
|
-FloatSpielerLeben::FloatSpielerLeben( Aktion *spieler )
|
|
|
- : Aktion( FLOAT_SPIELER_LEBEN )
|
|
|
+FloatSpielerLeben::FloatSpielerLeben( RCArray< Aktion > *subActions )
|
|
|
+ : Aktion( FLOAT_SPIELER_LEBEN, subActions )
|
|
|
{
|
|
|
- this->spieler = spieler;
|
|
|
+ erlaubteTypen.add( SPIELER );
|
|
|
}
|
|
|
|
|
|
FloatSpielerLeben::~FloatSpielerLeben()
|
|
|
-{
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
+{}
|
|
|
|
|
|
-bool FloatSpielerLeben::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+void FloatSpielerLeben::run( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
- if( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- zMemory->setVar( "__return__", new Float( ( (Spieler *)t )->getLeben() ) );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- return 0;
|
|
|
+ zMemory->setVar( "__return__", new Float( ( (Spieler *)zEvaluatedParam( 0, zMemory, zPC ) )->getLeben() ) );
|
|
|
}
|