public GameOverScene(Game game, ISceneManager sceneManager, IGraphicsSystem graphicsSystem, IGameSettings gameSettings, IGameLogger logger, IGameKeys gameKeys, IGamePoints gamePoints) : base(game, sceneManager, graphicsSystem, gameSettings, logger, gameKeys) { _gamePoints = gamePoints ?? throw new ArgumentNullException(nameof(gamePoints)); _spriteBatch = new SpriteBatch(game.GraphicsDevice); }
protected BaseScene(Game game, ISceneManager sceneManager, IGraphicsSystem graphicsSystem, IGameSettings gameSettings, IGameLogger logger, IGameKeys gameKeys) { Game = game ?? throw new ArgumentNullException(nameof(game)); SceneManager = sceneManager ?? throw new ArgumentNullException(nameof(sceneManager)); GraphicsSystem = graphicsSystem ?? throw new ArgumentNullException(nameof(graphicsSystem)); GameSettings = gameSettings ?? throw new ArgumentNullException(nameof(gameSettings)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); GameKeys = gameKeys ?? throw new ArgumentNullException(nameof(gameKeys)); }
public GameManager(IGameLogger logger, IFoodManager foodManager, ISnakeGameComponent snake, IGameFieldEntity gameField, IGameSettings gameSettings, IGamePoints gamePoints, ISnakeEntity snakeEntity, ISceneManager sceneManager, Game game, IGraphicsSystem graphicsSystem, IGameKeys gameKeys) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _foodManager = foodManager ?? throw new ArgumentNullException(nameof(foodManager)); _snakeComponent = snake ?? throw new ArgumentNullException(nameof(snake)); _gameField = gameField ?? throw new ArgumentNullException(nameof(gameField)); _gameSettings = gameSettings ?? throw new ArgumentNullException(nameof(gameSettings)); _gamePoints = gamePoints ?? throw new ArgumentNullException(nameof(gamePoints)); _snakeEntity = snakeEntity ?? throw new ArgumentNullException(nameof(snakeEntity)); _sceneManager = sceneManager ?? throw new ArgumentNullException(nameof(sceneManager)); _game = game ?? throw new ArgumentNullException(nameof(game)); _graphicsSystem = graphicsSystem ?? throw new ArgumentNullException(nameof(graphicsSystem)); _gameKeys = gameKeys ?? throw new ArgumentNullException(nameof(gameKeys)); Initialize(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { _logger.Debug("Game.Initialize()"); _graphicsSettings = new GraphicsSettings { IsDebugRenderingEnabled = _gameSettings.IsDebugRenderingEnabled, IsRenderingEnabled = _gameSettings.IsRenderingEnabled }; _gameKeys = new GameKeys(Keys.Space, Keys.D, Keys.R, Keys.Escape, Keys.OemTilde); _inputHandler = new InputHandler(this); Components.Add(_inputHandler); _camera = new OrthographicCamera(GraphicsDevice); base.Initialize(); }
public GameScene(Game game, ISceneManager sceneManager, IGraphicsSystem graphicsSystem, IGameSettings gameSettings, IGameLogger logger, IGameKeys gameKeys) : base( game, sceneManager, graphicsSystem, gameSettings, logger, gameKeys) { _spriteBatch = new SpriteBatch(Game.GraphicsDevice); _debugBatch = new SpriteBatch(Game.GraphicsDevice); _uiBatch = new SpriteBatch(Game.GraphicsDevice); }
public LoadingScene(Game game, ISceneManager sceneManager, IGraphicsSystem graphicsSystem, IGameSettings gameSettings, IGameLogger logger, IGameKeys gameKeys) : base(game, sceneManager, graphicsSystem, gameSettings, logger, gameKeys) { IsLoaded = false; _uiBatch = new SpriteBatch(Game.GraphicsDevice); }
public NewGameScene(Game game, ISceneManager sceneManager, IGraphicsSystem graphicsSystem, IGameSettings gameSettings, IGameLogger logger, IGameKeys gameKeys) : base(game, sceneManager, graphicsSystem, gameSettings, logger, gameKeys) { }