/// <summary> /// Determines whether the cell is walkable from the specified neighbour. /// </summary> /// <param name="neighbour">The neighbour.</param> /// <param name="mask">The attribute mask used to determine walk-ability.</param> /// <returns><c>true</c> if the cell is walkable, otherwise <c>false</c></returns> public override bool isWalkableFrom(IGridCell neighbour, IUnitProperties unitProps) { if (!isWalkable(unitProps.attributes)) { return(false); } var pos = neighbour.GetRelativePositionTo(this); return((_heightBlockedFrom & pos) == 0); }
/// <summary> /// Determines whether the cell is walkable from the specified neighbour. /// </summary> /// <param name="neighbour">The neighbour.</param> /// <param name="unitProps">The unit properties.</param> /// <returns><c>true</c> if the cell is walkable, otherwise <c>false</c></returns> public override bool isWalkableFrom(IGridCell neighbour, IUnitProperties unitProps) { if (!isWalkable(unitProps.attributes)) { return false; } var pos = neighbour.GetRelativePositionTo(this); return (_heightBlockedFrom & pos) == 0; }
/// <summary> /// Determines whether the cell is walkable from the specified neighbour. /// </summary> /// <param name="neighbour">The neighbour.</param> /// <param name="unitProps">The unit properties.</param> /// <returns><c>true</c> if the cell is walkable, otherwise <c>false</c></returns> public override bool IsWalkableFromWithClearance(IGridCell neighbour, IUnitProperties unitProps) { if (!IsWalkableWithClearance(unitProps)) { return(false); } var pos = neighbour.GetRelativePositionTo(this); return((_heightBlockedFrom & pos) == 0); }