Ejemplo n.º 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());
        }
Ejemplo n.º 2
0
        public LoginForm(IPlatformHost host, string initialRedAlertText = "", bool registerTabEnabled = true, bool enableLoginName = true)
		{
            Contract.Requires(host != null);
             
			InitializeComponent();
            if (!registerTabEnabled)
		    {
		        tabControlLoginRegister.Controls.Remove(tabPageRegister);
		    }
            textBoxLoginName.Enabled = enableLoginName;

            _skydoxServiceUrl = host.Url;
			_initialRedAlertText = initialRedAlertText;

            LoginName = OptionApi.GetString("SendLinkCloudStorageLoginName");


            textBoxLoginName.TextChanged += OnTextBoxChanged;
            textBoxLoginPassword.TextChanged += OnTextBoxChanged;
            textBoxRegisterName.TextChanged += OnTextBoxChanged;
            textBoxConfirmPassword.TextChanged += OnTextBoxChanged;
            textBoxRegisterPassword.TextChanged += OnTextBoxChanged;
		}
Ejemplo n.º 3
0
 protected abstract PlatformBase CreatePlatformInternal(IPlatformRuntimeContext platformRuntimeContext, IPlatformReferenceContext platformReferenceContext, IPlatformService platformService, IPlatformHost platformHost);
Ejemplo n.º 4
0
        public IPlatform CreatePlatform(IPlatformRuntimeContext platformRuntimeContext, IPlatformReferenceContext platformReferenceContext, IPlatformService platformService, IPlatformHost platformHost)
        {
            IPlatform platform;

            if (platformReferenceContext == null)
            {
                if (this.defaultPlatformReferenceContext == null)
                {
                    this.defaultPlatformReferenceContext = new DefaultPlatformReferenceContext(this.RuntimeFramework);
                }
                platformReferenceContext = this.defaultPlatformReferenceContext;
            }
            using (IEnumerator <IPlatform> enumerator = this.platformTable.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    IPlatform current = enumerator.Current;
                    if (!platformReferenceContext.Equals(current.Metadata.ReferenceContext))
                    {
                        continue;
                    }
                    this.platformTable[current] = this.platformTable[current] + 1;
                    platform = current;
                    return(platform);
                }
                PlatformBase platformBase = this.CreatePlatformInternal(platformRuntimeContext, platformReferenceContext, platformService, platformHost);
                platformBase.Initialize();
                platformBase.PlatformHost = platformHost;
                RuntimeGeneratedTypesHelper.RegisterRuntimeAssemblies(platformBase.Metadata);
                this.OnPlatformCreated(new PlatformEventArgs(platformBase));
                this.platformTable.Add(platformBase, 1);
                return(platformBase);
            }
            return(platform);
        }
Ejemplo n.º 5
0
 public PlatformSession(IPlatformHost host)
 {
     Host = host;
 }