OSDN Git Service

DTXManiaソリューション、DTXManiaプロジェクト、DTXCreatorプロジェクト、FDKプロジェクトについて英語化。
[dtxmania/dtxmania.git] / DTXCreator / コード / 05.譜面 / C小節.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace DTXCreator.譜面
6 {
7         public class C小節 : IComparable<C小節>
8         {
9                 public float f小節長倍率 = 1f;
10                 public List<Cチップ> listチップ = new List<Cチップ>();
11                 public static int n基準の高さdot = 0xc0;
12                 public static readonly int n基準の高さgrid = 0xc0;
13                 public static int n1グリッドの高さdot
14                 {
15                         get
16                         {
17                                 return ( n基準の高さdot / n基準の高さgrid );
18                         }
19                 }
20                 public int n小節長倍率を考慮した現在の小節の高さdot
21                 {
22                         get
23                         {
24                                 return (int) ( n基準の高さdot * this.f小節長倍率 );
25                         }
26                 }
27                 public int n小節長倍率を考慮した現在の小節の高さgrid
28                 {
29                         get
30                         {
31                                 return (int) ( n基準の高さgrid * this.f小節長倍率 );
32                         }
33                 }
34                 public int n小節番号0to3599
35                 {
36                         get
37                         {
38                                 return this._n小節番号0to3599;
39                         }
40                         set
41                         {
42                                 if( ( value < 0 ) || ( value > 0xe0f ) )
43                                 {
44                                         throw new Exception( "値が範囲(0~3599)を超えています。-->[" + value + "]" );
45                                 }
46                                 this._n小節番号0to3599 = value;
47                         }
48                 }
49
50                 public C小節( int n小節番号0to3599 )
51                 {
52                         this._n小節番号0to3599 = n小節番号0to3599;
53                 }
54                 public int CompareTo( C小節 other )
55                 {
56                         return ( this._n小節番号0to3599 - other._n小節番号0to3599 );
57                 }
58                 public int n位置変換count2grid( int nCount )
59                 {
60                         return (int) ( ( ( n基準の高さgrid * this.f小節長倍率 ) * nCount ) / 384f );
61                 }
62                 public static int n位置変換dot2grid( int nDot )
63                 {
64                         return ( ( nDot * n基準の高さgrid ) / n基準の高さdot );
65                 }
66                 public int n位置変換grid2count( int nGrid )
67                 {
68                         return (int) ( ( nGrid * 384f ) / ( n基準の高さgrid * this.f小節長倍率 ) );
69                 }
70                 public static int n位置変換grid2dot( int nGrid )
71                 {
72                         return ( ( nGrid * n基準の高さdot ) / n基準の高さgrid );
73                 }
74                 public void t小節内の全チップの移動済フラグをリセットする()
75                 {
76                         for( int i = 0; i < this.listチップ.Count; i++ )
77                         {
78                                 this.listチップ[ i ].b移動済 = false;
79                         }
80                 }
81                 public void t小節内の全チップの選択を解除する()
82                 {
83                         for( int i = 0; i < this.listチップ.Count; i++ )
84                         {
85                                 Cチップ cチップ = this.listチップ[ i ];
86                                 if( cチップ.b確定選択中 )
87                                 {
88                                         this.listチップ[ i ].bドラッグで選択中 = false;
89                                         this.listチップ[ i ].b確定選択中 = false;
90                                 }
91                         }
92                 }
93
94                 #region [ private ]
95                 //-----------------
96                 private int _n小節番号0to3599;
97                 //-----------------
98                 #endregion
99         }
100 }