public TriangleGrid Find(long id) { TriangleGrid tg = null; lock (_lock) { _store.TryGetValue(id, out tg); } return(tg); }
public TriangleGrid Create(int rows, int columns) { TriangleGrid tg = new TriangleGrid(rows, columns); lock (_lock) { tg.Id = _currentKeyToInsertNext; _store.Add(_currentKeyToInsertNext, tg); _currentKeyToInsertNext++; } return(tg); }