Esempio n. 1
0
        private int RegionLinkDistance(WaterRegionLink a, WaterRegionLink b, int minPathCost)
        {
            IntVec3 a2     = (!this.linkTargetCells.ContainsKey(a)) ? RegionCostCalculatorShips.RegionLinkCenter(a) : this.linkTargetCells[a];
            IntVec3 b2     = (!this.linkTargetCells.ContainsKey(b)) ? RegionCostCalculatorShips.RegionLinkCenter(b) : this.linkTargetCells[b];
            IntVec3 intVec = a2 - b2;
            int     num    = Math.Abs(intVec.x);
            int     num2   = Math.Abs(intVec.z);

            return(this.OctileDistance(num, num2) + (minPathCost * Math.Max(num, num2)) + (minPathCost * Math.Min(num, num2)));
        }
Esempio n. 2
0
 private IntVec3 GetLinkTargetCell(IntVec3 cell, WaterRegionLink link)
 {
     return(RegionCostCalculatorShips.LinkClosestCell(cell, link));
 }
Esempio n. 3
0
        private int MinimumRegionLinkDistance(IntVec3 cell, WaterRegionLink link)
        {
            IntVec3 intVec = cell - RegionCostCalculatorShips.LinkClosestCell(cell, link);

            return(this.OctileDistance(Math.Abs(intVec.x), Math.Abs(intVec.z)));
        }
Esempio n. 4
0
 private static IntVec3 RegionLinkCenter(WaterRegionLink link)
 {
     return(new IntVec3(RegionCostCalculatorShips.SpanCenterX(link.span), 0, RegionCostCalculatorShips.SpanCenterZ(link.span)));
 }