public void SquareInteracted(MapSquare square) { target.interactable = MapSquare.Interactable.Passive; GameMaster.Instance.MapSquareInteracted(square); }
public virtual bool CanMove(Tools.Direction direction) { MapSquare targetSquare = mapSquare.GetNeighbour(direction); return(targetSquare != null && targetSquare.CanEnterSquare(this, direction)); }
public virtual void Input(MapSquare squareInput) { }
public override void Input(MapSquare squareInput) { unit.Turn(unit.mapSquare.GetNeighbourDirection(squareInput)); }
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)); }