public HexagonalGrid(Vector2D size, HexagonalCell[] cells, int iteration) { this.size = new Point((int)size.X, (int)size.Y); this.cells = cells; this.iteration = iteration; this.copy = new HexagonalCell[Width * Height]; }
private void FillGrid() { for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { int i = CoordinateSystemConverter.PlaneToLine(new Vector2D(x, y), Width); cells[i] = new HexagonalCell(position: new Vector2D(x, y), translation: CELL_TRANSLATION, alive: GetRandomLifeState()); } } }
private void FillGrid() { for (int x = 0; x < Width; x++) for (int y = 0; y < Height; y++) { int i = CoordinateSystemConverter.PlaneToLine(new Vector2D(x, y), Width); cells[i] = new HexagonalCell(position: new Vector2D(x, y), translation: CELL_TRANSLATION, alive: GetRandomLifeState()); } }