Beispiel #1
0
        private bool CheckTile(TerrainType set, VirtualMap <char> mapData, int x, int y, Rectangle forceFill, Behaviour behaviour)
        {
            if (forceFill.Contains(x, y))
            {
                return(true);
            }
            if (mapData == null)
            {
                return(behaviour.EdgesExtend);
            }
            if (x >= 0 && y >= 0 && x < mapData.Columns && y < mapData.Rows)
            {
                char c = mapData[x, y];
                return(!IsEmpty(c) && !set.Ignore(c));
            }
            if (!behaviour.EdgesExtend)
            {
                return(false);
            }
            char c2 = mapData[Util.Clamp(x, 0, mapData.Columns - 1), Util.Clamp(y, 0, mapData.Rows - 1)];

            return(!IsEmpty(c2) && !set.Ignore(c2));
        }