Example #1
0
 public Knight(ChessPieces pieceType, PieceColors color, char currentXcoordinate, int currentYCoordinate, bool canMove, bool hasMoved)
 {
     this.PieceType          = pieceType;
     this.Color              = color;
     this.CurrentXCoordinate = currentXcoordinate;
     this.CurrentYCoordinate = currentYCoordinate;
     this.CanMove            = canMove;
     this.HasMoved           = hasMoved;
 }
Example #2
0
 public King(ChessPieces pieceType, PieceColors color, char currentXCoordinate, char futureXCoordinate, int currentYCoordinate, int futureYCoordinate, bool canMove, bool hasMoved)
 {
     this.PieceType          = pieceType;
     this.Color              = color;
     this.CurrentXCoordinate = currentXCoordinate;
     this.FutureXCoordinate  = futureXCoordinate;
     this.CurrentYCoordinate = currentYCoordinate;
     this.FutureYCoordinate  = futureYCoordinate;
     this.CanMove            = canMove;
     this.HasMoved           = hasMoved;
 }
Example #3
0
 protected Piece(ChessPieces piece, PieceColors color, char x, int y, char fx, int fy, bool canMove, bool hasMoved)
 {
     this.PieceType          = piece;
     this.Color              = color;
     this.CurrentXCoordinate = x;
     this.CurrentYCoordinate = y;
     this.FutureXCoordinate  = fx;
     this.FutureYCoordinate  = fy;
     this.CanMove            = canMove;
     this.HasMoved           = hasMoved;
 }
Example #4
0
        public void SaveConfig(Stream outputStream)
        {
            if (null == outputStream)
            {
                throw new ArgumentNullException(nameof(outputStream));
            }

            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true
            };

            using (XmlWriter writer = XmlWriter.Create(outputStream, settings))
            {
                writer.WriteStartElement("Mzinga.Viewer");

                writer.WriteAttributeString("version", AppVM.FullVersion);
                writer.WriteAttributeString("date", DateTime.UtcNow.ToString());

                writer.WriteElementString("EngineType", EngineType.ToString());
                writer.WriteElementString("EngineCommandLine", EngineCommandLine);
                writer.WriteElementString("HexOrientation", HexOrientation.ToString());
                writer.WriteElementString("NotationType", NotationType.ToString());
                writer.WriteElementString("PieceStyle", PieceStyle.ToString());
                writer.WriteElementString("PieceColors", PieceColors.ToString());
                writer.WriteElementString("DisablePiecesInHandWithNoMoves", DisablePiecesInHandWithNoMoves.ToString());
                writer.WriteElementString("DisablePiecesInPlayWithNoMoves", DisablePiecesInPlayWithNoMoves.ToString());
                writer.WriteElementString("HighlightTargetMove", HighlightTargetMove.ToString());
                writer.WriteElementString("HighlightValidMoves", HighlightValidMoves.ToString());
                writer.WriteElementString("HighlightLastMovePlayed", HighlightLastMovePlayed.ToString());
                writer.WriteElementString("BlockInvalidMoves", BlockInvalidMoves.ToString());
                writer.WriteElementString("RequireMoveConfirmation", RequireMoveConfirmation.ToString());
                writer.WriteElementString("AddPieceNumbers", AddPieceNumbers.ToString());
                writer.WriteElementString("StackPiecesInHand", StackPiecesInHand.ToString());
                writer.WriteElementString("PlaySoundEffects", PlaySoundEffects.ToString());
                writer.WriteElementString("ShowBoardHistory", ShowBoardHistory.ToString());
                writer.WriteElementString("ShowMoveCommentary", ShowMoveCommentary.ToString());
                writer.WriteElementString("FirstRun", FirstRun.ToString());
                writer.WriteElementString("CheckUpdateOnStart", CheckUpdateOnStart.ToString());

                InternalGameEngineConfig?.SaveGameAIConfig(writer, "InternalGameAI", ConfigSaveType.BasicOptions);

                writer.WriteEndElement();
            }
        }
Example #5
0
        public Form1()
        {
            show_each_pattern_count = true;
            pieceDrawings           = new List <PieceDrawing>();
            wasteDrawings           = new List <WasteDrawing>();
            cutDrawings             = new List <CutDrawing>();
            pieceLengths            = new List <int>();
            pieceWidths             = new List <int>();
            pieceDemands            = new List <int>();
            pieceCount      = new List <List <int> >();
            pieceCountTotal = new List <int>();
            Pieces          = new List <int>[] { pieceLengths, pieceWidths, pieceDemands };
            all_ok          = false;

            InitializeComponent();

            initial_pb_Width  = pictureBox_sol.Width;
            initial_pb_Height = pictureBox_sol.Height;
            initial_pb_pos    = pictureBox_sol.Location;
            pbAspectRatio     = (double)initial_pb_Width / initial_pb_Height;
            stockLength       = (int)numericUpDown_LengthStock.Value;
            stockWidth        = (int)numericUpDown_WidthStock.Value;
            stockCost         = (int)numericUpDown_CostStock.Value;
            pieceColors       = new PieceColors();
            screen_locked     = false;
            dataGridView_Pieces.EnableHeadersVisualStyles = true;
            solution = null;

            paint_cuts       = true;
            paint_pieces     = true;
            paint_waste      = true;
            paint_piece_name = true;

            cutColor         = Color.Black;
            wasteBorderColor = Color.DarkGray;
            wasteFillColor   = Color.DarkGray;
            pieceBorderColor = Color.Black;
            pieceNameColor   = Color.Black;

            UpdateColors();

            progressBarSeparation = button_prevPattern.Location.X - (progressBar_calculating.Location.X + progressBar_calculating.Width);
            progressBarLocationX  = progressBar_calculating.Location.X;
        }