feat: 实现响应候选模型与私有动作消息结构化
新增响应候选领域模型和结构化私有动作消息,支持响应窗口和候选动作下发。主要变更包括: - 新增 ResponseActionOption、ResponseActionSeatCandidate 和 ResponseActionWindow 模型 - 扩展 PrivateActionMessage 支持响应候选上下文 - 实现 ResponseActionWindowBuilder 构建弃牌响应候选 - 拆分 GameMessagePublisher 支持回合动作和响应动作消息 - 更新前端原型页展示结构化候选动作 - 新增响应优先级规则文档 RESPONSE_RESOLUTION_RULES.md
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.xuezhanmaster.game.domain;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public record ResponseActionWindow(
|
||||
String windowId,
|
||||
String gameId,
|
||||
String triggerEventType,
|
||||
int sourceSeatNo,
|
||||
String triggerTile,
|
||||
List<ResponseActionSeatCandidate> seatCandidates,
|
||||
Instant createdAt
|
||||
) {
|
||||
|
||||
public static ResponseActionWindow create(
|
||||
String gameId,
|
||||
String triggerEventType,
|
||||
int sourceSeatNo,
|
||||
String triggerTile,
|
||||
List<ResponseActionSeatCandidate> seatCandidates
|
||||
) {
|
||||
return new ResponseActionWindow(
|
||||
UUID.randomUUID().toString(),
|
||||
gameId,
|
||||
triggerEventType,
|
||||
sourceSeatNo,
|
||||
triggerTile,
|
||||
List.copyOf(seatCandidates),
|
||||
Instant.now()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user