Exemple #1
0
        private void DrawExplosions()
        {
            foreach (var explosion in _explosions)
            {
                explosion.Draw();
            }

            var explosions = new List<Explosion>(_battlefield.NewExplosions);
            foreach (var explosion in explosions)
            {
                var newExplosion = new ExplosionView(explosion, _explosionImages);
                Dispatcher.FromThread(_uiThread).Invoke(DispatcherPriority.Render, new Action(() => AddExplosion(newExplosion)));
                _battlefield.Process(explosion);
                newExplosion.Draw();
            }
        }
Exemple #2
0
 private void RemoveExplosion(ExplosionView explosion)
 {
     _explosions.Remove(explosion);
 }
Exemple #3
0
 private void AddExplosion(ExplosionView newExplosion)
 {
     _explosions.Add(newExplosion);
 }