public void Clear() { balls = new List <Ball> (); monsters = new List <Monster> (); fields = new Field[Width, Height]; for (int i = 0; i < Width; i++) { for (int j = 0; j < Height; j++) { fields [i, j] = new Field(); if (i == 0 || j == 0 || i + 1 == Width || j + 1 == Height) { fields [i, j].Full = true; } else { fields [i, j].Full = false; } fields [i, j].X = i; fields [i, j].Y = j; } } Player = new Player(0, 0); Player.BaseField = fields [0, 0]; renderer.RefreshBackground(fields); }
public Board(int width, int height, int fieldSize, BoardRenderer renderer) { this.renderer = renderer; this.Width = width; this.Height = height; this.Clear (); this.FieldSize = fieldSize; renderer.RefreshBackground (fields); }
public Board(int width, int height, int fieldSize, BoardRenderer renderer) { this.renderer = renderer; this.Width = width; this.Height = height; this.Clear(); this.FieldSize = fieldSize; renderer.RefreshBackground(fields); }