public int GetCost(int cell) { int num = OffsetCell(cell); if (num == -1) { return(-1); } ProberCell proberCell = ProberCells[num]; return((!IsValidSerialNo(proberCell.queryId)) ? (-1) : proberCell.cost); }
public int GetCostIgnoreProberOffset(int cell, CellOffset[] offsets) { int num = -1; foreach (CellOffset offset in offsets) { int num2 = Grid.OffsetCell(cell, offset); if (Grid.IsValidCell(num2)) { ProberCell proberCell = ProberCells[num2]; if (IsValidSerialNo(proberCell.queryId) && (num == -1 || proberCell.cost < num)) { num = proberCell.cost; } } } return(num); }
public void SetCell(PathFinder.PotentialPath potential_path, ref PathFinder.Cell cell_data) { int num = OffsetCell(potential_path.cell); if (num != -1) { cell_data.queryId = serialNo; int num2 = NavTypeTable[(uint)potential_path.navType]; int num3 = num * ValidNavTypes.Length + num2; Cells[num3] = cell_data; if (potential_path.navType != NavType.Tube) { ProberCell proberCell = ProberCells[num]; if (cell_data.queryId != proberCell.queryId || cell_data.cost < proberCell.cost) { proberCell.queryId = cell_data.queryId; proberCell.cost = cell_data.cost; ProberCells[num] = proberCell; freshlyOccupiedCells.Add(potential_path.cell); } } } }