public MainWindowVM(IKernel kernel,
                            IEventAggregator eventAggregator,
                            ITwitchService twitchService,
                            IGuiService guiService,
                            IPreferencesService preferencesService,
                            IUpdateService updateService)
        {
            this.mainViews = new Dictionary <Type, ViewModelBase>();

            this.windowState = WindowState.Normal;

            AssemblyUtil au = AssemblyUtil.Get;

            this.title = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            this.kernel             = kernel;
            this.eventAggregator    = eventAggregator;
            this.twitchService      = twitchService;
            this.guiService         = guiService;
            this.preferencesService = preferencesService;
            this.updateService      = updateService;

            this.ShowMainView <WelcomeViewVM>();

            this.eventAggregator.GetEvent <SearchBeginEvent>().Subscribe(() => this.ShowMainView <VideosLoadingViewVM>());
            this.eventAggregator.GetEvent <SearchCompleteEvent>().Subscribe(() => this.ShowMainView <VideosViewVM>());
            this.eventAggregator.GetEvent <ShowVideosEvent>().Subscribe(() => this.ShowMainView <VideosViewVM>());
            this.eventAggregator.GetEvent <ShowDownloadsEvent>().Subscribe(() => this.ShowMainView <DownloadsViewVM>());
            this.eventAggregator.GetEvent <ShowPreferencesEvent>().Subscribe(() => this.ShowMainView <PreferencesViewVM>());
            this.eventAggregator.GetEvent <ShowInfoEvent>().Subscribe(() => this.ShowMainView <InfoViewVM>());
            this.eventAggregator.GetEvent <PreferencesSavedEvent>().Subscribe(() => this.PreferencesSaved());
        }
Beispiel #2
0
        public DlgBaseVM(SetupApplication bootstrapper, IGuiService guiService)
        {
            _bootstrapper = bootstrapper ?? throw new ArgumentNullException("bootstrapper");
            _guiService   = guiService ?? throw new ArgumentNullException("guiService");

            _currentErrors = new Dictionary <string, string>();
        }
Beispiel #3
0
        public RoomState(IGameState previousState, IGameStateService gameStateService, IGuiService guiService,
                        IInputService inputService, GraphicsDeviceManager graphics,
                        ContentManager content)
        {
            this.gameStateService = gameStateService;
            this.guiService = guiService;
            this.inputService = inputService;
            this.graphics = graphics;
            this.content = content;

            this.previousState = previousState;
            this.mouseMove = new MouseMoveDelegate(mouseMoved);

            this.teamA = new List<Peer>();
            this.teamB = new List<Peer>();

            playerIDLabels = new List<LabelControl>();
            panelVisibility = new List<bool>();
            roomScreen = new Screen(1184, 682);

            Game1.main_console.StartEvent += Start;

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            LoadContent(roomScreen, content);
        }
Beispiel #4
0
        public UserCancelDlgVM(SetupApplication bootstrapper, IGuiService guiService)
            : base(bootstrapper, guiService)
        {
            if (_bootstrapper.IsUpgrade)
            {
                _headline = "Upgrade";
            }
            else
            {
                switch (_bootstrapper.LaunchAction)
                {
                case LaunchAction.Install:
                    _headline = "Installation";
                    break;

                case LaunchAction.Uninstall:
                    _headline = "Uninstallation";
                    break;

                default:
                    throw new ApplicationException("Unsupported LaunchAction '" + _bootstrapper.LaunchAction.ToString() + "'!");
                }
            }

            _headline += " has been cancelled";
        }
