private static void Main(string[] args) { var world = new StoogeWorld.StoogeWorld(); var gen = new Generator(world); var arr = gen.GenerateArea(3); var rowLength = arr.GetLength(0); var colLength = arr.GetLength(1); var bmp = new Bitmap(rowLength, colLength); using (var graph = Graphics.FromImage(bmp)) { for (var i = 0; i < rowLength; i++) { for (var j = 0; j < colLength; j++) { var value = (int)Math.Round(0.5f * (1 + arr[i, j]) * 255); bmp.SetPixel(i, j, Color.FromArgb(value, value, value)); } } } bmp.Save("TestImage.png", ImageFormat.Png); }
public StoogeServer(IPAddress localAddress, int port) { _localAddress = localAddress; _port = port; _lastPulse = DateTime.Now; World = new StoogeWorld.StoogeWorld(); Server = new TcpListener(_localAddress, port); }
public Generator(StoogeWorld.StoogeWorld world) { World = world; }