+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-\r
-namespace DTXCreator.譜面\r
-{\r
- public class C小節 : IComparable<C小節>\r
- {\r
- public float f小節長倍率 = 1f;\r
- public List<Cチップ> listチップ = new List<Cチップ>();\r
- public static int n基準の高さdot = 0xc0;\r
- public static readonly int n基準の高さgrid = 0xc0;\r
- public static int n1グリッドの高さdot\r
- {\r
- get\r
- {\r
- return ( n基準の高さdot / n基準の高さgrid );\r
- }\r
- }\r
- public int n小節長倍率を考慮した現在の小節の高さdot\r
- {\r
- get\r
- {\r
- return (int) ( n基準の高さdot * this.f小節長倍率 );\r
- }\r
- }\r
- public int n小節長倍率を考慮した現在の小節の高さgrid\r
- {\r
- get\r
- {\r
- return (int) ( n基準の高さgrid * this.f小節長倍率 );\r
- }\r
- }\r
- public int n小節番号0to3599\r
- {\r
- get\r
- {\r
- return this._n小節番号0to3599;\r
- }\r
- set\r
- {\r
- if( ( value < 0 ) || ( value > 0xe0f ) )\r
- {\r
- throw new Exception( "値が範囲(0~3599)を超えています。-->[" + value + "]" );\r
- }\r
- this._n小節番号0to3599 = value;\r
- }\r
- }\r
-\r
- public C小節( int n小節番号0to3599 )\r
- {\r
- this._n小節番号0to3599 = n小節番号0to3599;\r
- }\r
- public int CompareTo( C小節 other )\r
- {\r
- return ( this._n小節番号0to3599 - other._n小節番号0to3599 );\r
- }\r
- public int n位置変換count2grid( int nCount )\r
- {\r
- return (int) ( ( ( n基準の高さgrid * this.f小節長倍率 ) * nCount ) / 384f );\r
- }\r
- public static int n位置変換dot2grid( int nDot )\r
- {\r
- return ( ( nDot * n基準の高さgrid ) / n基準の高さdot );\r
- }\r
- public int n位置変換grid2count( int nGrid )\r
- {\r
- return (int) ( ( nGrid * 384f ) / ( n基準の高さgrid * this.f小節長倍率 ) );\r
- }\r
- public static int n位置変換grid2dot( int nGrid )\r
- {\r
- return ( ( nGrid * n基準の高さdot ) / n基準の高さgrid );\r
- }\r
- public void t小節内の全チップの移動済フラグをリセットする()\r
- {\r
- for( int i = 0; i < this.listチップ.Count; i++ )\r
- {\r
- this.listチップ[ i ].b移動済 = false;\r
- }\r
- }\r
- public void t小節内の全チップの選択を解除する()\r
- {\r
- for( int i = 0; i < this.listチップ.Count; i++ )\r
- {\r
- Cチップ cチップ = this.listチップ[ i ];\r
- if( cチップ.b確定選択中 )\r
- {\r
- this.listチップ[ i ].bドラッグで選択中 = false;\r
- this.listチップ[ i ].b確定選択中 = false;\r
- }\r
- }\r
- }\r
-\r
- #region [ private ]\r
- //-----------------\r
- private int _n小節番号0to3599;\r
- //-----------------\r
- #endregion\r
- }\r
-}\r