Beispiel #5
0
        public ProgressDlgVM(SetupApplication bootstrapper, IGuiService guiService)
            : base(bootstrapper, guiService)
        {
            if (this.bootstrapper.IsUpgrade)
            {
                this.headerText = "Upgrading";
                this.descText   = "Please wait while the Setup Wizard upgrades " + this.bootstrapper.ProductName + " to version " + this.bootstrapper.ProductVersionTrimmed.ToString();
                this.statusText = "Upgrading...";
            }
            else
            {
                switch (this.bootstrapper.LaunchAction)
                {
                case LaunchAction.Install:
                    this.headerText = "Installing " + this.ProductNameVersionDisplay;
                    this.descText   = "Please wait while the Setup Wizard installs " + this.ProductNameVersionDisplay;
                    this.statusText = "Installing...";
                    break;

                case LaunchAction.Uninstall:
                    this.headerText = "Uninstalling " + this.ProductNameVersionDisplay;
                    this.descText   = "Please wait while the Setup Wizard uninstalls " + this.ProductNameVersionDisplay;
                    this.statusText = "Uninstalling...";
                    break;

                default:
                    throw new ApplicationException("Unsupported LaunchAction '" + this.bootstrapper.LaunchAction.ToString() + "'!");
                }
            }

            progressValue = 0;
        }
Beispiel #6
0
        public LobbyState(IGameStateService gameStateService, IGuiService guiService,
                        IInputService inputService, GraphicsDeviceManager graphics, 
                        ContentManager content, String username)
        {
            allRoom = Game1.main_console.ListRooms();

            this.gameStateService = gameStateService;
            this.guiService = guiService;
            this.inputService = inputService;
            this.graphics = graphics;
            this.content = content;

            this.username = username;
            this.page = 0;

            roomIDLabels = new List<LabelControl>();
            roomCapLabels = new List<LabelControl>();
            joinButtons = new List<ButtonControl>();
            panelVisibility = new List<bool>();
            joinEventHandlers = new List<EventHandler>();

            this.mouseMove = new MouseMoveDelegate(mouseMoved);

            lobbyScreen = new Screen(1194, 692);
            /*mainMenuScreen.Desktop.Bounds = new UniRectangle(
              new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10%
              new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80%
            );*/

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            LoadContent(lobbyScreen, content);
        }
Beispiel #7
0
    public override void Begin(params object[] parameters)
    {
        base.Begin(parameters);
        Diagnostics.Log("GameClientState_Turn_Begin.");
        this.EventService = Services.GetService <IEventService>();
        IGuiService service = Services.GetService <IGuiService>();

        Diagnostics.Assert(service != null);
        if (service.GetGuiPanel <LoadingScreen>().IsVisible)
        {
            service.GetGuiPanel <LoadingScreen>().Hide(false);
            service.GetGuiPanel <GameWorldScreen>().Show(new object[0]);
            service.GetGuiPanel <GameOverlayPanel>().Show(new object[0]);
            service.GetGuiPanel <InGameConsolePanel>().Load();
        }
        Amplitude.Unity.View.IViewService service2 = Services.GetService <Amplitude.Unity.View.IViewService>();
        if (service2 != null && (service2.CurrentView == null || service2.CurrentView.GetType() != typeof(WorldView)))
        {
            service2.PostViewChange(typeof(WorldView), new object[0]);
        }
        this.coroutine = Amplitude.Coroutine.StartCoroutine(this.RunAsync(), null);
        string text = AgeLocalizer.Instance.LocalizeString("%RichPresenceInGame" + base.GameClient.Session.SessionMode);

        text = text.Replace("$Name", base.GameClient.Session.GetLobbyData <string>("name", null));
        text = text.Replace("$Turn", (base.GameClient.Session.GetLobbyData <int>("_Turn", 0) + 1).ToString());
        Steamworks.SteamAPI.SteamFriends.SetRichPresence("status", text);
        IAudioEventService service3 = Services.GetService <IAudioEventService>();

        if (service3 != null)
        {
            service3.Play2DEvent("Gui/Interface/EndTurnValid");
        }
    }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Scene"/> class.
 /// </summary>
 /// <param name="gameStateManager">Game state manager the game state belongs to</param>
 public Scene(GameBoxStateManager gameStateManager)
     : base(gameStateManager)
 {
     StateManager = gameStateManager;
     Screen       = new Screen();
     _service     = (IGuiService)gameStateManager.GameServices.GetService(typeof(IGuiService));
 }
        public WizardWindowVM(SetupApplication bootstrapper, IGuiService guiService, IUacService uacService)
        {
            if (bootstrapper == null)
            {
                throw new ArgumentNullException("bootstrapper");
            }

            if (guiService == null)
            {
                throw new ArgumentNullException("guiService");
            }

            if (uacService == null)
            {
                throw new ArgumentNullException("uacService");
            }

            this.bootstrapper = bootstrapper;
            this.guiService   = guiService;
            this.uacService   = uacService;

            this.bootstrapper.CancelProgressRequestedChanged += bootstrapper_CancelProgressRequestedChanged;

            this.CreateViewModels();
        }
