createWall() {
minHeight = 10;
maxHeight = 30;
minWidth = 20;
maxWidth = 40;
width = Random.value * (maxWidth - minWidth) + minWidth;
height = Random.value * (maxHeight - minHeight) + minHeight;
// code to place wall
}
minDistanceBetweenWalls = 100;
distance = 0;
ticker() {
distance++;
if (distance > minDistanceBetweenWalls) {
// some chance to place wall
if (Random.value > .9) {
createWall();
distance = 0;
}
}
}
Bitmap img = (Bitmap)Image.FromFile("image.jpg");
Pen pen = new Pen(Color.Red, 2);
using (var graphics = Graphics.FromImage(img))
{
graphics.DrawRectangle(pen, new Rectangle(10, 10, 5, 5));
}
this.image.Image = img;
class Entity {
public double X = 0;
public double Y = 0;
public double Z = 0;
}
class Element : Entity {
public string color = "red";
}
class Room : Entity {
public List<Element> objects;
public void Add(Element obj) {
objects.Add(obj);
}
}
class Door : Element{
public string style = "modern";
}
class Window : Element{
public string material = "wood";
}
Room room = new Room();
room.Add(new Door());
room.Add(new Window());