Rewrite Genarrative play-type integration guidance across .codex and .hermes to define a platform-level SOP: default to form/image workbench, unify single-image asset slots (CreativeImageInputPanel), standardize series-material sheet->cut->transparent->OSS pipeline, and forbid copying legacy chat/agent workflows as the default. Add decision-log entry freezing the SOP and a pitfalls note warning against direct reuse of old play tools. Update CONTEXT.md and docs/README.md, add a new PRD file, and apply related small server-side changes (module-auth, spacetime-client mappers and runtime) to align back-end code with the new contracts and flows.
152 lines
4.0 KiB
Rust
152 lines
4.0 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
#[cfg(feature = "spacetime-types")]
|
|
use spacetimedb::SpacetimeType;
|
|
|
|
pub const JUMP_HOP_SESSION_ID_PREFIX: &str = "jump-hop-session-";
|
|
pub const JUMP_HOP_PROFILE_ID_PREFIX: &str = "jump-hop-profile-";
|
|
pub const JUMP_HOP_WORK_ID_PREFIX: &str = "jump-hop-work-";
|
|
pub const JUMP_HOP_RUN_ID_PREFIX: &str = "jump-hop-run-";
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub enum JumpHopDifficulty {
|
|
Easy,
|
|
Standard,
|
|
Advanced,
|
|
Challenge,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub enum JumpHopTileType {
|
|
Start,
|
|
Normal,
|
|
Target,
|
|
Finish,
|
|
Bonus,
|
|
Accent,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub enum JumpHopRunStatus {
|
|
Playing,
|
|
Failed,
|
|
Cleared,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub enum JumpHopJumpResultKind {
|
|
Miss,
|
|
Hit,
|
|
Perfect,
|
|
Finish,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct JumpHopScoring {
|
|
pub charge_to_distance_ratio: f32,
|
|
pub max_charge_ms: u32,
|
|
pub hit_bonus: u32,
|
|
pub perfect_bonus: u32,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct JumpHopPlatform {
|
|
pub platform_id: String,
|
|
pub tile_type: JumpHopTileType,
|
|
pub x: f32,
|
|
pub y: f32,
|
|
pub width: f32,
|
|
pub height: f32,
|
|
pub landing_radius: f32,
|
|
pub perfect_radius: f32,
|
|
pub score_value: u32,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct JumpHopPath {
|
|
pub seed: String,
|
|
pub difficulty: JumpHopDifficulty,
|
|
pub platforms: Vec<JumpHopPlatform>,
|
|
pub finish_index: u32,
|
|
pub camera_preset: String,
|
|
pub scoring: JumpHopScoring,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct JumpHopLastJump {
|
|
pub charge_ms: u32,
|
|
pub jump_distance: f32,
|
|
pub target_platform_index: u32,
|
|
pub landed_x: f32,
|
|
pub landed_y: f32,
|
|
pub result: JumpHopJumpResultKind,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
pub struct JumpHopRunSnapshot {
|
|
pub run_id: String,
|
|
pub profile_id: String,
|
|
pub owner_user_id: String,
|
|
pub status: JumpHopRunStatus,
|
|
pub current_platform_index: u32,
|
|
pub score: u32,
|
|
pub combo: u32,
|
|
pub last_jump: Option<JumpHopLastJump>,
|
|
pub started_at_ms: u64,
|
|
pub finished_at_ms: Option<u64>,
|
|
pub path: JumpHopPath,
|
|
}
|
|
|
|
impl JumpHopDifficulty {
|
|
pub fn as_str(self) -> &'static str {
|
|
match self {
|
|
Self::Easy => "easy",
|
|
Self::Standard => "standard",
|
|
Self::Advanced => "advanced",
|
|
Self::Challenge => "challenge",
|
|
}
|
|
}
|
|
}
|
|
|
|
impl JumpHopTileType {
|
|
pub fn as_str(self) -> &'static str {
|
|
match self {
|
|
Self::Start => "start",
|
|
Self::Normal => "normal",
|
|
Self::Target => "target",
|
|
Self::Finish => "finish",
|
|
Self::Bonus => "bonus",
|
|
Self::Accent => "accent",
|
|
}
|
|
}
|
|
}
|
|
|
|
impl JumpHopRunStatus {
|
|
pub fn as_str(self) -> &'static str {
|
|
match self {
|
|
Self::Playing => "playing",
|
|
Self::Failed => "failed",
|
|
Self::Cleared => "cleared",
|
|
}
|
|
}
|
|
}
|
|
|
|
impl JumpHopJumpResultKind {
|
|
pub fn as_str(self) -> &'static str {
|
|
match self {
|
|
Self::Miss => "miss",
|
|
Self::Hit => "hit",
|
|
Self::Perfect => "perfect",
|
|
Self::Finish => "finish",
|
|
}
|
|
}
|
|
}
|