Beispiel #10
0
        public DownloadsViewVM(ITwitchService twitchService, IGuiService guiService, IEventAggregator eventAggregator)
        {
            if (twitchService == null)
            {
                throw new ArgumentNullException(nameof(twitchService));
            }

            if (guiService == null)
            {
                throw new ArgumentNullException(nameof(guiService));
            }

            if (eventAggregator == null)
            {
                throw new ArgumentNullException(nameof(eventAggregator));
            }

            this.twitchService   = twitchService;
            this.guiService      = guiService;
            this.eventAggregator = eventAggregator;

            this.twitchService.PropertyChanged += TwitchService_PropertyChanged;

            this.commandLockObject = new object();
        }
Beispiel #11
0
 public UpgradeDlgVM(SetupApplication bootstrapper, IGuiService guiService)
     : base(bootstrapper, guiService)
 {
     this.productName = this.bootstrapper.ProductName;
     this.oldVersion  = this.bootstrapper.RelatedBundleVersion.ToString();
     this.newVersion  = this.bootstrapper.ProductVersionTrimmed.ToString();
 }
        public InfoViewVM(IGuiService guiService)
        {
            AssemblyUtil au = AssemblyUtil.Get;

            this.productName = au.GetProductName() + " " + au.GetAssemblyVersion().Trim();

            this.guiService = guiService;
        }
Beispiel #13
0
 internal ExtensionCore(IGuiService service, ISettingsService settingsStore, ILogger logger)
 {
     _serializer      = new JsonSerializer();
     _guiService      = service;
     _settingsService = settingsStore;
     _logger          = logger;
     _clientsHolder   = new HotReloadClientsHolder();
 }
Beispiel #14
0
        public UpgradeDlgVM(SetupApplication bootstrapper, IGuiService guiService, IUacService uacService)
            : base(bootstrapper, guiService)
        {
            _uacService = uacService;

            _productName = _bootstrapper.ProductName;
            _oldVersion  = _bootstrapper.RelatedBundleVersion.ToString();
            _newVersion  = _bootstrapper.ProductVersionTrimmed.ToString();
        }
Beispiel #15
0
        public DownloadsViewVM(ITwitchService twitchService, IGuiService guiService)
        {
            this.twitchService = twitchService;
            this.guiService    = guiService;

            this.twitchService.PropertyChanged += TwitchService_PropertyChanged;

            this.commandLockObject = new object();
        }
    private void OnInspectCB(GameObject obj)
    {
        IGuiService service = Services.GetService <IGuiService>();

        service.Show(typeof(HeroInspectionModalPanel), new object[]
        {
            this.CurrentHero
        });
    }
Beispiel #17
0
        public VideosViewVM(ITwitchService twitchService, IGuiService guiService, IEventAggregator eventAggregator)
        {
            this.twitchService   = twitchService;
            this.guiService      = guiService;
            this.eventAggregator = eventAggregator;

            this.twitchService.PropertyChanged += TwitchService_PropertyChanged;

            this.commandLockObject = new object();
        }
        public WizardWindowVM(SetupApplication bootstrapper, IGuiService guiService, IUacService uacService)
        {
            _bootstrapper = bootstrapper ?? throw new ArgumentNullException("bootstrapper");
            _guiService   = guiService ?? throw new ArgumentNullException("guiService");
            _uacService   = uacService ?? throw new ArgumentNullException("uacService");

            _bootstrapper.CancelProgressRequestedChanged += Bootstrapper_CancelProgressRequestedChanged;

            CreateViewModels();
        }
