|
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace DungeonOfDespair
{
public class Spells
: List<Spell>
{
Room m_room;
public Spells(Room room)
{
m_room = room;
}
public void Reset()
{
this.Clear();
}
public void Update()
{
for (int iIndex = this.Count - 1; iIndex >= 0; iIndex--)
{
Spell spell = this[iIndex];
spell.Update();
if (!spell.Active)
{
Image imageEffect = spell.Friendly
? Properties.Resources.PlayerSpellBlast
: Properties.Resources.EnemySpellBlast;
Effect effect = new Effect(m_room.Effects, imageEffect, 10);
effect.X = spell.X;
effect.Y = spell.Y;
m_room.Effects.Add(effect);
this.RemoveAt(iIndex);
}
}
}
public void Draw(Graphics graphics)
{
foreach (Spell spell in this)
spell.Draw(graphics);
}
public Room Room
{
get { return m_room; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.