示例#1
0
        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();
            }
        }
示例#2
0
 private void RemoveBullet(BulletView bullet)
 {
     _bullets.Remove(bullet);
 }
示例#3
0
 private void AddBullet(BulletView newBullet)
 {
     _bullets.Add(newBullet);
 }