public void ResetBoard(Func <ICard <CardType> > getCardFunc, ICard <CardType> playerCard) { _playerCoordinates = new Coordinates(1, 1); _hero.Reset(); _heroCard = playerCard; foreach (Coordinates coordinates in _grid.GetAllPositions()) { _grid[coordinates].Card = coordinates.Equals(_playerCoordinates) ? playerCard : getCardFunc.Invoke(); } }
public Board(int width, int height, IMovementResultGenerator <ICard <CardType> > movementResultGenerator) { _movementResultGenerator = movementResultGenerator; _grid = new Grid <DungeonCardSlot>(width, height, Enumerable.Range(0, width * height).Select(_ => new DungeonCardSlot())); _legalMovesCache = GetLegalMovesCache(); foreach (var coordinates in _grid.GetAllPositions()) // TODO: This isn't being used currently { _grid[coordinates].Description = GetSquareDescription(coordinates); } }