/// <summary> /// Draws all stored lines and points to the <see cref="IGraphicContainer"/>. /// </summary> public async Task Draw(IGraphicContainer container) { var pts = new List <Tuple <Point[], string> >(); lock (_updatePointsLock) pts.AddRange(_points); var polys = new List <Tuple <Point[], string> >(); lock (_updatePolysLock) polys.AddRange(_polys); //Send lines var glines = pts.Select(tuple => new GraphicLine { ColorHex = tuple.Item2, Point1 = tuple.Item1[0], Point2 = tuple.Item1[1] }).ToList(); //Send polygons var gpolys = polys.Select(tuple => new GraphicPolygon { ColorHex = tuple.Item2, Points = tuple.Item1 }).ToList(); await container.Draw(glines, gpolys); }
public async Task Initialize(IGraphicContainer container, Rectangle frameRectangle) { _container = container; GameStatus = GameMode.Title; ResizeGame(frameRectangle); await _container.Initialize(ColorHelper.DrawColorMap); _currentTitle.InitTitleScreen(); SetFlipTimer(); }
public async Task Initialize(IGraphicContainer container, Rectangle frameRectangle) { _container = container; GameStatus = GameMode.Title; ResizeGame(frameRectangle); await _container.Initialize(); _textManager = new TextManager(_screenCanvas); _scoreManager = new ScoreManager(_textManager); _currentTitle = new TitleScreen(_textManager, _screenCanvas); _options = new Options(_textManager, _screenCanvas); SetFlipTimer(); }