OSDN Git Service

#23670 エラー発生時強制終了する前に例外の内容をダイアログ表示するようにした。
[dtxmania/dtxmania.git] / DTXManiaプロジェクト / コード / スコア、曲 / Cスコア.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Runtime.InteropServices;\r
5 \r
6 namespace DTXMania\r
7 {\r
8         internal class Cスコア\r
9         {\r
10                 // プロパティ\r
11 \r
12                 public STScoreIni情報 ScoreIni情報;\r
13                 [StructLayout( LayoutKind.Sequential )]\r
14                 public struct STScoreIni情報\r
15                 {\r
16                         public DateTime 最終更新日時;\r
17                         public long ファイルサイズ;\r
18 \r
19                         public STScoreIni情報( DateTime 最終更新日時, long ファイルサイズ )\r
20                         {\r
21                                 this.最終更新日時 = 最終更新日時;\r
22                                 this.ファイルサイズ = ファイルサイズ;\r
23                         }\r
24                 }\r
25 \r
26                 public STファイル情報 ファイル情報;\r
27                 [StructLayout( LayoutKind.Sequential )]\r
28                 public struct STファイル情報\r
29                 {\r
30                         public string ファイルの絶対パス;\r
31                         public string フォルダの絶対パス;\r
32                         public DateTime 最終更新日時;\r
33                         public long ファイルサイズ;\r
34 \r
35                         public STファイル情報( string ファイルの絶対パス, string フォルダの絶対パス, DateTime 最終更新日時, long ファイルサイズ )\r
36                         {\r
37                                 this.ファイルの絶対パス = ファイルの絶対パス;\r
38                                 this.フォルダの絶対パス = フォルダの絶対パス;\r
39                                 this.最終更新日時 = 最終更新日時;\r
40                                 this.ファイルサイズ = ファイルサイズ;\r
41                         }\r
42                 }\r
43 \r
44                 public ST譜面情報 譜面情報;\r
45                 [StructLayout( LayoutKind.Sequential )]\r
46                 public struct ST譜面情報\r
47                 {\r
48                         public string タイトル;\r
49                         public string アーティスト名;\r
50                         public string コメント;\r
51                         public string ジャンル;\r
52                         public string Preimage;\r
53                         public string Premovie;\r
54                         public string Presound;\r
55                         public string Backgound;\r
56                         public STDGBVALUE<int> レベル;\r
57                         public STRANK 最大ランク;\r
58                         public STSKILL 最大スキル;\r
59                         public STDGBVALUE<bool> フルコンボ;\r
60                         public STDGBVALUE<int> 演奏回数;\r
61                         public STHISTORY 演奏履歴;\r
62                         public bool レベルを非表示にする;\r
63                         public CDTX.E種別 曲種別;\r
64 \r
65                         [StructLayout( LayoutKind.Sequential )]\r
66                         public struct STHISTORY\r
67                         {\r
68                                 public string 行1;\r
69                                 public string 行2;\r
70                                 public string 行3;\r
71                                 public string 行4;\r
72                                 public string 行5;\r
73                                 public string this[ int index ]\r
74                                 {\r
75                                         get\r
76                                         {\r
77                                                 switch( index )\r
78                                                 {\r
79                                                         case 0:\r
80                                                                 return this.行1;\r
81 \r
82                                                         case 1:\r
83                                                                 return this.行2;\r
84 \r
85                                                         case 2:\r
86                                                                 return this.行3;\r
87 \r
88                                                         case 3:\r
89                                                                 return this.行4;\r
90 \r
91                                                         case 4:\r
92                                                                 return this.行5;\r
93                                                 }\r
94                                                 throw new IndexOutOfRangeException();\r
95                                         }\r
96                                         set\r
97                                         {\r
98                                                 switch( index )\r
99                                                 {\r
100                                                         case 0:\r
101                                                                 this.行1 = value;\r
102                                                                 return;\r
103 \r
104                                                         case 1:\r
105                                                                 this.行2 = value;\r
106                                                                 return;\r
107 \r
108                                                         case 2:\r
109                                                                 this.行3 = value;\r
110                                                                 return;\r
111 \r
112                                                         case 3:\r
113                                                                 this.行4 = value;\r
114                                                                 return;\r
115 \r
116                                                         case 4:\r
117                                                                 this.行5 = value;\r
118                                                                 return;\r
119                                                 }\r
120                                                 throw new IndexOutOfRangeException();\r
121                                         }\r
122                                 }\r
123                         }\r
124 \r
125                         [StructLayout( LayoutKind.Sequential )]\r
126                         public struct STRANK\r
127                         {\r
128                                 public int Drums;\r
129                                 public int Guitar;\r
130                                 public int Bass;\r
131                                 public int this[ int index ]\r
132                                 {\r
133                                         get\r
134                                         {\r
135                                                 switch( index )\r
136                                                 {\r
137                                                         case 0:\r
138                                                                 return this.Drums;\r
139 \r
140                                                         case 1:\r
141                                                                 return this.Guitar;\r
142 \r
143                                                         case 2:\r
144                                                                 return this.Bass;\r
145                                                 }\r
146                                                 throw new IndexOutOfRangeException();\r
147                                         }\r
148                                         set\r
149                                         {\r
150                                                 if ( ( value < (int)CScoreIni.ERANK.SS ) || ( ( value != (int)CScoreIni.ERANK.UNKNOWN ) && ( value > (int)CScoreIni.ERANK.E ) ) )\r
151                                                 {\r
152                                                         throw new ArgumentOutOfRangeException();\r
153                                                 }\r
154                                                 switch( index )\r
155                                                 {\r
156                                                         case 0:\r
157                                                                 this.Drums = value;\r
158                                                                 return;\r
159 \r
160                                                         case 1:\r
161                                                                 this.Guitar = value;\r
162                                                                 return;\r
163 \r
164                                                         case 2:\r
165                                                                 this.Bass = value;\r
166                                                                 return;\r
167                                                 }\r
168                                                 throw new IndexOutOfRangeException();\r
169                                         }\r
170                                 }\r
171                         }\r
172 \r
173                         [StructLayout( LayoutKind.Sequential )]\r
174                         public struct STSKILL\r
175                         {\r
176                                 public double Drums;\r
177                                 public double Guitar;\r
178                                 public double Bass;\r
179                                 public double this[ int index ]\r
180                                 {\r
181                                         get\r
182                                         {\r
183                                                 switch( index )\r
184                                                 {\r
185                                                         case 0:\r
186                                                                 return this.Drums;\r
187 \r
188                                                         case 1:\r
189                                                                 return this.Guitar;\r
190 \r
191                                                         case 2:\r
192                                                                 return this.Bass;\r
193                                                 }\r
194                                                 throw new IndexOutOfRangeException();\r
195                                         }\r
196                                         set\r
197                                         {\r
198                                                 if( ( value < 0.0 ) || ( value > 100.0 ) )\r
199                                                 {\r
200                                                         throw new ArgumentOutOfRangeException();\r
201                                                 }\r
202                                                 switch( index )\r
203                                                 {\r
204                                                         case 0:\r
205                                                                 this.Drums = value;\r
206                                                                 return;\r
207 \r
208                                                         case 1:\r
209                                                                 this.Guitar = value;\r
210                                                                 return;\r
211 \r
212                                                         case 2:\r
213                                                                 this.Bass = value;\r
214                                                                 return;\r
215                                                 }\r
216                                                 throw new IndexOutOfRangeException();\r
217                                         }\r
218                                 }\r
219                         }\r
220                 }\r
221 \r
222                 public bool bSongDBにキャッシュがあった;\r
223                 public bool bスコアが有効である\r
224                 {\r
225                         get\r
226                         {\r
227                                 return ( ( ( this.譜面情報.レベル[ 0 ] + this.譜面情報.レベル[ 1 ] ) + this.譜面情報.レベル[ 2 ] ) != 0 );\r
228                         }\r
229                 }\r
230 \r
231 \r
232                 // コンストラクタ\r
233 \r
234                 public Cスコア()\r
235                 {\r
236                         this.ScoreIni情報 = new STScoreIni情報( DateTime.MinValue, 0L );\r
237                         this.bSongDBにキャッシュがあった = false;\r
238                         this.ファイル情報 = new STファイル情報( "", "", DateTime.MinValue, 0L );\r
239                         this.譜面情報 = new ST譜面情報();\r
240                         this.譜面情報.タイトル = "";\r
241                         this.譜面情報.アーティスト名 = "";\r
242                         this.譜面情報.コメント = "";\r
243                         this.譜面情報.ジャンル = "";\r
244                         this.譜面情報.Preimage = "";\r
245                         this.譜面情報.Premovie = "";\r
246                         this.譜面情報.Presound = "";\r
247                         this.譜面情報.Backgound = "";\r
248                         this.譜面情報.レベル = new STDGBVALUE<int>();\r
249                         this.譜面情報.最大ランク = new ST譜面情報.STRANK();\r
250                         this.譜面情報.最大ランク.Drums =  (int)CScoreIni.ERANK.UNKNOWN;\r
251                         this.譜面情報.最大ランク.Guitar = (int)CScoreIni.ERANK.UNKNOWN;\r
252                         this.譜面情報.最大ランク.Bass =   (int)CScoreIni.ERANK.UNKNOWN;\r
253                         this.譜面情報.フルコンボ = new STDGBVALUE<bool>();\r
254                         this.譜面情報.演奏回数 = new STDGBVALUE<int>();\r
255                         this.譜面情報.演奏履歴 = new ST譜面情報.STHISTORY();\r
256                         this.譜面情報.演奏履歴.行1 = "";\r
257                         this.譜面情報.演奏履歴.行2 = "";\r
258                         this.譜面情報.演奏履歴.行3 = "";\r
259                         this.譜面情報.演奏履歴.行4 = "";\r
260                         this.譜面情報.演奏履歴.行5 = "";\r
261                         this.譜面情報.レベルを非表示にする = false;\r
262                         this.譜面情報.最大スキル = new ST譜面情報.STSKILL();\r
263                         this.譜面情報.曲種別 = CDTX.E種別.DTX;\r
264                 }\r
265         }\r
266 }\r