Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏷️ add player and round type #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/domain_layer/src/player/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ export type Player = {
hands: Card[];
pastReceivedCards: Card[];
};

export enum SelectedPlayerAction {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

還需要一個狀態叫做尚未選擇

guessing = 'GUESSING',
escape = 'ESCAPE',
}

export type SelectedPlayer = Player & {
action: SelectedPlayerAction;
};
2 changes: 2 additions & 0 deletions packages/domain_layer/src/round/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export type Round = {
id: number;
currentPlayer: Player;
selectedPlayer: Player;
isGameEnd: boolean;
hasBeenSelectedPlayer: Player[];
Comment on lines 6 to +8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊已經有選擇玩家了
爾且選擇玩家應該是 SelectedPlayer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我記得規則有不能傳給已經被傳過的玩家,所以想說需要 hasBeenSelectedPlayer 來紀錄已經被傳過的玩家,你覺得呢?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這地方只需要在player裏面加上收過的卡片即可

因為玩家如果收過該卡片則不能被選擇

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也就是post received card

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

喔喔我以為 postReceivedCard 是指玩家累積的明牌,那是否需要一個 type 是紀錄玩家累積的明牌? 我記得累積四種就算輸了

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他的type是Card 可以去看一下Card有沒有那些東西

};
Loading