예제 #1
0
        private void determineImageAccordingToPieceSign(CheckersButton i_SourcePBox, CheckersButton i_DestPBox)
        {
            Point     sourceDest        = m_Game.GetLastStep.GetDestination;
            string    sourceDestination = sourceDest.GetColCoord + sourceDest.GetRowCoord;
            BoardSlot sourceBoardSlot   = m_Game.GetGameBoard.GetBoardSlotFromIdentifierString(sourceDestination);

            if (m_Game.GetActivePlayer.GetPlayerSign == "X")
            {
                if (sourceBoardSlot.GetPieceRef().GetIsKingBoolean)
                {
                    i_DestPBox.Image = global::CheckersUI.Properties.Resources.WhiteKing;
                }
                else
                {
                    i_DestPBox.Image = global::CheckersUI.Properties.Resources.WhitePawn;
                }
            }
            else
            {
                if (sourceBoardSlot.GetPieceRef().GetIsKingBoolean)
                {
                    i_DestPBox.Image = global::CheckersUI.Properties.Resources.BlackKing;
                }
                else
                {
                    i_DestPBox.Image = global::CheckersUI.Properties.Resources.BlackPawn;
                }
            }

            i_SourcePBox.Image  = null;
            i_DestPBox.SizeMode = PictureBoxSizeMode.StretchImage;
            i_DestPBox.Update();
            i_SourcePBox.Update();
        }
예제 #2
0
 public void RemovePiece(BoardSlot i_BoardSlotThatContainsThePiece)
 {
     r_PlayerPieces.Remove(i_BoardSlotThatContainsThePiece.GetPieceRef());
 }