Beispiel #19
0
        public static void Init(EnvironmentService devEnviromentService,
                                IGuiService guiService, ISettingsService settingsService)
        {
            _devEnviromentService = devEnviromentService;
            _guiService           = guiService;
            _settingsService      = settingsService;

            RegisteredCommandInstances.Add(HotReloadCommands.Enable, null);
            RegisteredCommandInstances.Add(HotReloadCommands.Disable, null);
        }
Beispiel #20
0
        private string GetSkillNameFromConfig(SkillConfig s)
        {
            IGuiService service = Services.GetService <IGuiService>();
            GuiElement  guiElement;

            if (!service.GuiPanelHelper.TryGetGuiElement(s.BaseName, out guiElement))
            {
                mod.Log("Attempted to find a GuiElement, but couldn't find one with name: " + s.BaseName);
                return(null);
            }
            return(AgeLocalizer.Instance.LocalizeString(guiElement.Title));
        }
 internal ExtensionCore(IGuiService service, ISettingsService settingsStore, ILogger logger)
 {
     _guiService                  = service;
     _settingsService             = settingsStore;
     _logger                      = logger;
     _clientsHolder               = new HotReloadClientsHolder();
     _supportedResourceExtensions = new HashSet <string>
     {
         XamlResourceExtension,
         CssResourceExtension
     };
 }
    public void SelectFaction(Faction faction)
    {
        IGuiService service = Services.GetService <IGuiService>();

        if (service != null)
        {
            MenuNewGameScreen guiPanel = service.GetGuiPanel <MenuNewGameScreen>();
            if (guiPanel != null)
            {
                guiPanel.SelectFaction(this.EmpireIndex, faction);
            }
        }
    }
        public PluginInitializer(RiderEnvironmentService environmentService, IGuiService service,
                                 ISettingsService settingsStore)
        {
            if (!RegisteredCommandInstances.ContainsKey(HotReloadCommands.Enable))
            {
                RegisteredCommandInstances.Add(HotReloadCommands.Enable, new EnvCommandStub());
            }

            if (!RegisteredCommandInstances.ContainsKey(HotReloadCommands.Disable))
            {
                RegisteredCommandInstances.Add(HotReloadCommands.Disable, new EnvCommandStub());
            }

            Main.Init(environmentService, RegisteredCommandInstances, service, settingsStore);
        }
Beispiel #24
0
        public VideosViewVM(ITwitchService twitchService,
                            IGuiService guiService,
                            IEventAggregator eventAggregator,
                            IPreferencesService preferencesService,
                            IFilenameService filenameService)
        {
            this.twitchService      = twitchService;
            this.guiService         = guiService;
            this.eventAggregator    = eventAggregator;
            this.preferencesService = preferencesService;
            this.filenameService    = filenameService;

            this.twitchService.PropertyChanged += TwitchService_PropertyChanged;

            this.commandLockObject = new object();
        }
Beispiel #25
0
        public DlgBaseVM(SetupApplication bootstrapper, IGuiService guiService)
        {
            if (bootstrapper == null)
            {
                throw new ArgumentNullException("bootstrapper");
            }

            if (guiService == null)
            {
                throw new ArgumentNullException("guiService");
            }

            this.bootstrapper = bootstrapper;
            this.guiService   = guiService;

            this.currentErrors = new Dictionary <string, string>();
        }
