Merge remote-tracking branch 'origin/codex/tiaoyitiao' into codex/tiaoyitiao
# Conflicts: # docs/prd/【玩法创作】跳一跳俯视角玩法模板PRD-2026-05-19.md # server-rs/crates/spacetime-client/src/jump_hop.rs # server-rs/crates/spacetime-client/src/mapper/runtime.rs # server-rs/crates/spacetime-client/src/wooden_fish.rs # src/components/jump-hop-result/JumpHopResultView.test.tsx # src/components/jump-hop-runtime/JumpHopRuntimeShell.test.tsx # src/components/platform-entry/PlatformEntryFlowShellImpl.tsx # src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx # src/components/unified-creation/workspaces/JumpHopCreationWorkspace.tsx # src/components/unified-creation/workspaces/JumpHopWorkspace.test.tsx
This commit is contained in:
@@ -44,7 +44,6 @@ pub enum JumpHopTileType {
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum JumpHopActionType {
|
||||
CompileDraft,
|
||||
RegenerateCharacter,
|
||||
RegenerateTiles,
|
||||
UpdateWorkMeta,
|
||||
UpdateDifficulty,
|
||||
@@ -71,12 +70,20 @@ pub enum JumpHopJumpResult {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopWorkspaceCreateRequest {
|
||||
pub template_id: String,
|
||||
pub theme_text: String,
|
||||
#[serde(default)]
|
||||
pub work_title: String,
|
||||
#[serde(default)]
|
||||
pub work_description: String,
|
||||
#[serde(default)]
|
||||
pub theme_tags: Vec<String>,
|
||||
#[serde(default = "default_jump_hop_difficulty")]
|
||||
pub difficulty: JumpHopDifficulty,
|
||||
#[serde(default = "default_jump_hop_style_preset")]
|
||||
pub style_preset: JumpHopStylePreset,
|
||||
#[serde(default)]
|
||||
pub character_prompt: String,
|
||||
#[serde(default)]
|
||||
pub tile_prompt: String,
|
||||
#[serde(default)]
|
||||
pub end_mood_prompt: Option<String>,
|
||||
@@ -89,6 +96,8 @@ pub struct JumpHopActionRequest {
|
||||
#[serde(default)]
|
||||
pub profile_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub theme_text: Option<String>,
|
||||
#[serde(default)]
|
||||
pub work_title: Option<String>,
|
||||
#[serde(default)]
|
||||
pub work_description: Option<String>,
|
||||
@@ -127,14 +136,30 @@ pub struct JumpHopCharacterAsset {
|
||||
pub height: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopDefaultCharacter {
|
||||
pub character_id: String,
|
||||
pub display_name: String,
|
||||
pub model_kind: String,
|
||||
pub body_color: String,
|
||||
pub accent_color: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopTileAsset {
|
||||
pub tile_type: JumpHopTileType,
|
||||
#[serde(default)]
|
||||
pub tile_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub image_object_key: String,
|
||||
pub asset_object_id: String,
|
||||
pub source_atlas_cell: String,
|
||||
#[serde(default)]
|
||||
pub atlas_row: Option<u32>,
|
||||
#[serde(default)]
|
||||
pub atlas_col: Option<u32>,
|
||||
pub visual_width: u32,
|
||||
pub visual_height: u32,
|
||||
pub top_surface_radius: f32,
|
||||
@@ -193,11 +218,14 @@ pub struct JumpHopDraftResponse {
|
||||
pub template_name: String,
|
||||
#[serde(default)]
|
||||
pub profile_id: Option<String>,
|
||||
pub theme_text: String,
|
||||
pub work_title: String,
|
||||
pub work_description: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
pub difficulty: JumpHopDifficulty,
|
||||
pub style_preset: JumpHopStylePreset,
|
||||
#[serde(default)]
|
||||
pub default_character: Option<JumpHopDefaultCharacter>,
|
||||
pub character_prompt: String,
|
||||
pub tile_prompt: String,
|
||||
#[serde(default)]
|
||||
@@ -251,6 +279,7 @@ pub struct JumpHopWorkSummaryResponse {
|
||||
pub owner_user_id: String,
|
||||
#[serde(default)]
|
||||
pub source_session_id: Option<String>,
|
||||
pub theme_text: String,
|
||||
pub work_title: String,
|
||||
pub work_description: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
@@ -274,6 +303,8 @@ pub struct JumpHopWorkProfileResponse {
|
||||
pub summary: JumpHopWorkSummaryResponse,
|
||||
pub draft: JumpHopDraftResponse,
|
||||
pub path: JumpHopPath,
|
||||
#[serde(default)]
|
||||
pub default_character: Option<JumpHopDefaultCharacter>,
|
||||
pub character_asset: JumpHopCharacterAsset,
|
||||
pub tile_atlas_asset: JumpHopCharacterAsset,
|
||||
pub tile_assets: Vec<JumpHopTileAsset>,
|
||||
@@ -305,6 +336,7 @@ pub struct JumpHopGalleryCardResponse {
|
||||
pub profile_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub author_display_name: String,
|
||||
pub theme_text: String,
|
||||
pub work_title: String,
|
||||
pub work_description: String,
|
||||
#[serde(default)]
|
||||
@@ -343,6 +375,8 @@ pub struct JumpHopRuntimeRunSnapshotResponse {
|
||||
pub owner_user_id: String,
|
||||
pub status: JumpHopRunStatus,
|
||||
pub current_platform_index: u32,
|
||||
pub successful_jump_count: u32,
|
||||
pub duration_ms: u64,
|
||||
pub score: u32,
|
||||
pub combo: u32,
|
||||
pub path: JumpHopPath,
|
||||
@@ -363,15 +397,29 @@ pub struct JumpHopRunResponse {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopStartRunRequest {
|
||||
pub profile_id: String,
|
||||
#[serde(default)]
|
||||
pub runtime_mode: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopJumpRequest {
|
||||
pub charge_ms: u32,
|
||||
pub drag_distance: f32,
|
||||
#[serde(default)]
|
||||
pub drag_vector_x: Option<f32>,
|
||||
#[serde(default)]
|
||||
pub drag_vector_y: Option<f32>,
|
||||
pub client_event_id: String,
|
||||
}
|
||||
|
||||
fn default_jump_hop_difficulty() -> JumpHopDifficulty {
|
||||
JumpHopDifficulty::Standard
|
||||
}
|
||||
|
||||
fn default_jump_hop_style_preset() -> JumpHopStylePreset {
|
||||
JumpHopStylePreset::MinimalBlocks
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopRestartRunRequest {
|
||||
@@ -384,6 +432,25 @@ pub struct JumpHopJumpResponse {
|
||||
pub run: JumpHopRuntimeRunSnapshotResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopLeaderboardEntry {
|
||||
pub rank: u32,
|
||||
pub player_id: String,
|
||||
pub successful_jump_count: u32,
|
||||
pub duration_ms: u64,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct JumpHopLeaderboardResponse {
|
||||
pub profile_id: String,
|
||||
pub items: Vec<JumpHopLeaderboardEntry>,
|
||||
#[serde(default)]
|
||||
pub viewer_best: Option<JumpHopLeaderboardEntry>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
@@ -393,6 +460,7 @@ mod tests {
|
||||
fn jump_hop_workspace_request_uses_camel_case() {
|
||||
let payload = serde_json::to_value(JumpHopWorkspaceCreateRequest {
|
||||
template_id: "jump-hop".to_string(),
|
||||
theme_text: "跳一跳".to_string(),
|
||||
work_title: "跳一跳".to_string(),
|
||||
work_description: "俯视角跳跃闯关".to_string(),
|
||||
theme_tags: vec!["休闲".to_string()],
|
||||
|
||||
Reference in New Issue
Block a user