|
@@ -2430,7 +2430,7 @@ bool TriggerSetEnabled::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Trigger *)t )->setAktiv( ( (Boolean *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (Trigger *)t )->setAktiv( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -2480,7 +2480,7 @@ bool TeamSetPunkte::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Team *)t )->setPunkte( ( (Integer *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (Team *)t )->setPunkte( ( (Integer *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -2597,7 +2597,7 @@ bool TimerSetPause::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zM
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Timer *)t )->setPause( ( (Boolean *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (Timer *)t )->setPause( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -2676,7 +2676,7 @@ bool TimerSetZeit::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMe
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Timer *)t )->setZeit( ( (Float *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (Timer *)t )->setZeit( ( (Float *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
@@ -2726,7 +2726,361 @@ bool TimerSetSichtbar::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory
|
|
|
zPC->stepOut();
|
|
|
return 1;
|
|
|
}
|
|
|
- ( (Timer *)t )->setSichtbar( ( (Boolean *)zMemory->getVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ ( (Timer *)t )->setSichtbar( ( (Boolean *)zMemory->zVariable( zPC->getUniqueString() + "R0__" ) )->getValue() );
|
|
|
+ zPC->stepOut();
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ zPC->stepOut();
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossNeu::GeschossNeu( Aktion *x, Aktion *y, Aktion *typ, Aktion *richtung )
|
|
|
+ : Aktion( GESCHOSS_NEU )
|
|
|
+{
|
|
|
+ this->x = x;
|
|
|
+ this->y = y;
|
|
|
+ this->typ = typ;
|
|
|
+ this->richtung = richtung;
|
|
|
+}
|
|
|
+
|
|
|
+GeschossNeu::~GeschossNeu()
|
|
|
+{
|
|
|
+ x->release();
|
|
|
+ y->release();
|
|
|
+ typ->release();
|
|
|
+ richtung->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool GeschossNeu::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( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+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 )
|
|
|
+{
|
|
|
+ this->speed = speed;
|
|
|
+ this->geschoss = geschoss;
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetSpeed::~GeschossSetSpeed()
|
|
|
+{
|
|
|
+ speed->release();
|
|
|
+ geschoss->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool GeschossSetSpeed::runNext( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetPlayer::GeschossSetPlayer( Aktion *player, Aktion *geschoss )
|
|
|
+ : Aktion( GESCHOSS_SET_PLAYER )
|
|
|
+{
|
|
|
+ this->player = player;
|
|
|
+ this->geschoss = geschoss;
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetPlayer::~GeschossSetPlayer()
|
|
|
+{
|
|
|
+ player->release();
|
|
|
+ geschoss->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool GeschossSetPlayer::runNext( Spiel *zSpiel, Ereignis *zEreignis, LocalMemory *zMemory, ProgramCounter *zPC, double &waitCount )
|
|
|
+{
|
|
|
+ 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetRichtung::GeschossSetRichtung( Aktion *richtung, Aktion *geschoss )
|
|
|
+ : Aktion( GESCHOSS_SET_RICHTUNG )
|
|
|
+{
|
|
|
+ this->richtung = richtung;
|
|
|
+ this->geschoss = geschoss;
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetRichtung::~GeschossSetRichtung()
|
|
|
+{
|
|
|
+ richtung->release();
|
|
|
+ geschoss->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool GeschossSetRichtung::runNext( 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;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+GeschossSetType::GeschossSetType( Aktion *type, Aktion *geschoss )
|
|
|
+ : Aktion( GESCHOSS_SET_TYPE )
|
|
|
+{
|
|
|
+ this->type = type;
|
|
|
+ this->geschoss = geschoss;
|
|
|
+}
|
|
|
+
|
|
|
+GeschossSetType::~GeschossSetType()
|
|
|
+{
|
|
|
+ type->release();
|
|
|
+ geschoss->release();
|
|
|
+}
|
|
|
+
|
|
|
+bool GeschossSetType::runNext( 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;
|
|
|
}
|