2 using System.Collections.Generic;
3 using System.Diagnostics;
12 /// Func<SST.ステージ.演奏.演奏ステージ> 演奏ステージインスタンスを取得する
25 public フェーズ 現在のフェーズ { get; protected set; } = フェーズ.初期状態;
28 public Action BGMを終了する = null;
29 public Func<SST.ステージ.演奏.演奏ステージ> 演奏ステージインスタンスを取得する = null;
33 this.子リスト.Add( this.背景動画 = new 動画( @"$(Static)\images\結果画面BGV.mp4", StrokeStyleT.Config.動画デコーダのキューサイズ ) );
34 this.子リスト.Add( this.背景画像 = new 画像( @"$(Static)\images\結果画面 背景.png" ) );
35 this.子リスト.Add( this.結果表示パラメータパネル = new 画像( @"$(Static)\images\結果画面 パラメータパネル.png" ) );
36 this.子リスト.Add( this.結果表示パラメータ = new 画像フォント( @"$(Static)\images\結果画面 パラメータフォント.png", @"$(Static)\images\結果画面 パラメータフォント矩形リスト.xml" ) );
38 protected override void On活性化( デバイスリソース dr )
40 FDK.Log.Info( "結果ステージを開始します。" );
42 this.背景動画.ループ再生する = true;
43 this.現在のフェーズ = フェーズ.表示中;
45 protected override void On非活性化( デバイスリソース dr )
47 FDK.Log.Info( "結果ステージを終了します。" );
49 this.BGMを終了する?.Invoke(); // ここでBGMを終了する。
51 public override void 進行描画する( デバイスリソース dr )
55 this.背景動画.進行描画する( dr, new SharpDX.RectangleF( 0f, 0f, dr.設計画面サイズdpx.Width, dr.設計画面サイズdpx.Height ) );
56 this.背景画像.描画する( dr, 0f, 0f );
60 this.結果表示パラメータパネル.描画する( dr, 60f, 196f );
62 var 演奏ステージ = this.演奏ステージインスタンスを取得する();
63 var hitTypes = new[] { 演奏.ヒット判定種別.PERFECT, 演奏.ヒット判定種別.GREAT, 演奏.ヒット判定種別.GOOD, 演奏.ヒット判定種別.POOR, 演奏.ヒット判定種別.MISS, 演奏.ヒット判定種別.AUTO };
66 foreach( var hitType in hitTypes )
67 総数 += 演奏ステージ.ヒットした回数[ hitType ];
71 foreach( var hitType in hitTypes )
73 int 回数 = 演奏ステージ.ヒットした回数[ hitType ];
74 double 割合 = ( 0 < 総数 ) ? ( 回数 * 100.0 / 総数 ) : 0.0;
75 this.結果表示パラメータ.描画する( dr, Xdpx, Ydpx, $"{回数:00000}({割合:000.0}%)" );
83 StrokeStyleT.すべての入力デバイスをポーリングする();
85 // Enter or ESC 押下 → ステージ終了。
86 if( StrokeStyleT.キーボード入力.キーが押された( SharpDX.DirectInput.Key.Return ) ||
87 StrokeStyleT.キーボード入力.キーが押された( SharpDX.DirectInput.Key.Escape ) )
89 this.現在のフェーズ = フェーズ.終了;
93 protected readonly FDK.メディア.動画 背景動画;
94 protected readonly FDK.メディア.画像 背景画像;
95 protected readonly FDK.メディア.画像 結果表示パラメータパネル;
96 protected readonly FDK.メディア.画像フォント 結果表示パラメータ;