use crate::core::types::{WorldID, Vector3f, Quaternion, ObjectTemplate, ObjectID};
use std::collections::HashMap;
#[derive(Clone, Debug, FromPrimitive, ToPrimitive)]
pub struct ZonePathsVersion(u32);
#[derive(Clone, Copy, Debug, FromPrimitive, ToPrimitive)]
pub struct PathVersion(u32);
impl PathVersion {
pub fn min(self, val: u32) -> bool {
return self.0 >= val;
}
}
#[derive(Debug, FromPrimitive, ToPrimitive)]
pub enum PathType {
Movement,
MovingPlatform,
Property,
Camera,
Spawner,
Showcase,
Race,
Rail,
}
#[derive(Debug, FromPrimitive, ToPrimitive)]
pub enum PathComposition {
Polygon,
Points,
Line,
}
#[derive(Debug)]
pub struct PathDataMovement {}
#[derive(Debug)]
pub struct PathDataMovingPlatform {
pub something: Option<u8>,
pub platform_travel_sound: Option<String>,
}
#[derive(Debug, FromPrimitive, ToPrimitive)]
pub enum PropertyRentalTimeUnit {
Forever,
Seconds,
Minutes,
Hours,
Days,
Weeks,
Months,
Years,
}
#[derive(Debug, FromPrimitive, ToPrimitive)]
pub enum PropertyAchievementRequired {
None,
Builder,
Craftsman,
SeniorBuilder,
Journeyman,
MasterBuilder,
Architect,
SeniorArchitect,
MasterArchitect,
Visionary,
Exemplar,
}
#[derive(Debug)]
pub struct PathDataProperty {
pub value_1: u32,
pub price: u32,
pub rental_time: u32,
pub associated_map: WorldID,
pub value_2: u32,
pub display_name: String,
pub display_description: String,
pub value_3: u32,
pub clone_limit: u32,
pub reputation_multiplier: f32,
pub rental_time_unit: PropertyRentalTimeUnit,
pub achievement_required: PropertyAchievementRequired,
pub player_zone_coordinate: Vector3f,
pub max_build_height: f32,
}
#[derive(Debug)]
pub struct PathDataCamera {
pub next_path: String,
pub value_1: Option<u8>,
}
#[derive(Debug)]
pub struct PathDataSpawner {
pub spawned_lot: ObjectTemplate,
pub respawn_time: u32,
pub max_to_spawn: u32,
pub min_to_spawn: u32,
pub spawner_obj_id: ObjectID,
pub activate_network_on_load: bool,
}
#[derive(Debug)]
pub struct PathDataShowcase {}
#[derive(Debug)]
pub struct PathDataRace {}
#[derive(Debug)]
pub struct PathDataRail {}
#[derive(Debug)]
pub struct PathWaypointMovement {
pub config: WaypointConfig,
}
#[derive(Debug)]
pub struct PathWaypointMovingPlatformSounds {
pub arrive_sound: String,
pub depart_sound: String,
}
#[derive(Debug)]
pub struct PathWaypointMovingPlatform {
pub rotation: Quaternion,
pub lock_player: bool,
pub speed: f32,
pub wait: f32,
pub sounds: Option<PathWaypointMovingPlatformSounds>,
}
#[derive(Debug)]
pub struct PathWaypointProperty {}
#[derive(Debug)]
pub struct PathWaypointCamera {
pub value_1: f32,
pub value_2: f32,
pub value_3: f32,
pub value_4: f32,
pub time: f32,
pub value_5: f32,
pub tension: f32,
pub continuity: f32,
pub bias: f32,
}
#[derive(Debug)]
pub struct PathWaypointSpawner {
pub rotation: Quaternion,
pub config: WaypointConfig,
}
#[derive(Debug)]
pub struct PathWaypointShowcase {}
#[derive(Debug)]
pub struct PathWaypointRace {
pub rotation: Quaternion,
pub value_1: u8,
pub value_2: u8,
pub value_3: f32,
pub value_4: f32,
pub value_5: f32,
}
#[derive(Debug)]
pub struct PathWaypointRail {
pub value_1: f32,
pub value_2: f32,
pub value_3: f32,
pub value_4: f32,
pub config: WaypointConfig,
}
pub type WaypointConfig = HashMap<String, String>;
#[derive(Debug)]
pub struct PathWaypoint<WaypointType> {
pub position: Vector3f,
pub data: WaypointType,
}
#[derive(Debug)]
pub struct PathVariant<DataType, WaypointType> {
pub version: PathVersion,
pub path_name: String,
pub value_1: u32,
pub path_composition: PathComposition,
pub path_data: DataType,
pub waypoints: Vec<PathWaypoint<WaypointType>>
}
pub type PathVariantMovement = PathVariant<PathDataMovement,PathWaypointMovement>;
pub type PathVariantMovingPlatform = PathVariant<PathDataMovingPlatform, PathWaypointMovingPlatform>;
pub type PathVariantProperty = PathVariant<PathDataProperty, PathWaypointProperty>;
pub type PathVariantCamera = PathVariant<PathDataCamera, PathWaypointCamera>;
pub type PathVariantSpawner = PathVariant<PathDataSpawner, PathWaypointSpawner>;
pub type PathVariantShowcase = PathVariant<PathDataShowcase, PathWaypointShowcase>;
pub type PathVariantRace = PathVariant<PathDataRace, PathWaypointRace>;
pub type PathVariantRail = PathVariant<PathDataRail, PathWaypointRail>;
#[derive(Debug)]
pub enum Path {
Movement(PathVariantMovement),
MovingPlatform(PathVariantMovingPlatform),
Property(PathVariantProperty),
Camera(PathVariantCamera),
Spawner(PathVariantSpawner),
Showcase(PathVariantShowcase),
Race(PathVariantRace),
Rail(PathVariantRail),
}
#[derive(Debug)]
pub struct ZonePaths {
pub version: ZonePathsVersion,
pub paths: Vec<Path>,
}