Esempio n. 1
0
 public MapComponent(MapComponentType type, int x, int y, int width, int height) : this(type, new int[2] {
     x, y
 }, new int[2] {
     width, height
 })
 {
 }
Esempio n. 2
0
 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;
                 }
             }
         }
     }
 }
Esempio n. 3
0
 public MapComponent(MapComponentType type, int[] pos, int[] size)
 {
     _type = type;
     _pos  = pos;
     _size = size;
 }
Esempio n. 4
0
 public MapComponent(MapComponentType type, int x, int y, int[] size) : this(type, new int[2] {
     x, y
 }, size)
 {
 }
Esempio n. 5
0
 public MapComponent(MapComponentType type, int[] pos, int width, int height) : this(type, pos, new int[2] {
     width, height
 })
 {
 }