Example #1
0
 public void SquareInteracted(MapSquare square)
 {
     target.interactable = MapSquare.Interactable.Passive;
     GameMaster.Instance.MapSquareInteracted(square);
 }
Example #2
0
        public virtual bool CanMove(Tools.Direction direction)
        {
            MapSquare targetSquare = mapSquare.GetNeighbour(direction);

            return(targetSquare != null && targetSquare.CanEnterSquare(this, direction));
        }
Example #3
0
 public virtual void Input(MapSquare squareInput)
 {
 }
Example #4
0
 public override void Input(MapSquare squareInput)
 {
     unit.Turn(unit.mapSquare.GetNeighbourDirection(squareInput));
 }
Example #5
0
        public KeyValuePair <Tools.Direction, MapSquare> CheckNeighbourState(MapSquare origin, MapSquare other)
        {
            // If squares are not neighbours or they are the same one, return a none value.
            float distance = Vector3.Distance(origin.transform.position, other.transform.position);

            if (distance > 1.7f || distance < 0.9f)
            {
                return(new KeyValuePair <Tools.Direction, MapSquare>(Tools.Direction.None, other));
            }

            Tools.Direction dir = Tools.GetDirection(origin, other);
            return(new KeyValuePair <Tools.Direction, MapSquare>(dir, other));
        }