コード例 #1
0
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public int GetNavigationCost(IApproachable approachable)
 {
     return(GetNavigationCost(approachable.GetCell(), approachable.GetOffsets()));
 }
コード例 #5
0
 public bool CanReach(IApproachable approachable)
 {
     return(CanReach(approachable.GetCell(), approachable.GetOffsets()));
 }