예제 #1
0
        public void StartImitation(IEnumerable <IRobot> robots)
        {
            foreach (var robot in robots)
            {
                Console.WriteLine($"Welcome new robot \"{robot}\" in this cruel world!");
                _world.SetRobot(robot);
                _renderer.Render(_world);

                while (robot.Alive && robot.HasOrders)
                {
                    _commandExecutor.ExecuteNextCommand(robot);
                    _renderer.Render(_world);
                }
                _world.RemoveRobot(robot);
                Console.WriteLine("=====================");
            }
        }
예제 #2
0
        public void OnRender(GameTime gameTime)
        {
            _worldRenderer.Render(_world, _camera);

            _spriteBatch.Begin();

            var crosshairPosition = new Vector2(
                (_graphicsDevice.Viewport.Width - _crosshairTexture.Width) / 2,
                (_graphicsDevice.Viewport.Height - _crosshairTexture.Height) / 2);

            _spriteBatch.Draw(_crosshairTexture, crosshairPosition, Color.White);

            _spriteBatch.End();
        }