OSDN Git Service

Counterクラスの進行メソッドをpublicに変更。
authorくまかみ工房 <kumakamikoubou@gmail.com>
Mon, 11 Sep 2017 07:53:17 +0000 (16:53 +0900)
committerくまかみ工房 <kumakamikoubou@gmail.com>
Mon, 11 Sep 2017 07:53:17 +0000 (16:53 +0900)
FDK/カウンタ/Counter.cs

index 5c54b8d..126bc78 100644 (file)
@@ -48,7 +48,7 @@ namespace FDK.カウンタ
                        {
                                lock( this._スレッド間同期 )
                                {
-                                       this._カウンタを進行する();
+                                       this.進行する();
                                        return this._現在値;
                                }
                        }
@@ -68,7 +68,7 @@ namespace FDK.カウンタ
                                {
                                        if( this._開始値 != this._終了値 )
                                        {
-                                               this._カウンタを進行する();
+                                               this.進行する();
                                                return ( float ) ( this._現在値 - this._開始値 ) / ( float ) ( this._終了値 - this._開始値 );
                                        }
                                        else
@@ -89,7 +89,7 @@ namespace FDK.カウンタ
                        {
                                lock( this._スレッド間同期 )
                                {
-                                       this._カウンタを進行する();        // 終了してるかどうか判定する前に、溜まってる進行を全部消化する。
+                                       this.進行する();        // 終了してるかどうか判定する前に、溜まってる進行を全部消化する。
                                        return this._動作中;
                                }
                        }
@@ -114,7 +114,7 @@ namespace FDK.カウンタ
                        {
                                lock( this._スレッド間同期 )
                                {
-                                       this._カウンタを進行する();
+                                       this.進行する();
                                        return ( this._現在値 >= this._終了値 );
                                }
                        }
@@ -194,27 +194,11 @@ namespace FDK.カウンタ
                        }
                }
 
-
-               private int _開始値 = 0;
-
-               private int _終了値 = 0;
-
-               private int _現在値 = 0;
-
-               private bool _動作中 = false;
-
-               private long _間隔ms = QPCTimer.未使用;
-
-               private 定間隔進行 _定間隔進行 = null;
-
-               private readonly object _スレッド間同期 = new object();
-
-
                /// <summary>
                ///             前回のこのメソッドの呼び出しからの経過時間をもとに、必要なだけ現在値を増加させる。
                ///             カウント値が終了値に達している場合は、それ以上増加しない(終了値を維持する)。
                /// </summary>
-               private void _カウンタを進行する()
+               public void 進行する()
                {
                        if( this._間隔ms == QPCTimer.未使用 )
                                return; // 開始されていないなら無視。
@@ -238,5 +222,19 @@ namespace FDK.カウンタ
                                } );
                        }
                }
+
+               private int _開始値 = 0;
+
+               private int _終了値 = 0;
+
+               private int _現在値 = 0;
+
+               private bool _動作中 = false;
+
+               private long _間隔ms = QPCTimer.未使用;
+
+               private 定間隔進行 _定間隔進行 = null;
+
+               private readonly object _スレッド間同期 = new object();
        }
 }