Exemplo n.º 1
0
        protected override void Initialize()
        {
            // UIManager を初期化して登録します。
            uiManager = new UIManager(this);
            uiManager.ScreenFactory = CreateScreenFactory();
            Components.Add(uiManager);

            var fpsCounter = new FpsCounter(this);
            fpsCounter.Content.RootDirectory = "Content";
            fpsCounter.HorizontalAlignment = DebugHorizontalAlignment.Right;
            fpsCounter.SampleSpan = TimeSpan.FromSeconds(2);
            Components.Add(fpsCounter);

            timeRuler = new TimeRuler(this);
            Components.Add(timeRuler);

            updateMarker = timeRuler.CreateMarker();
            updateMarker.Name = "Update";
            updateMarker.BarIndex = 0;
            updateMarker.Color = Color.Cyan;

            drawMarker = timeRuler.CreateMarker();
            drawMarker.Name = "Draw";
            drawMarker.BarIndex = 1;
            drawMarker.Color = Color.Yellow;

            // StorageManager を登録します。
            storageManager = new StorageManager(this);
            storageManager.ContainerSelected += (s, c) =>
            {
                // IBoxService が登録されているならば BoxIntegration を初期化します。
                if (boxManager != null) BoxIntegration.Initialize();
            };
            Components.Add(storageManager);

            // StorageBlockManager を登録します。
            storageBlockManager = new StorageBlockManager(this);

            // AsyncTaskManager を登録します。
            asyncTaskManager = new AsyncTaskManager(this);
            Components.Add(asyncTaskManager);

            // IBoxService を登録します。
            var assemblyFile = "Willcraftia.Net.Box.BlockViewer.ApiKey.dll";
            var apiKeyClassName = "Willcraftia.Net.Box.BlockViewer.ApiKey";
            try
            {
                boxManager = new BoxManager(assemblyFile, apiKeyClassName);
                Services.AddService(typeof(IBoxService), boxManager);

                BoxIntegration = new BoxIntegration(this);
            }
            catch
            {
                // IBoxService を無効とします。
            }

            // マウス カーソルを可視にします。
            IsMouseVisible = true;

            base.Initialize();
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            var fpsCounter = new FpsCounter(this);
            fpsCounter.Content.RootDirectory = "Content";
            fpsCounter.HorizontalAlignment = DebugHorizontalAlignment.Right;
            fpsCounter.SampleSpan = TimeSpan.FromSeconds(2);
            Components.Add(fpsCounter);

            timeRuler = new TimeRuler(this);
            Components.Add(timeRuler);

            updateMarker = timeRuler.CreateMarker();
            updateMarker.Name = "Draw";
            updateMarker.BarIndex = 0;
            updateMarker.Color = Color.Cyan;

            drawMarker = timeRuler.CreateMarker();
            drawMarker.Name = "Draw";
            drawMarker.BarIndex = 1;
            drawMarker.Color = Color.Yellow;

            // テスト用にメモリ上で Block データを作ります。
            //var block = CreateFullFilledBlock();
            var block = CreateOctahedronLikeBlock();
            using (var stream = new MemoryStream())
            {
                blockSerializer.Serialize(stream, block);
                blockData = Encoding.ASCII.GetString(stream.ToArray());
            }

            UpdateStatusString();

            base.Initialize();
        }
Exemplo n.º 3
0
        protected override void Initialize()
        {
            // マウス カーソルを可視にします。
            IsMouseVisible = true;

            // UIManager を初期化して登録します。
            uiManager = new UIManager(this);
            uiManager.ScreenFactory = CreateScreenFactory();
            Components.Add(uiManager);

            // StorageManager を登録します。
            storageManager = new StorageManager(this);
            Components.Add(storageManager);

            // StorageBlockManager を登録します。
            storageBlockManager = new StorageBlockManager(this);

            #region Debug

            var fpsCounter = new FpsCounter(this);
            fpsCounter.Content.RootDirectory = "Content";
            fpsCounter.HorizontalAlignment = DebugHorizontalAlignment.Left;
            fpsCounter.SampleSpan = TimeSpan.FromSeconds(2);
            Components.Add(fpsCounter);

            timeRuler = new TimeRuler(this);
            Components.Add(timeRuler);

            updateMarker = timeRuler.CreateMarker();
            updateMarker.Name = "Update";
            updateMarker.BarIndex = 0;
            updateMarker.Color = Color.Cyan;

            drawMarker = timeRuler.CreateMarker();
            drawMarker.Name = "Draw";
            drawMarker.BarIndex = 1;
            drawMarker.Color = Color.Yellow;

            #endregion

            base.Initialize();
        }
Exemplo n.º 4
0
 /// <summary>
 /// インスタンスを生成します。
 /// </summary>
 /// <param name="timeRuler">TimeRuler。</param>
 /// <param name="id">TimeRuler に割り当てられた ID。</param>
 internal TimeRulerMarker(TimeRuler timeRuler, int id)
 {
     this.timeRuler = timeRuler;
     Id = id;
 }
Exemplo n.º 5
0
 /// <summary>
 /// インスタンスを生成します。
 /// </summary>
 /// <param name="timeRuler">TimeRuler。</param>
 /// <param name="id">TimeRuler に割り当てられた ID。</param>
 internal TimeRulerMarker(TimeRuler timeRuler, int id)
 {
     this.timeRuler = timeRuler;
     Id             = id;
 }