Esempio n. 1
0
        public override void InstallBindings()
        {
            if (_config.FirstLaunch)
            {
                _config.FirstLaunch        = false;
                _config.RuntimeFirstLaunch = true;
            }

            var rtOptions = new LaunchOptions();

            if (Environment.GetCommandLineArgs().Any(x => x.ToLower() == "fpfc"))
            {
                rtOptions.FPFC  = true;
                AltTrail.CapFps = true;
            }

            Container.BindInstance(rtOptions).AsSingle();

            var dirs = SFDirectories.Create();

            Container.BindInstance(dirs);

            Container.BindLoggerAsSiraLogger(_logger);
            Container.BindInstance(_config).AsSingle();
            Container.Bind <PluginManager>().AsSingle();

            Container.Bind <PresetSaveManager>().AsSingle();
            Container.BindInterfacesAndSelfTo <TrailConfig>().AsSingle();

            Container.BindInterfacesAndSelfTo <EmbeddedAssetLoader>().AsSingle();

            Container.Bind <CustomSaberModelLoader>().AsSingle();

            Container.Bind <TextureStore>().AsSingle();

            Container.BindInterfacesAndSelfTo <MainAssetStore>().AsSingle()
            .OnInstantiated <MainAssetStore>(OnMainAssetStoreInstantiated);


            // Model stuff
            Container.Bind <SaberModel>().WithId(ESaberSlot.Left).AsCached().WithArguments(ESaberSlot.Left);
            Container.Bind <SaberModel>().WithId(ESaberSlot.Right).AsCached().WithArguments(ESaberSlot.Right);

            Container.Bind <SaberSet>().AsSingle();

            InstallFactories();
        }