feat: 实现响应候选模型与私有动作消息结构化
新增响应候选领域模型和结构化私有动作消息,支持响应窗口和候选动作下发。主要变更包括: - 新增 ResponseActionOption、ResponseActionSeatCandidate 和 ResponseActionWindow 模型 - 扩展 PrivateActionMessage 支持响应候选上下文 - 实现 ResponseActionWindowBuilder 构建弃牌响应候选 - 拆分 GameMessagePublisher 支持回合动作和响应动作消息 - 更新前端原型页展示结构化候选动作 - 新增响应优先级规则文档 RESPONSE_RESOLUTION_RULES.md
This commit is contained in:
@@ -4,7 +4,9 @@ import com.xuezhanmaster.game.event.GameEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.time.Instant;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GameSession {
|
||||
@@ -14,6 +16,8 @@ public class GameSession {
|
||||
private final Instant createdAt;
|
||||
private final GameTable table;
|
||||
private final List<GameEvent> events;
|
||||
private ResponseActionWindow pendingResponseActionWindow;
|
||||
private final Map<Integer, ActionType> responseActionSelections;
|
||||
|
||||
public GameSession(String roomId, GameTable table) {
|
||||
this.gameId = UUID.randomUUID().toString();
|
||||
@@ -21,6 +25,7 @@ public class GameSession {
|
||||
this.createdAt = Instant.now();
|
||||
this.table = table;
|
||||
this.events = new ArrayList<>();
|
||||
this.responseActionSelections = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
public String getGameId() {
|
||||
@@ -42,4 +47,20 @@ public class GameSession {
|
||||
public List<GameEvent> getEvents() {
|
||||
return events;
|
||||
}
|
||||
|
||||
public ResponseActionWindow getPendingResponseActionWindow() {
|
||||
return pendingResponseActionWindow;
|
||||
}
|
||||
|
||||
public void setPendingResponseActionWindow(ResponseActionWindow pendingResponseActionWindow) {
|
||||
this.pendingResponseActionWindow = pendingResponseActionWindow;
|
||||
}
|
||||
|
||||
public Map<Integer, ActionType> getResponseActionSelections() {
|
||||
return responseActionSelections;
|
||||
}
|
||||
|
||||
public void clearResponseActionSelections() {
|
||||
responseActionSelections.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user