Beispiel #26
0
 public static void Init(EnvironmentService environmentService,
                         Dictionary <HotReloadCommands, IEnvironmentCommand> enviromentCommands,
                         IGuiService service, ISettingsService settingsStore)
 {
     if (!_isInitialized)
     {
         var serializer = new JsonSerializer();
         SharedGlobals.DefaultSerializedConnectionItemsValue = serializer.Serialize(
             new List <ConnectionItem>
         {
             new ConnectionItem(SharedGlobals.DefaultProtocolValue, SharedGlobals.DefaultIpAddressValue,
                                SharedGlobals.DefaultPortValue)
         });
         _extensionCore = new ExtensionCore(service, settingsStore, new OutputLogger());
         _extensionCore.Init(environmentService, enviromentCommands);
         _isInitialized = true;
     }
 }
Beispiel #27
0
        public DownloadWindow(IGuiService guiService)
        {
            this.guiService = guiService;

            InitializeComponent();

            WindowChrome windowChrome = new WindowChrome()
            {
                CaptionHeight         = 51,
                CornerRadius          = new CornerRadius(0),
                GlassFrameThickness   = new Thickness(0),
                NonClientFrameEdges   = NonClientFrameEdges.None,
                ResizeBorderThickness = new Thickness(0),
                UseAeroCaptionButtons = false
            };

            WindowChrome.SetWindowChrome(this, windowChrome);

            this.Loaded += SearchRequestView_Loaded;
        }
        public UpdateInfoWindow(IGuiService guiService)
        {
            this.guiService = guiService;

            InitializeComponent();

            WindowChrome windowChrome = new WindowChrome()
            {
                CaptionHeight         = 51,
                CornerRadius          = new CornerRadius(0),
                GlassFrameThickness   = new Thickness(0),
                NonClientFrameEdges   = NonClientFrameEdges.None,
                ResizeBorderThickness = new Thickness(6),
                UseAeroCaptionButtons = false
            };

            WindowChrome.SetWindowChrome(this, windowChrome);

            this.SourceInitialized += LogWindow_SourceInitialized;
        }
Beispiel #29
0
        public MainMenuState(IGameStateService gameStateService, IGuiService guiService, 
                        IInputService inputService, GraphicsDeviceManager graphics, ContentManager content)
        {
            this.gameStateService = gameStateService;
            this.guiService = guiService;
            this.inputService = inputService;
            this.graphics = graphics;
            this.content = content;

            this.mouseMove = new MouseMoveDelegate(mouseMoved);
            this.keyHit = new KeyDelegate(keyboardEntered);

            mainMenuScreen = new Screen(349, 133);
            /*mainMenuScreen.Desktop.Bounds = new UniRectangle(
              new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10%
              new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80%
            );*/

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            LoadContent(mainMenuScreen, content);
        }
Beispiel #30
0
    public override void Execute(Army army, global::PlayerController playerController, out Ticket ticket, EventHandler <TicketRaisedEventArgs> ticketRaisedEventHandler, params object[] parameters)
    {
        ticket = null;
        PointOfInterest pointOfInterest = null;

        if (parameters != null && parameters.Length != 0 && parameters[0] is PointOfInterest)
        {
            pointOfInterest = (parameters[0] as PointOfInterest);
        }
        else if (parameters != null && parameters.Length != 0 && parameters[0] is Village)
        {
            pointOfInterest = (parameters[0] as Village).PointOfInterest;
        }
        DepartmentOfForeignAffairs agency             = army.Empire.GetAgency <DepartmentOfForeignAffairs>();
        DiplomaticRelation         diplomaticRelation = null;

        if (pointOfInterest != null && pointOfInterest.Empire != null)
        {
            diplomaticRelation = agency.GetDiplomaticRelation(pointOfInterest.Empire);
        }
        ArmyAction.FailureFlags.Clear();
        if (diplomaticRelation == null || diplomaticRelation.State == null || diplomaticRelation.State.Name != DiplomaticRelationState.Names.Alliance)
        {
            OrderConvertVillage orderConvertVillage = new OrderConvertVillage(army.Empire.Index, army.GUID, pointOfInterest.WorldPosition);
            orderConvertVillage.NumberOfActionPointsToSpend = base.GetCostInActionPoints();
            Diagnostics.Assert(playerController != null);
            playerController.PostOrder(orderConvertVillage, out ticket, ticketRaisedEventHandler);
        }
        else if (pointOfInterest != null && pointOfInterest.Empire != null && pointOfInterest.Empire is MajorEmpire)
        {
            IGuiService service = Services.GetService <IGuiService>();
            service.GetGuiPanel <WarDeclarationModalPanel>().Show(new object[]
            {
                pointOfInterest.Empire,
                "Convert"
            });
        }
    }
