예제 #1
0
    public bool IsValid(MapPos pos)
    {
        int x = pos.PosX();
        int y = pos.PosY();

        return(x >= 0 && x < sizeX && y >= 0 && y < sizeY);
    }
예제 #2
0
    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;
    }
예제 #3
0
    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]);
    }
예제 #4
0
    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]);
    }