import class EnvironmentDamageReceiverComponent extends IPlacedComponent
{
	private import var cooldown : Float;

	private function DealDamageFromParticle( particleDamageRecords : array< ParticleDamage_Record >, instigator : GameObject, source : GameObject )
	{
		var gi : GameInstance;
		var object : GameObject;
		var attack : Attack_GameEffect;
		var hitFlags : array< SHitFlag >;
		var flag : SHitFlag;
		var i : Int32;
		var gameEffectAttackRecord : Attack_GameEffect_Record;
		object = ( ( GameObject )( GetEntity() ) );
		gi = object.GetGame();
		flag.flag = hitFlag.None;
		flag.source = 'Environment';
		hitFlags.PushBack( flag );
		if( instigator == NULL )
		{
			instigator = object;
		}
		if( source == NULL )
		{
			source = object;
		}
		for( i = 0; i < particleDamageRecords.Size(); i = i + 1 )
		{
			gameEffectAttackRecord = ( ( Attack_GameEffect_Record )( particleDamageRecords[ i ].Attack() ) );
			if( gameEffectAttackRecord )
			{
				attack = RPGManager.PrepareGameEffectAttack( gi, instigator, source, gameEffectAttackRecord.GetID(), , hitFlags, object );
				if( attack )
				{
					attack.StartAttack();
				}
			}
			cooldown += particleDamageRecords[ i ].Cooldown();
		}
	}

}

