Exemplo n.º 1
0
 public void AddUI(IGameUI _gameUI)
 {
     if (_gameUI != null)
     {
         this.gameUIs_.Add(_gameUI);
     }
 }
Exemplo n.º 2
0
 internal GraphicsHandler(IGameUI ui, Control gameArea)
 {
     this.ui     = ui;
     GameArea    = new GameArea(GraphicsConstants.GridAreaSize, gameArea, OnPaint);
     screenImage = new Bitmap(GraphicsConstants.GridAreaSize.Width, GraphicsConstants.GridAreaSize.Height);
     tileImage   = new Bitmap(GraphicsConstants.GridAreaSize.Width, GraphicsConstants.GridAreaSize.Height);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Implementação de <see cref="IInventory.Initialize"/>
        /// </summary>
        public void Initialize()
        {
            PlayerPrefs = DependencyInjector.Retrieve <IPlayerPrefs>();
            GameService = DependencyInjector.Retrieve <IGameService>();
            GameUI      = DependencyInjector.Retrieve <IGameUI>();

            LoadInventory();
        }
Exemplo n.º 4
0
        public static void StartEngine(Settings settings, List <string> sequences, IGameUI ui)
        {
            var engine = new GameEngine(settings);

            for (var i = 0; i < sequences.Count; i++)
            {
                var result = engine.Run(sequences[i]);
                ui.ShowMessage(result, $"Sequence {i + 1}: ");

                engine.ResetGame();
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Resolve references to non-service entities.
        /// Subscribe to events.
        /// </summary>
        void Start() {

            // get registry lookups

            planet = registry.LookUp<IPlanet>("Planet");

            gameUI = registry.LookUp<IGameUI>("GameUI");

            // subscribe to events

            time.CountdownFinished += OnCountdownFinished;

            gameUI.onGameReady += OnGameReady;

            // turn on controls

            shipController.Connect();

            // start the first wave

            gameUI.TriggerWaveStartAnimation();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initialize UI manager (mostly load resources and set some defaults).
        /// </summary>
        /// <param name="contentManager">Content manager.</param>
        /// <param name="theme">Which UI theme to use (see options in Content/GeonBit.UI/themes/). This affect the appearance of all textures and effects.</param>
        static public UserInterface Initialize(IGameUI igame, ContentManager contentManager, string program, string theme, GraphicsDeviceManager graphics)
        {
            if (_content == null) //static
            {
                // store the content manager
                _content = contentManager;

                // init resources (textures etc)
                Resources.LoadContent(_content, program, igame.Game, theme);
            }

            var ui = new UserInterface(igame.GetMouseInputProvider(), igame.GetKeyboardInputProvider());

            // create a default active user interface

            ui.Active = ui;

            ui.Active.Graphics = graphics;

            ui.Active.GameUI = igame;

            return(ui);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Executado quando o jogo inicia
 /// </summary>
 public void Start()
 {
     m_GameUI = DependencyInjector.Retrieve <IGameUI>();
 }
Exemplo n.º 8
0
 private protected Game(IGameUI owner, Control gameArea)
 {
     GraphicsHandler = new GraphicsHandler(owner, gameArea);
     InputHandler    = new InputHandler();
     SoundHandler    = new SoundHandler();
 }
Exemplo n.º 9
0
 private void AddGameUI(IGameUI ui)
 {
     ui.IsEnabled = !ToolMode.IsEnabled;
     _gameUis.Add(ui);
 }
Exemplo n.º 10
0
 public GameManager(ISerializer serializer, IGameUI gameUI)
 {
     _serializer = serializer;
     _gameUI     = gameUI;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initialize UI manager (mostly load resources and set some defaults).
 /// </summary>
 /// <param name="contentManager">Content manager.</param>
 /// <param name="program">Program name for runtime resources</param>
 /// <param name="theme">Which UI theme to use. This affect the appearance of all textures and effects.</param>
 static public void Initialize(IGameUI igame, ContentManager contentManager, string program, BuiltinThemes theme, GraphicsDeviceManager graphics)
 {
     Initialize(igame, contentManager, program, theme.ToString(), graphics);
 }
Exemplo n.º 12
0
 public Game(IGameUI ui)
 {
     _ui = ui;
 }