public MainWindow() { InitializeComponent(); manager = new GameManager(new Random()); manager.AI[0] = new ColonizeAI(); manager.AI[1] = new ColonizeAI(); manager.AI[2] = new ColonizeAI(); manager.Prepare(); int w = manager.Field.Width, h = manager.Field.Height; mass = new MassInformation[w, h]; selectX = w / 2; selectY = h / 2; for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { MassInformation temp = new MassInformation(); temp.MouseDown += CreateMassSelectHandler(x, y); mass[x, y] = temp; FieldInfo.Children.Add(temp); Canvas.SetLeft(temp, (x + y / 2.0) * temp.Width); Canvas.SetTop(temp, y * temp.Height); } } UpdateInfo(); }
public ManagerCommander(GameManager parent) { this.parent = parent; }