public bool IsValid(MapPos pos) { int x = pos.PosX(); int y = pos.PosY(); return(x >= 0 && x < sizeX && y >= 0 && y < sizeY); }
public void SetSegment(MapPos pos, int value) { int x = pos.PosX(); int y = pos.PosY(); if (x < 0 || x >= sizeX || y < 0 || y >= sizeY) { return; } map[(y * sizeX) + x] = value; }
public int GetSegment(MapPos pos) { int x = pos.PosX(); int y = pos.PosY(); if (x < 0 || x >= sizeX || y < 0 || y >= sizeY) { return(-1); } return(map[(y * sizeX) + x]); }
public EnumCellState GetSegment(MapPos pos) { int x = pos.PosX(); int y = pos.PosY(); if (x < 0 || x >= sizeX || y < 0 || y >= sizeY) { return(EnumCellState.LOCK_CLOSED); } return(map[(y * sizeX) + x]); }