public bool IsWithinReach(IApproachable approachable) { if ((bool)navigator) { if ((UnityEngine.Object) this == (UnityEngine.Object)null || (UnityEngine.Object)base.gameObject == (UnityEngine.Object)null) { return(false); } return(Grid.IsCellOffsetOf(Grid.PosToCell(this), approachable.GetCell(), approachable.GetOffsets())); } if (consumerState.hasSolidTransferArm) { return(consumerState.solidTransferArm.IsCellReachable(approachable.GetCell())); } return(false); }
public bool CanReach(IApproachable approachable) { if ((bool)navigator) { return(navigator.CanReach(approachable)); } if (consumerState.hasSolidTransferArm) { int cell = approachable.GetCell(); return(consumerState.solidTransferArm.IsCellReachable(cell)); } return(false); }
public bool GetNavigationCost(IApproachable approachable, out int cost) { if ((bool)navigator) { cost = navigator.GetNavigationCost(approachable); if (cost != -1) { return(true); } } else if (consumerState.hasSolidTransferArm) { int cell = approachable.GetCell(); if (consumerState.solidTransferArm.IsCellReachable(cell)) { cost = Grid.GetCellRange(this.NaturalBuildingCell(), cell); return(true); } } cost = 0; return(false); }
public int GetNavigationCost(IApproachable approachable) { return(GetNavigationCost(approachable.GetCell(), approachable.GetOffsets())); }
public bool CanReach(IApproachable approachable) { return(CanReach(approachable.GetCell(), approachable.GetOffsets())); }