新增响应候选领域模型和结构化私有动作消息,支持响应窗口和候选动作下发。主要变更包括: - 新增 ResponseActionOption、ResponseActionSeatCandidate 和 ResponseActionWindow 模型 - 扩展 PrivateActionMessage 支持响应候选上下文 - 实现 ResponseActionWindowBuilder 构建弃牌响应候选 - 拆分 GameMessagePublisher 支持回合动作和响应动作消息 - 更新前端原型页展示结构化候选动作 - 新增响应优先级规则文档 RESPONSE_RESOLUTION_RULES.md
35 lines
913 B
Java
35 lines
913 B
Java
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()
|
|
);
|
|
}
|
|
}
|