public Cell(int id, Database.Records.MapRecords map) { _map = map; ID = id; this.Parent = this; try { X = Pathfinding.GetCellXCoord(id, map.Width); Y = Pathfinding.GetCellYCoord(id, map.Width); } catch (Exception e) { } }
public Cell UncompressCell(string sData, int id) { Cell loc5 = new Cell(id, this.Map); string loc6 = sData; int loc7 = loc6.Length - 1; int[] loc8 = new int[8000]; while (loc7 >= 0) { try { loc8[loc7] = IndexArray(loc6[loc7].ToString()); } catch (Exception e) { } loc7--; } try { loc5.Available = ((loc8[2] & 56) >> 3); } catch (Exception e) { loc5.Available = 1; } loc5.layerObject2Num = ((loc8[0] & 2) << 12) + ((loc8[7] & 1) << 12) + (loc8[8] << 6) + loc8[9]; loc5.layerObject2Interactive = ((loc8[7] & 2) >> 1); loc5.layerObject1Num = ((loc8[0] & 4) << 11) + ((loc8[4] & 1) << 12) + (loc8[5] << 6) + loc8[6]; return loc5; }
private List<Cell> getNeighbours(Cell cell, List<int> dyn) { var neigh = new List<Cell>(); var tmpCell = Pathfinding.GetJoinCell(cell.ID, this.Map.Map); foreach (var c in tmpCell) { if (this.Map.IsAvailableCell(c) && !dyn.Contains(c)) { neigh.Add(this.GetCell(c)); } } return neigh; }
private void addToOpenList(Cell cell) { this.closedList.Remove(cell); this.openList.Add(cell); }