explosions

This commit is contained in:
Chris Forbes
2009-10-20 18:47:47 +13:00
parent 7332a8f79a
commit ec60b00f31
6 changed files with 45 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ namespace OpenRa.Game
class World
{
List<Actor> actors = new List<Actor>();
List<IEffect> bullets = new List<IEffect>();
List<IEffect> effects = new List<IEffect>();
List<Action<World>> frameEndActions = new List<Action<World>>();
readonly Game game;
int lastTime = Environment.TickCount;
@@ -19,8 +19,8 @@ namespace OpenRa.Game
public void Add(Actor a) { actors.Add(a); ActorAdded(a); }
public void Remove(Actor a) { actors.Remove(a); ActorRemoved(a); }
public void Add(Bullet b) { bullets.Add(b); }
public void Remove(Bullet b) { bullets.Remove(b); }
public void Add(IEffect b) { effects.Add(b); }
public void Remove(IEffect b) { effects.Remove(b); }
public void AddFrameEndTask( Action<World> a ) { frameEndActions.Add( a ); }
@@ -42,7 +42,7 @@ namespace OpenRa.Game
foreach( var a in actors )
a.Tick(game);
foreach (var b in bullets)
foreach (var b in effects)
b.Tick(game);
Renderer.waterFrame += 0.00125f * timestep;
@@ -53,6 +53,6 @@ namespace OpenRa.Game
}
public IEnumerable<Actor> Actors { get { return actors; } }
public IEnumerable<IEffect> Bullets { get { return bullets; } }
public IEnumerable<IEffect> Effects { get { return effects; } }
}
}