/// <summary> /// Constructeur de la grille /// </summary> /// <param name="width">Nombre de cellules horizontalement</param> /// <param name="height">Nombre de cellules verticalement</param> /// <param name="createCell">constructeur de cellules <typeparamref name="T"/> en fonction de sa position x, y et de la <see cref="Grid{T}"/></param> protected Grid(int width, int height, CreateCell createCell) { _width = width; _height = height; _createCell = createCell; _total = _width * _height; _cells = new T[_width, _height]; //Parallel.For(0, _width, x => Parallel.For(0, _height, y => _cells[x, y] = createCell(x, y, this))); for (int x = 0; x < _width; ++x) { for (int y = 0; y < _height; ++y) { _cells[x, y] = _createCell(x, y, this); } } }
public async Task Post([FromBody] CreateCell command) { await DispatchAsync(command); }