|
@@ -663,73 +663,6 @@ bool SpielerRemoveItem::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory
|
|
|
}
|
|
|
|
|
|
|
|
|
-SpielerSetPosition::SpielerSetPosition( Aktion *x, Aktion *y, Aktion *spieler )
|
|
|
- : Aktion( SPIELER_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->spieler = spieler;
|
|
|
-}
|
|
|
-
|
|
|
-SpielerSetPosition::~SpielerSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- spieler->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool SpielerSetPosition::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( spieler->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SPIELER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Spieler *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Spieler *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
SpielerSetLeben::SpielerSetLeben( Aktion *leben, Aktion *spieler )
|
|
|
: Aktion( SPIELER_SET_LEBEN )
|
|
|
{
|
|
@@ -1582,22 +1515,22 @@ bool BariereSetEingeschaltet::runNext( Spiel *zSpiel, Ereignis *zEreignis, Local
|
|
|
}
|
|
|
|
|
|
|
|
|
-BariereSetPosition::BariereSetPosition( Aktion *x, Aktion *y, Aktion *bariere )
|
|
|
- : Aktion( BARIERE_SET_POSITION )
|
|
|
+GameObjektSetPosition::GameObjektSetPosition( Aktion *x, Aktion *y, Aktion *objekt )
|
|
|
+ : Aktion( GAME_OBJEKT_SET_POSITION )
|
|
|
{
|
|
|
this->x = x;
|
|
|
this->y = y;
|
|
|
- this->bariere = bariere;
|
|
|
+ this->objekt = objekt;
|
|
|
}
|
|
|
|
|
|
-BariereSetPosition::~BariereSetPosition()
|
|
|
+GameObjektSetPosition::~GameObjektSetPosition()
|
|
|
{
|
|
|
x->release();
|
|
|
y->release();
|
|
|
- bariere->release();
|
|
|
+ objekt->release();
|
|
|
}
|
|
|
|
|
|
-bool BariereSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+bool GameObjektSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
{
|
|
|
zPC->stepIn();
|
|
|
if( zPC->currentPosition() == 0 )
|
|
@@ -1630,7 +1563,7 @@ bool BariereSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemor
|
|
|
}
|
|
|
if( zPC->currentPosition() == 2 && waitCount <= 0 )
|
|
|
{
|
|
|
- if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ if( objekt->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
if( !t || t->getVariableTyp() != BARIERE )
|
|
@@ -1638,8 +1571,8 @@ bool BariereSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemor
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Bariere *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Bariere *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
+ ( (GameObject *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (GameObject *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -1649,28 +1582,30 @@ bool BariereSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemor
|
|
|
}
|
|
|
|
|
|
|
|
|
-BariereSetTeam::BariereSetTeam( Aktion *team, Aktion *bariere )
|
|
|
- : Aktion( BARIERE_SET_TEAM )
|
|
|
+GameObjektSetSize::GameObjektSetSize( Aktion *x, Aktion *y, Aktion *objekt )
|
|
|
+ : Aktion( GAME_OBJEKT_SET_SIZE )
|
|
|
{
|
|
|
- this->team = team;
|
|
|
- this->bariere = bariere;
|
|
|
+ this->x = x;
|
|
|
+ this->y = y;
|
|
|
+ this->objekt = objekt;
|
|
|
}
|
|
|
|
|
|
-BariereSetTeam::~BariereSetTeam()
|
|
|
+GameObjektSetSize::~GameObjektSetSize()
|
|
|
{
|
|
|
- team->release();
|
|
|
- bariere->release();
|
|
|
+ x->release();
|
|
|
+ y->release();
|
|
|
+ objekt->release();
|
|
|
}
|
|
|
|
|
|
-bool BariereSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+bool GameObjektSetSize::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 ) )
|
|
|
+ if( x->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TEAM )
|
|
|
+ if( !t || t->getVariableTyp() != FLOAT )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
@@ -1681,7 +1616,21 @@ bool BariereSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *z
|
|
|
}
|
|
|
if( zPC->currentPosition() == 1 && waitCount <= 0 )
|
|
|
{
|
|
|
- if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ 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 )
|
|
@@ -1689,7 +1638,8 @@ bool BariereSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *z
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Bariere *)t )->setTeam( ( (Team *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
+ ( (GameObject *)t )->setWidth( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (GameObject *)t )->setHeight( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -1699,30 +1649,28 @@ bool BariereSetTeam::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *z
|
|
|
}
|
|
|
|
|
|
|
|
|
-SchalterSetPosition::SchalterSetPosition( Aktion *x, Aktion *y, Aktion *schalter )
|
|
|
- : Aktion( SCHALTER_SET_POSITION )
|
|
|
+BariereSetTeam::BariereSetTeam( Aktion *team, Aktion *bariere )
|
|
|
+ : Aktion( BARIERE_SET_TEAM )
|
|
|
{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->schalter = schalter;
|
|
|
+ this->team = team;
|
|
|
+ this->bariere = bariere;
|
|
|
}
|
|
|
|
|
|
-SchalterSetPosition::~SchalterSetPosition()
|
|
|
+BariereSetTeam::~BariereSetTeam()
|
|
|
{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- schalter->release();
|
|
|
+ team->release();
|
|
|
+ bariere->release();
|
|
|
}
|
|
|
|
|
|
-bool SchalterSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+bool BariereSetTeam::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 ) )
|
|
|
+ if( team->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != FLOAT )
|
|
|
+ if( !t || t->getVariableTyp() != TEAM )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
@@ -1733,30 +1681,15 @@ bool SchalterSetPosition::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemo
|
|
|
}
|
|
|
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( schalter->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
+ if( bariere->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
{
|
|
|
Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != SCHALTER )
|
|
|
+ if( !t || t->getVariableTyp() != BARIERE )
|
|
|
{
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Schalter *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Schalter *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
+ ( (Bariere *)t )->setTeam( ( (Team *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) ) );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -1844,73 +1777,6 @@ bool SchalterAktivieren::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemor
|
|
|
}
|
|
|
|
|
|
|
|
|
-TunnelSetPosition::TunnelSetPosition( Aktion *x, Aktion *y, Aktion *tunnel )
|
|
|
- : Aktion( TUNNEL_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->tunnel = tunnel;
|
|
|
-}
|
|
|
-
|
|
|
-TunnelSetPosition::~TunnelSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- tunnel->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool TunnelSetPosition::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( tunnel->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TUNNEL )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Tunnel *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Tunnel *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
TunnelSetZielPosition::TunnelSetZielPosition( Aktion *x, Aktion *y, Aktion *tunnel )
|
|
|
: Aktion( TUNNEL_SET_ZIEL_POSITION )
|
|
|
{
|
|
@@ -2028,73 +1894,6 @@ bool TunnelSetErlaubt::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory
|
|
|
}
|
|
|
|
|
|
|
|
|
-UmlenkungSetPosition::UmlenkungSetPosition( Aktion *x, Aktion *y, Aktion *umlenkung )
|
|
|
- : Aktion( UMLENKUNG_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->umlenkung = umlenkung;
|
|
|
-}
|
|
|
-
|
|
|
-UmlenkungSetPosition::~UmlenkungSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- umlenkung->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool UmlenkungSetPosition::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( umlenkung->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != UMLENKUNG )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Umlenkung *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Umlenkung *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
UmlenkungSetRichtung::UmlenkungSetRichtung( Aktion *richtung, Aktion *umlenkung )
|
|
|
: Aktion( UMLENKUNG_SET_RICHTUNG )
|
|
|
{
|
|
@@ -2245,73 +2044,6 @@ bool UmlenkungSetEnabled::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemo
|
|
|
}
|
|
|
|
|
|
|
|
|
-BaseSetPosition::BaseSetPosition( Aktion *x, Aktion *y, Aktion *base )
|
|
|
- : Aktion( BASE_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->base = base;
|
|
|
-}
|
|
|
-
|
|
|
-BaseSetPosition::~BaseSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- base->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool BaseSetPosition::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( base->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != BASE )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Base *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Base *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
BaseSetTeam::BaseSetTeam( Aktion *team, Aktion *base )
|
|
|
: Aktion( BASE_SET_TEAM )
|
|
|
{
|
|
@@ -2490,73 +2222,6 @@ bool TeamSetPunkte::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
}
|
|
|
|
|
|
|
|
|
-TimerSetPosition::TimerSetPosition( Aktion *x, Aktion *y, Aktion *timer )
|
|
|
- : Aktion( TIMER_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->timer = timer;
|
|
|
-}
|
|
|
-
|
|
|
-TimerSetPosition::~TimerSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- timer->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool TimerSetPosition::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( timer->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != TIMER )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Timer *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Timer *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
TimerSetPause::TimerSetPause( Aktion *pause, Aktion *timer )
|
|
|
: Aktion( TIMER_SET_PAUSE )
|
|
|
{
|
|
@@ -2823,73 +2488,6 @@ bool GeschossNeu::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMem
|
|
|
}
|
|
|
|
|
|
|
|
|
-GeschossSetPosition::GeschossSetPosition( Aktion *x, Aktion *y, Aktion *geschoss )
|
|
|
- : Aktion( GESCHOSS_SET_POSITION )
|
|
|
-{
|
|
|
- this->x = x;
|
|
|
- this->y = y;
|
|
|
- this->geschoss = geschoss;
|
|
|
-}
|
|
|
-
|
|
|
-GeschossSetPosition::~GeschossSetPosition()
|
|
|
-{
|
|
|
- x->release();
|
|
|
- y->release();
|
|
|
- geschoss->release();
|
|
|
-}
|
|
|
-
|
|
|
-bool GeschossSetPosition::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( geschoss->runNext( zSpiel, zEreignis, zMemory, zPC, waitCount ) )
|
|
|
- {
|
|
|
- Variable *t = zMemory->zVariable( "__return__" );
|
|
|
- if( !t || t->getVariableTyp() != GESCHOSS )
|
|
|
- {
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- ( (Geschoss *)t )->setX( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
- ( (Geschoss *)t )->setY( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R1__" ) )->getValue() );
|
|
|
- zPC->stepOut();
|
|
|
- return 1;
|
|
|
- }
|
|
|
- }
|
|
|
- zPC->stepOut();
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
GeschossSetSpeed::GeschossSetSpeed( Aktion *speed, Aktion *geschoss )
|
|
|
: Aktion( GESCHOSS_SET_SPEED )
|
|
|
{
|
|
@@ -3211,7 +2809,8 @@ IntegerRechnen::IntegerRechnen( Aktion *left, Aktion *right, Operator op )
|
|
|
IntegerRechnen::~IntegerRechnen()
|
|
|
{
|
|
|
left->release();
|
|
|
- right->release();
|
|
|
+ if( right )
|
|
|
+ right->release();
|
|
|
}
|
|
|
|
|
|
bool IntegerRechnen::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
@@ -3317,11 +2916,13 @@ bool IntegerRechnen::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *z
|
|
|
break;
|
|
|
}
|
|
|
case LOGARITHM:
|
|
|
- zMemory->setVar( "__return__", new Integer( log( l->getValue() ) / log( r->getValue() ) ) );
|
|
|
+ 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;
|
|
@@ -3329,3 +2930,142 @@ bool IntegerRechnen::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *z
|
|
|
zPC->stepOut();
|
|
|
return 0;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+IntegerZufall::IntegerZufall( Aktion *min, Aktion *max )
|
|
|
+ : Aktion( INTEGER_ZUFALL )
|
|
|
+{
|
|
|
+ this->min = 0;
|
|
|
+ this->max = 0;
|
|
|
+}
|
|
|
+
|
|
|
+IntegerZufall::~IntegerZufall()
|
|
|
+{
|
|
|
+ min->release();
|
|
|
+ max->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool IntegerZufall::runNext( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+IntegerAusText::IntegerAusText( Aktion *text )
|
|
|
+ : Aktion( INTEGER_AUS_TEXT )
|
|
|
+{
|
|
|
+ this->text = text;
|
|
|
+}
|
|
|
+
|
|
|
+IntegerAusText::~IntegerAusText()
|
|
|
+{
|
|
|
+ this->text->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool IntegerAusText::runNext( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+FloatXVonGameObjekt::FloatXVonGameObjekt( Aktion *objekt )
|
|
|
+ : Aktion( FLOAT_X_VON_GAME_OBJEKT )
|
|
|
+{
|
|
|
+ this->objekt = objekt;
|
|
|
+}
|
|
|
+
|
|
|
+FloatXVonGameObjekt::~FloatXVonGameObjekt()
|
|
|
+{
|
|
|
+ objekt->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool FloatXVonGameObjekt::runNext( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+FloatYVonGameObjekt::FloatYVonGameObjekt( Aktion *objekt )
|
|
|
+ : Aktion( FLOAT_Y_VON_GAME_OBJEKT )
|
|
|
+{
|
|
|
+ this->objekt = objekt;
|
|
|
+}
|
|
|
+
|
|
|
+FloatYVonGameObjekt::~FloatYVonGameObjekt()
|
|
|
+{
|
|
|
+ objekt->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool FloatYVonGameObjekt::runNext( 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;
|
|
|
+}
|