use assembly_core::types::{WorldID, Vector3f, Quaternion, ObjectTemplate, ObjectID};
use assembly_core::num_derive::{FromPrimitive, ToPrimitive};
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 PathWaypointDataMovement {
pub config: WaypointConfig,
}
#[derive(Debug)]
pub struct PathWaypointDataMovingPlatformSounds {
pub arrive_sound: String,
pub depart_sound: String,
}
#[derive(Debug)]
pub struct PathWaypointDataMovingPlatform {
pub rotation: Quaternion,
pub lock_player: bool,
pub speed: f32,
pub wait: f32,
pub sounds: Option<PathWaypointDataMovingPlatformSounds>,
}
#[derive(Debug)]
pub struct PathWaypointDataProperty {}
#[derive(Debug)]
pub struct PathWaypointDataCamera {
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 PathWaypointDataSpawner {
pub rotation: Quaternion,
pub config: WaypointConfig,
}
#[derive(Debug)]
pub struct PathWaypointDataShowcase {}
#[derive(Debug)]
pub struct PathWaypointDataRace {
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 PathWaypointDataRail {
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 PathWaypointVariant<WaypointType> {
pub position: Vector3f,
pub data: WaypointType,
}
pub type PathWaypointVariantMovement = PathWaypointVariant<PathWaypointDataMovement>;
pub type PathWaypointVariantMovingPlatform = PathWaypointVariant<PathWaypointDataMovingPlatform>;
pub type PathWaypointVariantProperty = PathWaypointVariant<PathWaypointDataProperty>;
pub type PathWaypointVariantCamera = PathWaypointVariant<PathWaypointDataCamera>;
pub type PathWaypointVariantSpawner = PathWaypointVariant<PathWaypointDataSpawner>;
pub type PathWaypointVariantShowcase = PathWaypointVariant<PathWaypointDataShowcase>;
pub type PathWaypointVariantRace = PathWaypointVariant<PathWaypointDataRace>;
pub type PathWaypointVariantRail = PathWaypointVariant<PathWaypointDataRail>;
#[derive(Debug)]
pub struct PathHeader {
pub version: PathVersion,
pub path_name: String,
pub value_1: u32,
pub path_composition: PathComposition,
}
#[derive(Debug)]
pub struct PathVariant<DataType, WaypointDataType> {
pub header: PathHeader,
pub path_data: DataType,
pub waypoints: Vec<PathWaypointVariant<WaypointDataType>>
}
pub type PathVariantMovement = PathVariant<PathDataMovement, PathWaypointDataMovement>;
pub type PathVariantMovingPlatform = PathVariant<PathDataMovingPlatform, PathWaypointDataMovingPlatform>;
pub type PathVariantProperty = PathVariant<PathDataProperty, PathWaypointDataProperty>;
pub type PathVariantCamera = PathVariant<PathDataCamera, PathWaypointDataCamera>;
pub type PathVariantSpawner = PathVariant<PathDataSpawner, PathWaypointDataSpawner>;
pub type PathVariantShowcase = PathVariant<PathDataShowcase, PathWaypointDataShowcase>;
pub type PathVariantRace = PathVariant<PathDataRace, PathWaypointDataRace>;
pub type PathVariantRail = PathVariant<PathDataRail, PathWaypointDataRail>;
#[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>,
}