Ejemplo n.º 1
0
        public void SetGridValue(Point point, char value, EditMode mode)
        {
            if (!gridCellValues.ContainsKey(value))
            {
                SetGridValue(point, ' ', EditMode.CONSTRUCTION);
                return;
            }

            int2 gridCoord = GetGridCoord(point);

            switch (mode)
            {
            // Reserved for more behaviours
            case EditMode.EDIT:
                if (gridCoord.x < wallSize || gridCoord.y < wallSize || gridCoord.x >= cellCount - wallSize || gridCoord.y >= cellCount - wallSize || fixedCells.Contains(gridValues[gridCoord.x + gridCoord.y * cellCount]))
                {
                    return;
                }
                break;
            }

            bitmap.DrawCell(this, point, gridCellValues[value].color);
            gridValues[gridCoord.x + gridCoord.y * cellCount] = value;
        }