Design class Diagram

Source: Internet
Author: User

Chessboard.java

The class generated by the file is responsible for creating the "chess board", the user can use the mouse to drag the chess piece on the board, when releasing the mouse is to put pieces of chess points. The board does not allow the user to drag and drop a piece onto a non-point. The rule object on the chessboard is responsible for judging whether moves has complied with Chinese chess rules, such as "horse" Walking Day, "Elephant" walking field, "pawn" to go not back and so on. If the user's walk does not conform to the rules, the pieces will be put back in place, and walk again. The makechessmanual object of the chessboard is responsible for recording the game, and when the user chooses the "Save Game" menu item, the current game can be saved as a file. In addition, the board can be undo, undo will not be recorded to the game.

Chesspoint.java

The class generated by the file is responsible for creating a chess point object. The chess point object can judge whether there is a pawn on the point, specify the chess piece on the current point, get the chess piece on the current point, and move the chess piece on the current point.

Chesspiece.java

The class generated by the file is responsible for creating the pawn object. and draw the appearance of the pieces. A pawn object can get its own color, size, name, and can also set and get its own category, namely Red Chess and black chess.

Makechessmanual,java

The class generated by the file is responsible for creating the object that records the game, which can record the game into a linked table and display the game in a text area. When the undo, the object will modify the game and update the text area information.

Ruler.java

The class generated by the file is responsible for creating the "moves Rule" object, which is responsible for whether the user's user's walk conforms to the rules.

Demon.java

The class generated by the file is responsible for creating a "game Demo" object that can demonstrate the saved game.

Movestep.java

The object created by the class records a chess step.

Design class Diagram

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.