Пример #1
0
        private void ChoosePawn(PictureBox file)
        {
            PawnAdapter tempPawn = PawnAdapterFactory.Create(PlayerEnumMethods.GetPlayer(file.Name.ToString()), file);

            if (PlayerEnumMethods.GetPlayer(file.Name.ToString()) == PlayerEnum.Red)
            {
                foreach (PawnAdapter pawn in redPawns)
                {
                    if (tempPawn.Equals(pawn))
                    {
                        this.selectedPawn = pawn;
                    }
                }
            }
            if (PlayerEnumMethods.GetPlayer(file.Name.ToString()) == PlayerEnum.Blue)
            {
                foreach (PawnAdapter pawn in bluePawns)
                {
                    if (tempPawn.Equals(pawn))
                    {
                        this.selectedPawn = pawn;
                    }
                }
            }
        }
Пример #2
0
        private void ImageClick(Object sender, MouseEventArgs e)
        {
            PictureBox file = (PictureBox)sender;

            MoveOn(PawnAdapterFactory.Create(PlayerEnumMethods.GetPlayer(file.Name.ToString()), file));
        }