src/wavegens.cpp
// executeWaveGenAI ******
// This method executes the individual AI of a wave generator unit.

executeWaveGenAI
This method executes the individual AI of a wave generator unit.
executeWaveGenAI This method executes the individual AI of a wave generator unit .
bool executeWaveGenAI(
	DWORD frameNumber,
	vectorListNodeStruct<waveGenUnitStruct>& unit)
{
	if (!unit.data.generatingNow) return true;
	unit.data.nextEnemyWaveX-=unit.data.virtualEnemyWavesSpeedX;
	if (unit.data.nextEnemyWaveX<=gameWorld.xCamera+gameWorld.wCamera) {
		if (!addEnemiesWaveGen(frameNumber, unit)) return false;
		unit.data.nextEnemyWaveX=gameWorld.xCamera+gameWorld.wCamera+
			unit.data.distanceBetweenWaves;
	}
	return true;
}
bool executeWaveGenAI ( DWORD frameNumber , vectorListNodeStruct < waveGenUnitStruct > & unit ) { if ( ! unit . data . generatingNow ) return true ; unit . data . nextEnemyWaveX -= unit . data . virtualEnemyWavesSpeedX ; if ( unit . data . nextEnemyWaveX <= gameWorld . xCamera + gameWorld . wCamera ) { if ( ! addEnemiesWaveGen ( frameNumber , unit ) ) return false ; unit . data . nextEnemyWaveX = gameWorld . xCamera + gameWorld . wCamera + unit . data . distanceBetweenWaves ; } return true ; }
executeWaveGenAI 
This method executes the individual AI of a wave generator unit.
executeWaveGenAI This method executes the individual AI of a wave generator unit .
// current frame
 // wavegen unit to move
 // nothing to do now...
 // This function works by putting a virtual wave at some distance
 // from the last enemy wave added, and then moving it as if it were
 // an object. When the virtual enemy wave object is detected to be
 // just inside the screen, a bunch of enemies is added and a new
 // virtual wave object is put.
 // Start moving the virtual wave object
 // see if it's time for adding an enemy wave
 // Add the wave
 // Setup next virtual wave
 // all ok
