Ejemplo n.º 1
0
 protected void OnUndoHop(object sender, CellChangeEventArgs e)
 {
     if (ckShowUi.Checked)
     {
         UpdateUI(
             e.Hop.FromCellIndex, e.Hop.HoppedCellIndex, e.Hop.ToCellIndex,
             board.GetPegColor(e.Hop.FromCellIndex), board.GetPegColor(e.Hop.HoppedCellIndex), Color.White);
     }
 }
Ejemplo n.º 2
0
        // ------------------------------------------Event Handler------------------------------------------------------

        /*
         *  piece_BecameKing is an event handler method that will execute when the related piece became king.
         */
        private void piece_BecameKing(CellChangeEventArgs e)
        {
            if (e.PieceBecomeKing)
            {
                m_FormCheckersGame.SelectPieceByCoordinate(e.To.Y, e.To.X, e.Team);
                m_FormCheckersGame.MakeCurrentSelectedPieceKing();
                m_FormCheckersGame.CleanSelection();
            }
        }
Ejemplo n.º 3
0
        /*
         *  changeDisplayAccordingToMovement is a method that responsible to update the display according to movement.
         */
        private void changeDisplayAccordingToMovement(CellChangeEventArgs e)
        {
            if (m_CheckersGame.GetCurrentPlayer().IsAI)
            {
                m_FormCheckersGame.SelectPieceByCoordinate(e.From.Y, e.From.X, e.Team);
            }

            m_FormCheckersGame.MoveCurrentSelectedPiece(e.To.Y, e.To.X);
        }
Ejemplo n.º 4
0
        public virtual void CellChanged(CellChangeEventArgs para, BusinessProxy businessObject, VoucherProxy voucherObject)
        {
            //foreach (var item in rows)
            //{
            //var rows = businessObject.Rows.Values.OrderBy(o => o.Cells["uapruntime_rowno"].Value);

            //}
            //if (businessObject.Name == "主表" && para.ColumnName == "cNo")
            //{
            //    businessObject.Rows[0].Cells["cMemo"].Value = businessObject.Rows[0].Cells["cNo"].Value;
            //}
        }
Ejemplo n.º 5
0
        private void gameLogic_CellChange(object sender, CellChangeEventArgs e)
        {
            FallingPictureBox coinPlayer = getNewCoin();

            coinPlayer.Location            = new Point(e.Col * 65, 0);
            coinPlayer.Size                = new Size(65, 65);
            coinPlayer.MouseClick         += new MouseEventHandler(coin_Click);
            coinPlayer.PictureDoneFalling += new DoneFallingEventHendeler(coin_DoneFalling);
            m_BorderPanel.Controls.Add(coinPlayer);
            coinPlayer.StartFall(e.Row, e.Col);
            enabledPanel(false);
        }
 public void CellChange <T>(object sender, CellChangeEventArgs <T> e)
 {
     _wasCallback = true;
 }
Ejemplo n.º 7
0
 /*
  * piece_Eaten is an event handler method that will execute when the related piece is eaten.
  */
 private void piece_Eaten(CellChangeEventArgs e)
 {
     m_FormCheckersGame.EatPieceThatOnButtonSquare(e.EatenPiece.Y, e.EatenPiece.X, e.Team);
 }
Ejemplo n.º 8
0
 /*
  *  cell_Changed is an event handler method that will execute when the related cell is changed.
  */
 private void cell_Changed(CellChangeEventArgs e)
 {
     changeDisplayAccordingToMovement(e);
 }