示例#1
0
        /// <summary>
        /// Initializes all required modules for the game.
        /// </summary>
        protected virtual void InitializeModules()
        {
            UnityThread.Initialize();

            Dependencies.CacheAs <IGame>(this);

            Dependencies.CacheAs <IPlatformHost>(platformHost = PlatformHost.CreateHost());
            Dependencies.CacheAs <DeepLinker>(deepLinker      = platformHost.CreateDeepLinker());

            Dependencies.CacheAs <IEnvConfiguration>(envConfiguration = new EnvConfiguration(EnvType.Production));

            Dependencies.CacheAs <IModeManager>(modeManager = new ModeManager());

            Dependencies.CacheAs <INotificationBox>(notificationBox = new NotificationBox());

            Dependencies.CacheAs <IGameConfiguration>(gameConfiguration     = new GameConfiguration());
            Dependencies.CacheAs <IMapConfiguration>(mapConfiguration       = new MapConfiguration());
            Dependencies.CacheAs <IMapsetConfiguration>(mapsetConfiguration = new MapsetConfiguration());

            Dependencies.CacheAs <IFontManager>(fontManager       = new FontManager());
            Dependencies.CacheAs <IAtlas <Sprite> >(spriteAtlas   = new ResourceSpriteAtlas());
            Dependencies.CacheAs <IAtlas <AudioClip> >(audioAtlas = new ResourceAudioAtlas());

            Dependencies.CacheAs <IMusicCacher>(musicCacher           = new MusicCacher());
            Dependencies.CacheAs <IBackgroundCacher>(backgroundCacher = new BackgroundCacher());
            Dependencies.CacheAs <IWebImageCacher>(webImageCacher     = new WebImageCacher());
            Dependencies.CacheAs <IWebMusicCacher>(webMusicCacher     = new WebMusicCacher());

            Dependencies.CacheAs <IMusicController>(musicController = MusicController.Create());

            Dependencies.CacheAs <ISoundTable>(soundTable = new DefaultSoundTable(audioAtlas));
            Dependencies.CacheAs <ISoundPool>(soundPool   = new SoundPool(soundTable));

            Dependencies.CacheAs <IMapsetStore>(mapsetStore   = new MapsetStore(modeManager));
            Dependencies.CacheAs <IMapSelection>(mapSelection = new MapSelection(musicCacher, backgroundCacher, gameConfiguration, mapsetConfiguration, mapConfiguration));
            Dependencies.CacheAs <IMapManager>(mapManager     = new MapManager(mapsetStore, notificationBox, mapSelection));
            Dependencies.CacheAs <IMetronome>(metronome       = new Metronome()
            {
                AudioController = musicController
            });
            Dependencies.CacheAs <IMusicPlaylist>(musicPlaylist = new MusicPlaylist());

            Dependencies.CacheAs <IDownloadStore>(downloadStore = new DownloadStore());
            Dependencies.CacheAs <IApi>(api = new Api(envConfiguration, notificationBox, deepLinker));

            Dependencies.CacheAs <IUserManager>(userManager = new UserManager(api, Dependencies));
            Dependencies.CacheAs <IRecordStore>(recordStore = new RecordStore());

            Dependencies.CacheAs <IRootMain>(rootMain                 = RootMain.Create(Dependencies));
            Dependencies.CacheAs <IRoot3D>(root3D                     = Root3D.Create(Dependencies));
            Dependencies.CacheAs <IColorPreset>(colorPreset           = new ColorPreset());
            Dependencies.CacheAs <IAnimePreset>(animePreset           = new AnimePreset());
            Dependencies.CacheAs <IScreenNavigator>(screenNavigator   = new ScreenNavigator(rootMain));
            Dependencies.CacheAs <IOverlayNavigator>(overlayNavigator = new OverlayNavigator(rootMain));
            Dependencies.CacheAs <IDropdownProvider>(dropdownProvider = new DropdownProvider(rootMain));

            Dependencies.CacheAs <ITemporaryStore>(temporaryStore = new TemporaryStore());
        }
示例#2
0
        private void TempStoreSPSyncSettingsList(bool delete)
        {
            var spProfileSyncSettingsListKey = Request.QueryString[SPProfileSyncControl.SettingsListKeyName];

            if (!String.IsNullOrEmpty(spProfileSyncSettingsListKey))
            {
                spSyncSettingsList = new SPProfileSyncProviderList(TemporaryStore.Get(new Guid(spProfileSyncSettingsListKey), delete));
            }
        }
        private void ClearTempStore()
        {
            var key = Request.QueryString["spobjectmanagerlist"];

            if (key != null)
            {
                TemporaryStore.Get(new Guid(key), delete: true);
            }
        }
        private IntegrationProviders FromTempStore(bool delete = false)
        {
            var key = Request.QueryString["spobjectmanagerlist"];

            if (key != null)
            {
                return(allProviders = new IntegrationProviders(TemporaryStore.Get(new Guid(key), delete)));
            }
            return(null);
        }
示例#5
0
        /// <summary>
        /// Initializes a replay writer instance for replay recording.
        /// </summary>
        private void InitReplayWriter()
        {
            // TODO: Check whether replay save option is enabled.

            if (replayWriter != null)
            {
                replayFile        = TemporaryStore.GetReplayDataFile(Guid.NewGuid().ToString());
                replayWriteStream = new BinaryWriter(replayFile.OpenWrite());
                replayWriter.StartStream(replayWriteStream);
            }
        }
        private static string AddBtnLink(IntegrationProviders providers, string baseUrl)
        {
            const string functionCallback = "AddManager";
            string       key         = TemporaryStore.Add(providers.ToXml()).ToString();
            string       queryString = "?mode=add&spobjectmanagerlist=" + key;

            return(String.Format("javascript: Telligent_Modal.Open('{0}', {1}, {2}, {3})",
                                 String.Concat(baseUrl, EditPageRelativeUrl, queryString),
                                 Width,
                                 Height,
                                 functionCallback));
        }
示例#7
0
        protected override void OnPreRender(EventArgs e)
        {
            IntegrationProviders list = Providers;

            ProcessSubmitedData(list);
            Providers = list;
            string key        = TemporaryStore.Add(list.ToXml()).ToString();
            var    presenters = list.Collection.Select(provider => new IntegrationManagerPresenter(provider, key, BaseUrl)).ToList();

            Bind(presenters, true);
            base.OnPreRender(e);
            SetControlStyles();
        }
        protected override void OnPreRender(EventArgs e)
        {
            if (Page.IsPostBack)
            {
                syncSettingsList = new SPProfileSyncProviderList(hdnSyncSettingsList.Value);
            }
            ProcessSubmitedData(syncSettingsList);
            hdnSyncSettingsList.Value = syncSettingsList.ToXml();
            string syncSettingsListKey = TemporaryStore.Add(syncSettingsList.ToXml()).ToString();
            var    presenters          = (from settings in syncSettingsList.All()
                                          orderby settings.Id
                                          select new SPProfileSyncPresenter(settings, syncSettingsList, BaseUrl, syncSettingsListKey)).ToList();

            Bind(presenters, true);
            base.OnPreRender(e);
            SetControlStyles();
        }