public void AddVisual(eVisual type, Vector2 centerLoc) { switch (type) { case eVisual.Explosion01: Visual v = ExplosionPool.New(); v.Initialize(type, centerLoc); Visuals.Add(v); break; default: throw new CaseStatementMissingException(); } }
public void Initialize(eVisual type, Vector2 centerLoc) { VisualType = type; switch (VisualType) { case eVisual.Explosion01: IsDisposed = false; Animation.IsDisposed = false; Animation.Location = centerLoc - new Vector2(32, 32); Animation.CurrentFrame = Point.Zero; Animation.IsDisposed = false; break; default: throw new CaseStatementMissingException(); } }