OSDN Git Service

#32713 初コミット。SVNrev567時点での、ファイルはbranch/140707(ReBuild XGVersion)から移行したもの。
[dtxmaniaxg-verk/dtxmaniaxg-verk-git.git] / DTXManiaプロジェクト / コード / アイテム / CItemInteger.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace DTXMania
6 {
7         /// <summary>
8         /// 「整数」を表すアイテム。
9         /// </summary>
10         internal class CItemInteger : CItemBase
11         {
12                 // プロパティ
13
14                 public int n現在の値;
15                 public bool b値がフォーカスされている;
16
17
18                 // コンストラクタ
19
20                 public CItemInteger()
21                 {
22                         base.e種別 = CItemBase.E種別.整数;
23                         this.n最小値 = 0;
24                         this.n最大値 = 0;
25                         this.n現在の値 = 0;
26                         this.b値がフォーカスされている = false;
27                 }
28                 public CItemInteger( string str項目名, int n最小値, int n最大値, int n初期値 )
29                         : this()
30                 {
31                         this.t初期化( str項目名, n最小値, n最大値, n初期値 );
32                 }
33                 public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp)
34                         : this() {
35                         this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp);
36                 }
37                 public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en)
38                         : this() {
39                         this.t初期化(str項目名, n最小値, n最大値, n初期値, str説明文jp, str説明文en);
40                 }
41
42         
43                 public CItemInteger( string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別 )
44                         : this()
45                 {
46                         this.t初期化( str項目名, n最小値, n最大値, n初期値, eパネル種別 );
47                 }
48                 public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別, string str説明文jp)
49                         : this() {
50                         this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp);
51                 }
52                 public CItemInteger(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別, string str説明文jp, string str説明文en)
53                         : this() {
54                         this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文en);
55                 }
56
57
58                 // CItemBase 実装
59
60                 public override void tEnter押下()
61                 {
62                         this.b値がフォーカスされている = !this.b値がフォーカスされている;
63                 }
64                 public override void t項目値を次へ移動()
65                 {
66                         if( ++this.n現在の値 > this.n最大値 )
67                         {
68                                 this.n現在の値 = this.n最大値;
69                         }
70                 }
71                 public override void t項目値を前へ移動()
72                 {
73                         if( --this.n現在の値 < this.n最小値 )
74                         {
75                                 this.n現在の値 = this.n最小値;
76                         }
77                 }
78                 public void t初期化( string str項目名, int n最小値, int n最大値, int n初期値 )
79                 {
80                         this.t初期化( str項目名, n最小値, n最大値, n初期値, CItemBase.Eパネル種別.通常, "", "" );
81                 }
82                 public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp) {
83                         this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.Eパネル種別.通常, str説明文jp, str説明文jp);
84                 }
85                 public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, string str説明文jp, string str説明文en) {
86                         this.t初期化(str項目名, n最小値, n最大値, n初期値, CItemBase.Eパネル種別.通常, str説明文jp, str説明文en);
87                 }
88
89         
90                 public void t初期化( string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別 )
91                 {
92                         this.t初期化( str項目名, n最小値, n最大値, n初期値, eパネル種別, "", "" );
93                 }
94                 public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別, string str説明文jp) {
95                         this.t初期化(str項目名, n最小値, n最大値, n初期値, eパネル種別, str説明文jp, str説明文jp);
96                 }
97                 public void t初期化(string str項目名, int n最小値, int n最大値, int n初期値, CItemBase.Eパネル種別 eパネル種別, string str説明文jp, string str説明文en) {
98                         base.t初期化(str項目名, eパネル種別, str説明文jp, str説明文en);
99                         this.n最小値 = n最小値;
100                         this.n最大値 = n最大値;
101                         this.n現在の値 = n初期値;
102                         this.b値がフォーカスされている = false;
103                 }
104                 public override object obj現在値()
105                 {
106                         return this.n現在の値;
107                 }
108                 public override int GetIndex()
109                 {
110                         return this.n現在の値;
111                 }
112                 public override void SetIndex( int index )
113                 {
114                         this.n現在の値 = index;
115                 }
116                 // その他
117
118                 #region [ private ]
119                 //-----------------
120                 private int n最小値;
121                 private int n最大値;
122                 //-----------------
123                 #endregion
124         }
125 }