public CellMgr(RegionMgr Mgr, UInt16 OffX, UInt16 OffY) { Region = Mgr; X = OffX; Y = OffY; Spawns = Mgr.GetCellSpawn(OffX, OffY); }
public CellMgr(RegionMgr Mgr, UInt16 OffX, UInt16 OffY) { Region = Mgr; X = OffX; Y = OffY; Spawns = Mgr.GetCellSpawn(OffX,OffY); }
public CellSpawns GetCellSpawn(ushort x, ushort y) { x = (ushort)Math.Min(MaxCellID - 1, x); y = (ushort)Math.Min(MaxCellID - 1, y); return(_cellSpawns[x, y] ?? (_cellSpawns[x, y] = new CellSpawns(RegionId, x, y))); }
public CellMgr(RegionMgr mgr, ushort offX, ushort offY) { Region = mgr; X = offX; Y = offY; Spawns = mgr.GetCellSpawn(offX, offY); }
public CellSpawns GetCellSpawn(UInt16 X, UInt16 Y) { X = (UInt16)Math.Min(MAX_CELL_ID - 1, X); Y = (UInt16)Math.Min(MAX_CELL_ID - 1, Y); if (_CellSpawns[X, Y] == null) { _CellSpawns[X, Y] = new CellSpawns(RegionId, X, Y); } return(_CellSpawns[X, Y]); }
static public CellSpawns GetRegionCell(ushort RegionId, UInt16 X, UInt16 Y) { X = (UInt16)Math.Min(RegionMgr.MAX_CELL_ID - 1, X); Y = (UInt16)Math.Min(RegionMgr.MAX_CELL_ID - 1, Y); if (!_RegionCells.ContainsKey(RegionId)) { _RegionCells.Add(RegionId, new CellSpawns[RegionMgr.MAX_CELL_ID, RegionMgr.MAX_CELL_ID]); } if (_RegionCells[RegionId][X, Y] == null) { CellSpawns Sp = new CellSpawns(RegionId, X, Y); _RegionCells[RegionId][X, Y] = Sp; } return(_RegionCells[RegionId][X, Y]); }
public static CellSpawns GetRegionCell(ushort RegionId, UInt16 X, UInt16 Y) { X = (UInt16)Math.Min(RegionMgr.MAX_CELL_ID - 1, X); Y = (UInt16)Math.Min(RegionMgr.MAX_CELL_ID - 1, Y); if (!_RegionCells.ContainsKey(RegionId)) _RegionCells.Add(RegionId, new CellSpawns[RegionMgr.MAX_CELL_ID, RegionMgr.MAX_CELL_ID]); if (_RegionCells[RegionId][X, Y] == null) { CellSpawns Sp = new CellSpawns(RegionId, X, Y); _RegionCells[RegionId][X, Y] = Sp; } return _RegionCells[RegionId][X, Y]; }
public CellSpawns GetCellSpawn(UInt16 X, UInt16 Y) { X = (UInt16)Math.Min(MAX_CELL_ID - 1, X); Y = (UInt16)Math.Min(MAX_CELL_ID - 1, Y); if (_CellSpawns[X, Y] == null) { _CellSpawns[X, Y] = new CellSpawns(RegionId, X, Y); } return _CellSpawns[X, Y]; }