private void OnMouseDown(object sender, InputEventArgs e)
 {
     Vector2 physicalPosition = new Vector2(e.X, e.Y) / Constants.PixelsPerMeter;
     if (this.tank.FireMissileCommand.CanExecute(physicalPosition))
     {
         this.tank.FireMissileCommand.Execute(physicalPosition);
     }
 }
 private void OnMouseMoved(object sender, InputEventArgs e)
 {
     Vector2 physicalPosition = new Vector2(e.X, e.Y) / Constants.PixelsPerMeter;
     this.tank.PointTurretCommand.Execute(physicalPosition);
 }
Пример #3
0
 private void OnMouseDown(object sender, InputEventArgs e)
 {
     if (this.IsVisible && this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y))
     {
         //this.scaleTween.Restart();
         this.scaleTween.IsPaused = false;
         this.inputManager.DragEnded += this.OnDragEnded;
     }
 }
Пример #4
0
 private void OnClick(object sender, InputEventArgs e)
 {
     this.viewModel.GoToTitle();
 }
Пример #5
0
        private void OnDragEnded(object sender, InputEventArgs e)
        {
            if (!this.IsVisible)
            {
                return;
            }

            //this.scaleTween.Reverse();
            this.scaleTween.IsPaused = false;
            this.inputManager.DragEnded -= this.OnDragEnded;
            if (this.Command != null && this.Command.CanExecute(null) && this.bounds.Contains(e.X, e.Y))
            {
                this.Execute();
            }
        }