Beispiel #31
0
        public ShipRefitScene(IReadOnlyList<Entity> fleet, EntityWorld originalWorld)
        {
            if (fleet == null) throw new ArgumentException("Fleet is null.");
            if (fleet.Count < 0) throw new ArgumentException("Fleet is empty.");
            Fleet = new List<FleetEntry>();

            OrigWorld = originalWorld;

            foreach (var entity in fleet)
            {
                var shipComponent = entity.GetComponent<ShipComponent>();
                if (shipComponent == null) continue;
                if (shipComponent.Variant == null)
                    shipComponent.Variant = CreateVariantFromEntity(entity);
                Fleet.Add(new FleetEntry {
                    Variant = shipComponent.Variant,
                    OrigEntity = entity
                });
            }

            GuiService = ServiceLocator.Instance.GetService<IGuiService>();
            _mouse = ServiceLocator.Instance.GetService<IMouseService>();
        }
Beispiel #32
0
        public CreateRoomState(IGameStateService gameStateService, IGuiService guiService,
                        IInputService inputService, GraphicsDeviceManager graphics, 
                        ContentManager content)
        {
            this.gameStateService = gameStateService;
            this.guiService = guiService;
            this.inputService = inputService;
            this.graphics = graphics;
            this.content = content;

            this.previousState = gameStateService.ActiveState;
            this.mouseMove = new MouseMoveDelegate(mouseMoved);

            createRoomScreen = new Screen(458, 274);
            /*mainMenuScreen.Desktop.Bounds = new UniRectangle(
              new UniScalar(0.1f, 0.0f), new UniScalar(0.1f, 0.0f), // x and y = 10%
              new UniScalar(0.8f, 0.0f), new UniScalar(0.8f, 0.0f) // width and height = 80%
            );*/

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);

            LoadContent(createRoomScreen, content);
        }
Beispiel #33
0
    private void ShowCitySelectionPanel()
    {
        List <City>             list   = new List <City>();
        DepartmentOfTheInterior agency = this.empire.GetAgency <DepartmentOfTheInterior>();

        for (int i = 0; i < agency.Cities.Count; i++)
        {
            City city = agency.Cities[i];
            if (Booster.IsTargetValid(this.guiStackedBooster.BoosterDefinition, city))
            {
                list.Add(city);
            }
        }
        IGuiService service = Services.GetService <IGuiService>();

        Diagnostics.Assert(service != null);
        service.Show(typeof(CitySelectionModalPanel), new object[]
        {
            base.gameObject,
            "BoosterTarget",
            list.AsReadOnly()
        });
    }
Beispiel #34
0
        public FinishedDlgVM(SetupApplication bootstrapper, IGuiService guiService)
            : base(bootstrapper, guiService)
        {
            if (_bootstrapper.IsUpgrade)
            {
                _headline = "Successfully upgraded " + _bootstrapper.ProductName + " " + _bootstrapper.RelatedBundleVersion.ToString() + " to version " + _bootstrapper.ProductVersionTrimmed.ToString();
            }
            else
            {
                switch (_bootstrapper.LaunchAction)
                {
                case LaunchAction.Install:
                    _headline = "Successfully installed " + ProductNameVersionDisplay;
                    break;

                case LaunchAction.Uninstall:
                    _headline = "Successfully uninstalled " + ProductNameVersionDisplay;
                    break;

                default:
                    throw new ApplicationException("Unsupported LaunchAction '" + _bootstrapper.LaunchAction.ToString() + "'!");
                }
            }
        }
 public override void Initialize()
 {
     _guiService = Game.Services.GetService<IGuiService>();
     base.Initialize();
 }
