Exemplo n.º 1
0
    /// <summary>
    /// Initializes a new instance of the <see cref="UIManager"/> class.
    /// </summary>
    /// <param name="inputService">The input service.</param>
    /// <exception cref="ArgumentNullException">
    /// <paramref name="inputService"/> is <see langword="null"/>.
    /// </exception>
    public UIManager(IInputService inputService)
    {
      if (inputService == null)
        throw new ArgumentNullException("inputService");

      _sortedScreens = new List<UIScreen>();

      InputService = inputService;
      KeyMap = KeyMap.AutoKeyMap;
      Screens = new UIScreenCollection(this);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="UIManager"/> class.
    /// </summary>
    /// <param name="game">The XNA game instance.</param>
    /// <param name="inputService">The input service.</param>
    /// <exception cref="ArgumentNullException">
    /// <paramref name="game"/> or <paramref name="inputService"/> is <see langword="null"/>.
    /// </exception>
    public UIManager(Microsoft.Xna.Framework.Game game, IInputService inputService)
    {
      if (game == null)
        throw new ArgumentNullException("game");
      if (inputService == null)
        throw new ArgumentNullException("inputService");

      _sortedScreens = new List<UIScreen>();

      GameForm = PlatformHelper.GetForm(game.Window.Handle);

      game.Window.OrientationChanged += OnGameWindowOrientationChanged;

      InputService = inputService;
      KeyMap = KeyMap.AutoKeyMap;
      Screens = new UIScreenCollection(this);
    }