Пример #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            HandleMouse.SetMouseState(this);
            var mouseLoc = HandleMouse.RelativeMouseLocation;

            GameCamera.UpdateCamera(this.GraphicsDevice.Viewport, mouseLoc);

            SpriteBatch.Begin(transformMatrix: GameCamera.Transform, sortMode: SpriteSortMode.Deferred);

            GraphicsDevice.Clear(Color.LawnGreen);
            BoardState.ActiveBoard.Draw();
            #region ray test
            //if (BoardState.ActiveBoard.DebugLines.Any())
            //{
            //    BoardState.ActiveBoard.DebugLines.ForEach(l =>
            //    {
            //        l.DrawDebugStrings();
            //        l.Line.Draw();
            //    });
            //    //var debugRay = BoardState.ActiveBoard.DebugLines[debugRayIndex];
            //    //debugRay.Line.Draw();
            //    //debugRay.DrawDebugStrings();
            //    //;
            //}
            #endregion

            foreach (var hexUI in ActiveHexUIElements.AvailibleUIElements)
            {
                hexUI.Value.Draw();
            }
            //ActorActions.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
            BoardState.CheckBoardStateLoop();

            ;
            //should be moved somewhere else... :TODO

            SpriteBatch.End();
            // base.Draw(gameTime);
        }