示例#1
0
        /// <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);
        }
示例#2
0
        public async Task Initialize(IGraphicContainer container, Rectangle frameRectangle)
        {
            _container = container;

            GameStatus = GameMode.Title;
            ResizeGame(frameRectangle);

            await _container.Initialize(ColorHelper.DrawColorMap);

            _currentTitle.InitTitleScreen();

            SetFlipTimer();
        }
示例#3
0
        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();
        }