avatar
r*e
2
1. Design a Chess board game OOP , walk through the class and function
2. Design a file System
有沒有大牛 walk through 思路??
avatar
L*1
3
发包子攒rp吧
avatar
d*x
4
1.
Piece is a general interface, which can be implemented as concrete types,
interface may include possible moves given the settings on board (arguable);
getter for name; getter for display configuration (arguable); color...
Board will store and manage positions of all Pieces. Sierialization may be
required since users could save and resume games. Board provides methods to
move, change, remove, add (for undo) pieces by name/reference/position/
enumeration.
Use patterns like builder pattern to generate a board setting.
Players class will store basic information about time remaining, history win
/lose data, and color assigned.
Then GameController. Though I believe most of the logics should go here, I
personally tend to put basic movement logics in Piece. This Controller
should include high level game logics and rules, like: receive Commands to
select piece, return positions that Piece can be moved to (considering 王车
换位 and 吃过路兵...), Commands to actually move a Piece to desired position
, promotion of piece class, time counting, win/lose condition, forbidden
rules (if any), provides information about current player. Also, interfaces
to board settings..
And since we are using Command pattern, we will have the ability to redo/
undo.
Then the UI, making use of the GameController, it renders the current board
setting, accept Player's selection of pieces in current player's color, then
accepts legal movements, functions to undo/redo, poll (arguable) the player
's remaining time, check win/lose criteria after each move (arguable, i
prefer listeners or callbacks actually)....and so on
just my 2 cents.

【在 r*****e 的大作中提到】
: 1. Design a Chess board game OOP , walk through the class and function
: 2. Design a file System
: 有沒有大牛 walk through 思路??

avatar
c*y
5
都变了。五一幸免了

【在 A****n 的大作中提到】
: 偶的shopper上staples也变3%了
avatar
d*x
6
吃过路兵可能需要一些额外的work...傻傻装不知道好了。。

);
win

【在 d**********x 的大作中提到】
: 1.
: Piece is a general interface, which can be implemented as concrete types,
: interface may include possible moves given the settings on board (arguable);
: getter for name; getter for display configuration (arguable); color...
: Board will store and manage positions of all Pieces. Sierialization may be
: required since users could save and resume games. Board provides methods to
: move, change, remove, add (for undo) pieces by name/reference/position/
: enumeration.
: Use patterns like builder pattern to generate a board setting.
: Players class will store basic information about time remaining, history win

avatar
M*7
7
mark
avatar
z*2
8
mark
avatar
v*n
9
mark
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。