Exemple #1
0
 /// <summary>
 /// デバッグ枠を表示する
 /// </summary>
 /// <param name="g">描画先グラフィックオブジェクト</param>
 /// <param name="field">フィールド状態</param>
 private void DrawDebugField(Graphics g, CaptureField field)
 {
     for (int y = 0; y < CaptureField.Y_MAX; y++)
     {
         for (int x = 0; x < CaptureField.X_MAX; x++)
         {
             PuyoType  type = field.GetPuyoType(x, y);
             Rectangle rect = field.GetRect(x, y);
             DrawDebugRect(g, type, rect);
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// フィールド状態を解析する
        /// </summary>
        /// <param name="bmp">解析対象画像</param>
        /// <returns>フィールド状態</returns>
        private CaptureField AnalyzeField(Bitmap bmp)
        {
            CaptureField        field = new CaptureField();
            RapidBitmapAccessor ba    = new RapidBitmapAccessor(bmp);

            ba.BeginAccess();
            for (int y = 0; y < CaptureField.Y_MAX; y++)
            {
                for (int x = 0; x < CaptureField.X_MAX; x++)
                {
                    field.SetPuyoType(x, y, detector.Detect(ba, field.GetRect(x, y)));
                }
            }

            ba.EndAccess();

            field.Correct();
            return(field);
        }