public void Release() { streamParser = null; gridParser = null; if (gridDrawer != null) { gridDrawer.Dispose(); gridDrawer = null; } }
public void Initialize() { streamParser = new StreamParser(new char[] { '.', 'B', 'W' }); gridParser = new GridParser <CellColor>(new Dictionary <char, CellColor>() { { '.', CellColor.Blank }, { 'W', CellColor.White }, { 'B', CellColor.Black } }); gridDrawer = new GridTextDrawer <CellColor>(Console.Out, new Dictionary <CellColor, char>() { { CellColor.Blank, '.' }, { CellColor.White, 'W' }, { CellColor.Black, 'B' } }, '0'); }
public Board(IGridDrawer drawer, string grid = "") { _drawer = drawer; _cells = CellsFromString(grid); }