Beispiel #36
0
 public GuiSystem()
     : base(Aspect.All(typeof(GuiComponent)))
 {
     _service = ServiceLocator.Instance.GetService<IGuiService>();
 }
Beispiel #37
0
        public GameStart(IGameStateService gameStateService, IGuiService guiService,
                        IInputService inputService, GraphicsDeviceManager graphics, 
                        ContentManager content, List<Peer> teamA, List<Peer> teamB)
        {
            this.gameStateService = gameStateService;
            this.guiService = guiService;
            this.inputService = inputService;
            this.graphics = graphics;
            this.Content = content;
            this.previousState = gameStateService.ActiveState;

            this.numberOfPlayers = Game1.main_console.Room.Members.Count();
            gameStartScreen = new Screen(680, 680);

            spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
            Game1.main_console.GameEvent += ProcessMessages;

            this.teamA = teamA;
            this.teamB = teamB;
            idxA = 0;
            idxB = 0;

            LoadContent();
        }
Beispiel #38
0
 public MainGameScene()
 {
     _guiService = ServiceLocator.Instance.GetService<IGuiService>();
 }
 public UpdateInfoWindowVM(IGuiService guiService)
 {
     this.guiService = guiService;
 }
Beispiel #40
0
        public override void LoadContent()
        {
            Instance = this;

            World.CreateComponentPool<BulletComponent>(200, 200);

            int depth = 1;
            World.SystemManager.SetSystem(new GridRendererSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            World.SystemManager.SetSystem(new BackgroundRendererSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            //World.SystemManager.SetSystem(new ShipRendererSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            World.SystemManager.SetSystem(new ParticleSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            World.SystemManager.SetSystem(new BoundingBoxRendererSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            World.SystemManager.SetSystem(new GenericDrawableRendererSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            World.SystemManager.SetSystem(new PhysicsDebugDrawSystem(), Artemis.Manager.GameLoopType.Draw, depth++);
            //World.SystemManager.SetSystem(new GuiSystem(), Artemis.Manager.GameLoopType.Draw, depth++);

            int priority = 1;
            World.SystemManager.SetSystem(new CameraControlSystem(), Artemis.Manager.GameLoopType.Update, priority++);
            World.SystemManager.SetSystem(new RigidBodySystem(), Artemis.Manager.GameLoopType.Update, priority++);
            //World.SystemManager.SetSystem(new MouseControlledTransformSystem(), Artemis.Manager.GameLoopType.Update, priority++);
            //World.SystemManager.SetSystem(new BoundingBoxSelectionSystem(), Artemis.Manager.GameLoopType.Update, priority++);

            World.SystemManager.SetSystem(new CoroutineSystem(), Artemis.Manager.GameLoopType.Update, priority++);
            //World.SystemManager.SetSystem(new PlayerShipControlSystem(), Artemis.Manager.GameLoopType.Update, priority++);
            World.SystemManager.SetSystem(new ShipUpdateSystem(), Artemis.Manager.GameLoopType.Update, priority++);
            //World.SystemManager.SetSystem(new StorySystem(), Artemis.Manager.GameLoopType.Update, priority++);
            World.SystemManager.SetSystem(new PhysicsSystem(), Artemis.Manager.GameLoopType.Update, priority++);

            _guiService = ServiceLocator.Instance.GetService<IGuiService>();
            InitializeDocument();
            _bgEntity = ServiceLocator.Instance.GetService<SpaceBackgroundGeneratorService>().GenerateBackground(World, GetHashCode());
            World.CreateCamera(Constants.ActiveCameraTag, ServiceLocator.Instance.GetService<GraphicsDevice>());

            World.InitializeAll();
        }