Esempio n. 1
0
        public bool CanMove()
        {
            if (CurrentMap == null)
                return false;

            GenerateRandomMoveDirection();

            var tempPosition = new Position(Position.X, Position.Y);
            tempPosition.Move(moveDirection);

            return !(tempPosition.X < CurrentMap.MinLeft ||
                tempPosition.X > CurrentMap.MaxLeft ||
                tempPosition.Y < CurrentMap.MinTop ||
                tempPosition.Y > CurrentMap.MaxTop);
        }
Esempio n. 2
0
        public bool CanMove()
        {
            if (CurrentMap == null)
            {
                return(false);
            }

            var tempPosition = new Position(Position.X, Position.Y);

            tempPosition.Move(GetMoveDirection());

            return(!(tempPosition.X < CurrentMap.MinLeft ||
                     tempPosition.X > CurrentMap.MaxLeft ||
                     tempPosition.Y < CurrentMap.MinTop ||
                     tempPosition.Y > CurrentMap.MaxTop));
        }
Esempio n. 3
0
 public void Move()
 {
     Position.Move(moveDirection);
 }
Esempio n. 4
0
 public void Move()
 {
     Position.Move(GetMoveDirection());
 }