EffectSpawner

by Martin "Pfhoenix" Actor


	EffectSpawner is a class that attaches to an actor and spawns an effect based on a timer and how many times you want an effect spawned. It fully supports lists of EffectSpawners. The basic usage is as follows :

	1) Spawn the EffectSpawner class with the owning actor set to the actor you want the EffectSpawner to attach to and the location of the point on the actor where you want the EffectSpawner to be (in world coordinates). Save the returned EffectSpawner class object and call its InitSpawner() then SetSpawnProperties(). InitSpawner takes no arguements. SetSpawnProperties(float SpawnDelay, int NumSpawns, int SpawnsLeft, class<Effects> Effect, bool RestartTimer) is what is used to set the properties of the spawner. SpawnDelay is the time between effect spawns, NumSpawns is the number of effects the spawner will spawn before the spawner destroys() itself, Effect is the class of effect the spawner will spawn. and RestartTimer will tell the spawner to start spawning if set to True.

	2) If you're using a list of EffectSpawners', then call EffectSpawner.AddToList(EffectSpawner FirstSpawner). The FirstSpawner arguement is the first spawner in the EffectSpawner list. The EffectSpawner will add itself to the list. The reference returned is the first EffectSpawner in the list (this may seem redundant, but it is necessary because it can change under certain conditions, and if it does, your currently stored FirstSpawner is now invalid and if you don't update it, you will have EffectSpawners working with no way to access them or turn them off / destroy them).

	Once you have that, you can at any time stop an EffectSpawner by calling it's StopSpawner() function member, start it up again by calling StartSpawner(), check whether it is spawning by calling IsSpawning() and checking the returned bool value, and delete it from the list it is in by calling DeleteFromCurrentList(), which returns the first spawner in the list (again to provide access to potentially changed first spawner).


Questions? Comments? Suggestions? Send them via E-Mail : pfhoenix@yahoo.com

Copyright (C) 2000 Martin "Pfhoenix" Actor
Use of this class is highly encouraged. Any changes made to the class by anyone other than the author (unless given explicitly expressed permission from the author) must be sent to the author. If you use the class, do the right thing and give credit where it is due. Taking credit for other people's work is not only morally wrong, it's legally wrong when the material is copyrighted.
