public MapComponent(MapComponentType type, int x, int y, int width, int height) : this(type, new int[2] { x, y }, new int[2] { width, height }) { }
private void DrawSquaredComponent(Color[] colorMap, Color color, MapComponentType type) { foreach (MapComponent component in _components[type]) { for (int dx = 0; dx < component.width; dx++) { for (int dy = 0; dy < component.height; dy++) { int x = component.x + dx; int y = component.y + dy; if (x >= 0 && x < width && y >= 0 && y < height) { colorMap[x + y * width] = color; } } } } }
public MapComponent(MapComponentType type, int[] pos, int[] size) { _type = type; _pos = pos; _size = size; }
public MapComponent(MapComponentType type, int x, int y, int[] size) : this(type, new int[2] { x, y }, size) { }
public MapComponent(MapComponentType type, int[] pos, int width, int height) : this(type, pos, new int[2] { width, height }) { }