private void DrawBullets() { foreach (var bullet in _bullets) { bullet.Draw(); } var bullets = new List<Bullet>(_battlefield.NewBullets); foreach (var bullet in bullets) { var newBullet = new BulletView(bullet); //Dispatcher.Invoke(DispatcherPriority.Render,new Action(Close)); Dispatcher.FromThread(_uiThread).Invoke(DispatcherPriority.Render, new Action(() => AddBullet(newBullet))); _battlefield.Process(bullet); newBullet.Draw(); } }
private void RemoveBullet(BulletView bullet) { _bullets.Remove(bullet); }
private void AddBullet(BulletView newBullet) { _bullets.Add(newBullet); }