Ejemplo n.º 1
0
 public bool CanMoveToSquare(Vector2Int squareIndex)
 {
     if (AvailableMoves.Any(move => move.TargetSquare == squareIndex))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
        public void MoveTo(int x, int y)
        {
            //TODO: remove hack for avoid switch weapons button
            var mousePosition       = Mouse.GetState().Position;
            var scaledMousePosition = new Point((int)Math.Round(mousePosition.X / CurrentDisplay.Scale), (int)Math.Round(mousePosition.Y / CurrentDisplay.Scale));

            if (scaledMousePosition.X > 700 && scaledMousePosition.Y < 900 && scaledMousePosition.Y > 850)
            {
                return;
            }
            if (AvailableMoves.Any(move => move.Last().X == x && move.Last().Y == y))
            {
                Event.Publish(new MovementConfirmed(AvailableMoves.First(move => move.Last().X == x && move.Last().Y == y)));
            }
        }
Ejemplo n.º 3
0
 public bool IsMoveAllowed(int x, int y)
 {
     return(AvailableMoves != null && AvailableMoves.Any(p => p.X == x && p.Y == y));
 }