Beispiel #1
0
        public Uc_ChessCell(Point Position, eChessSide Side, eChessBoardStyle BoardStyle)
        {
            InitializeComponent();

            this._position.X = Position.X;
            this._position.Y = Position.Y;
            this._side       = Side;
            this._boardStyle = BoardStyle;
            this._backImage  = Read_Image_From_Resources.GetChessBoardBitMap(this._side, this._boardStyle);
            this.BackImage   = _backImage; //Update backimage
        }
Beispiel #2
0
        public Uc_ChessPiece(eChessSide side, eChessPieceType type, eChessPieceStyle style, int cellSize, int piecesize)
        {
            InitializeComponent();

            this._side  = side;
            this._type  = type;
            this._style = style;
            _cellSize   = cellSize;
            _pieceSize  = piecesize;
            _image      = Read_Image_From_Resources.GetChessPieceBitMap(_side, _type, _style);

            //UserControl Size
            this.Size = new Size(this._pieceSize, this._pieceSize);
        }
Beispiel #3
0
        public Form_Promotion(eChessSide side, eChessPieceStyle style, System.Globalization.CultureInfo language)
        {
            InitializeComponent();

            //Initalize
            pictureBox1.Image = Read_Image_From_Resources.GetChessPieceBitMap(side, eChessPieceType.Queen, style);
            pictureBox2.Image = Read_Image_From_Resources.GetChessPieceBitMap(side, eChessPieceType.Rook, style);
            pictureBox3.Image = Read_Image_From_Resources.GetChessPieceBitMap(side, eChessPieceType.Knight, style);
            pictureBox4.Image = Read_Image_From_Resources.GetChessPieceBitMap(side, eChessPieceType.Bishop, style);

            //Change Language
            Assembly        a  = Assembly.Load("Chess Library");
            ResourceManager rm = new ResourceManager("Chess_Library.Resources.Lang.Langres", a);

            this.Text = rm.GetString("Form_Promotion", language);
            labelX_form_promotion.Text = rm.GetString("labelX_form_promotion", language);
        }
        public static void Promotion(Uc_ChessPiece UcPawn, eChessPieceType PromoteTo, System.Globalization.CultureInfo Language)
        {
            if (PromoteTo == eChessPieceType.Null)
            {
                Form_Promotion f = new Form_Promotion(UcPawn.Side, UcPawn.Style, Language);
                if (f.ShowDialog() == DialogResult.OK)
                {
                }
                f.Dispose();

                UcPawn.Type = Form_Promotion.Type;
            }
            else
            {
                UcPawn.Type = PromoteTo;
            }
            UcPawn.Image = Read_Image_From_Resources.GetChessPieceBitMap(UcPawn.Side, UcPawn.Type, UcPawn.Style);
        }
Beispiel #5
0
 public void HighLightImpossibleMove()
 {
     this.BackImage = Read_Image_From_Resources.GetChessBoardBitMap(this._side, this._boardStyle, "Last");
 }
Beispiel #6
0
 public void UnHighlightMove()
 {
     this.BackImage = Read_Image_From_Resources.GetChessBoardBitMap(this._side, this._boardStyle);
 }