mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Enumerated Body type
This commit is contained in:
parent
0757083b19
commit
8f86e45a72
@ -13,17 +13,18 @@ use specs::{Component, FlaggedStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Body {
|
||||
Humanoid(humanoid::Body),
|
||||
QuadrupedSmall(quadruped_small::Body),
|
||||
QuadrupedMedium(quadruped_medium::Body),
|
||||
BirdMedium(bird_medium::Body),
|
||||
FishMedium(fish_medium::Body),
|
||||
Dragon(dragon::Body),
|
||||
BirdSmall(bird_small::Body),
|
||||
FishSmall(fish_small::Body),
|
||||
BipedLarge(biped_large::Body),
|
||||
Object(object::Body),
|
||||
Humanoid(humanoid::Body) = 0,
|
||||
QuadrupedSmall(quadruped_small::Body) = 1,
|
||||
QuadrupedMedium(quadruped_medium::Body) = 2,
|
||||
BirdMedium(bird_medium::Body) = 3,
|
||||
FishMedium(fish_medium::Body) = 4,
|
||||
Dragon(dragon::Body) = 5,
|
||||
BirdSmall(bird_small::Body) = 6,
|
||||
FishSmall(fish_small::Body) = 7,
|
||||
BipedLarge(biped_large::Body) = 8,
|
||||
Object(object::Body) = 9,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub upper_torso: UpperTorso,
|
||||
@ -34,66 +35,77 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum UpperTorso {
|
||||
Default,
|
||||
}
|
||||
const ALL_UPPER_TORSOS: [UpperTorso; 1] = [UpperTorso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum LowerTorso {
|
||||
Default,
|
||||
}
|
||||
const ALL_LOWER_TORSOS: [LowerTorso; 1] = [LowerTorso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum ShoulderL {
|
||||
Default,
|
||||
}
|
||||
const ALL_SHOULDER_LS: [ShoulderL; 1] = [ShoulderL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum ShoulderR {
|
||||
Default,
|
||||
}
|
||||
const ALL_SHOULDER_RS: [ShoulderR; 1] = [ShoulderR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum HandL {
|
||||
Default,
|
||||
}
|
||||
const ALL_HAND_LS: [HandL; 1] = [HandL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum HandR {
|
||||
Default,
|
||||
}
|
||||
const ALL_HAND_RS: [HandR; 1] = [HandR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum LegL {
|
||||
Default,
|
||||
}
|
||||
const ALL_LEG_LS: [LegL; 1] = [LegL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum LegR {
|
||||
Default,
|
||||
}
|
||||
const ALL_LEG_RS: [LegR; 1] = [LegR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootL {
|
||||
Default,
|
||||
}
|
||||
const ALL_FOOT_LS: [FootL; 1] = [FootL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootR {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub torso: Torso,
|
||||
@ -26,42 +27,49 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Torso {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS: [Torso; 1] = [Torso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Tail {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAILS: [Tail; 1] = [Tail::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingL {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_LS: [WingL; 1] = [WingL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingR {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_RS: [WingR; 1] = [WingR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum LegL {
|
||||
Default,
|
||||
}
|
||||
const ALL_LEG_LS: [LegL; 1] = [LegL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum LegR {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub torso: Torso,
|
||||
@ -20,24 +21,28 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Torso {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS: [Torso; 1] = [Torso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingL {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_LS: [WingL; 1] = [WingL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingR {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub chest_front: ChestFront,
|
||||
@ -38,78 +39,91 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum ChestFront {
|
||||
Default,
|
||||
}
|
||||
const ALL_CHEST_FRONTS: [ChestFront; 1] = [ChestFront::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum ChestRear {
|
||||
Default,
|
||||
}
|
||||
const ALL_CHEST_REARS: [ChestRear; 1] = [ChestRear::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum TailFront {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAIL_FRONTS: [TailFront; 1] = [TailFront::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum TailRear {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAIL_REARS: [TailRear; 1] = [TailRear::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingInL {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_IN_LS: [WingInL; 1] = [WingInL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingInR {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_IN_RS: [WingInR; 1] = [WingInR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingOutL {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_OUT_LS: [WingOutL; 1] = [WingOutL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum WingOutR {
|
||||
Default,
|
||||
}
|
||||
const ALL_WING_OUT_RS: [WingOutR; 1] = [WingOutR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootFL {
|
||||
Default,
|
||||
}
|
||||
const ALL_FOOT_FLS: [FootFL; 1] = [FootFL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootFR {
|
||||
Default,
|
||||
}
|
||||
const ALL_FOOT_FRS: [FootFR; 1] = [FootFR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootBL {
|
||||
Default,
|
||||
}
|
||||
const ALL_FOOT_BLS: [FootBL; 1] = [FootBL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootBR {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub torso: Torso,
|
||||
@ -24,36 +25,42 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Torso {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS: [Torso; 1] = [Torso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Rear {
|
||||
Default,
|
||||
}
|
||||
const ALL_REARS: [Rear; 1] = [Rear::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Tail {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAILS: [Tail; 1] = [Tail::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FinL {
|
||||
Default,
|
||||
}
|
||||
const ALL_FIN_LS: [FinL; 1] = [FinL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FinR {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub torso: Torso,
|
||||
pub tail: Tail,
|
||||
@ -16,12 +17,14 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Torso {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS: [Torso; 1] = [Torso::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Tail {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub head: Head,
|
||||
pub shoulder: Shoulder,
|
||||
pub chest: Chest,
|
||||
pub hand: Hand
|
||||
pub hand: Hand
|
||||
pub belt: Belt,
|
||||
pub pants: Pants,
|
||||
pub foot: Foot,
|
||||
pub foot: Foot,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
@ -27,40 +28,47 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Shoulder {
|
||||
Default,
|
||||
}
|
||||
const ALL_SHOULDERS: [Shoulder; 1] = [Shoulder::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Chest {
|
||||
Default,
|
||||
}
|
||||
const ALL_CHESTS: [Chest; 1] = [Chest::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Hand {
|
||||
Default,
|
||||
}
|
||||
const ALL_HANDS: [Hand; 1] = [Hand::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Belt {
|
||||
Default,
|
||||
}
|
||||
const ALL_BELTS: [Belt; 1] = [Belt::Default];
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Pants {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEET: [Foot; 1] = [Foot::Default];
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Foot {
|
||||
Default,
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ use rand::{seq::SliceRandom, thread_rng, Rng};
|
||||
use vek::Rgb;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub race: Race,
|
||||
pub body_type: BodyType,
|
||||
@ -59,13 +60,14 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Race {
|
||||
Danari,
|
||||
Dwarf,
|
||||
Elf,
|
||||
Human,
|
||||
Orc,
|
||||
Undead,
|
||||
Danari = 0,
|
||||
Dwarf = 1,
|
||||
Elf = 2,
|
||||
Human = 3,
|
||||
Orc = 4,
|
||||
Undead = 5,
|
||||
}
|
||||
pub const ALL_RACES: [Race; 6] = [
|
||||
Race::Danari,
|
||||
@ -379,21 +381,23 @@ impl Race {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum BodyType {
|
||||
Female,
|
||||
Male,
|
||||
Female = 0,
|
||||
Male = 1,
|
||||
}
|
||||
pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Chest {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
Midnight,
|
||||
Kimono,
|
||||
Blue = 0,
|
||||
Brown = 1,
|
||||
Dark = 2,
|
||||
Green = 3,
|
||||
Orange = 4,
|
||||
Midnight = 5,
|
||||
Kimono = 6,
|
||||
}
|
||||
pub const ALL_CHESTS: [Chest; 7] = [
|
||||
Chest::Blue,
|
||||
@ -406,20 +410,22 @@ pub const ALL_CHESTS: [Chest; 7] = [
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Belt {
|
||||
Dark,
|
||||
Cloth,
|
||||
Dark = 0,
|
||||
Cloth = 1,
|
||||
}
|
||||
pub const ALL_BELTS: [Belt; 2] = [Belt::Dark, Belt::Cloth];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Pants {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
Kimono,
|
||||
Blue = 0,
|
||||
Brown = 1,
|
||||
Dark = 2,
|
||||
Green = 3,
|
||||
Orange = 4,
|
||||
Kimono = 5,
|
||||
}
|
||||
pub const ALL_PANTS: [Pants; 6] = [
|
||||
Pants::Blue,
|
||||
@ -431,47 +437,52 @@ pub const ALL_PANTS: [Pants; 6] = [
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Hand {
|
||||
Bare,
|
||||
Cloth,
|
||||
Bare = 0,
|
||||
Cloth = 1,
|
||||
}
|
||||
pub const ALL_HANDS: [Hand; 2] = [Hand::Bare, Hand::Cloth];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Foot {
|
||||
Bare,
|
||||
Dark,
|
||||
Sandal,
|
||||
Jester,
|
||||
Bare = 0,
|
||||
Dark = 1,
|
||||
Sandal = 2,
|
||||
Jester = 3,
|
||||
}
|
||||
pub const ALL_FEET: [Foot; 4] = [Foot::Bare, Foot::Dark, Foot::Sandal, Foot::Jester];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Shoulder {
|
||||
None,
|
||||
Brown1,
|
||||
Chain,
|
||||
None = 0,
|
||||
Brown1 = 1,
|
||||
Chain = 2,
|
||||
}
|
||||
pub const ALL_SHOULDERS: [Shoulder; 3] = [Shoulder::None, Shoulder::Brown1, Shoulder::Chain];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Eyebrows {
|
||||
Yup,
|
||||
Yup = 0,
|
||||
}
|
||||
pub const ALL_EYEBROWS: [Eyebrows; 1] = [Eyebrows::Yup];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum EyeColor {
|
||||
VigorousBlack,
|
||||
NobleBlue,
|
||||
CuriousGreen,
|
||||
LoyalBrown,
|
||||
ViciousRed,
|
||||
PumpkinOrange,
|
||||
GhastlyYellow,
|
||||
MagicPurple,
|
||||
ToxicGreen,
|
||||
ExoticPurple,
|
||||
VigorousBlack = 0,
|
||||
NobleBlue = 1,
|
||||
CuriousGreen = 2,
|
||||
LoyalBrown = 3,
|
||||
ViciousRed = 4,
|
||||
PumpkinOrange = 5,
|
||||
GhastlyYellow = 6,
|
||||
MagicPurple = 7,
|
||||
ToxicGreen = 8,
|
||||
ExoticPurple = 9,
|
||||
}
|
||||
impl EyeColor {
|
||||
pub fn light_rgb(self) -> Rgb<u8> {
|
||||
@ -508,35 +519,37 @@ impl EyeColor {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Accessory {
|
||||
Nothing,
|
||||
Some,
|
||||
Nothing = 0,
|
||||
Some = 1,
|
||||
}
|
||||
pub const ALL_ACCESSORIES: [Accessory; 2] = [Accessory::Nothing, Accessory::Some];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Skin {
|
||||
Pale,
|
||||
White,
|
||||
Tanned,
|
||||
Brown,
|
||||
TannedBrown,
|
||||
TannedDarkBrown,
|
||||
Iron,
|
||||
Steel,
|
||||
DanariOne,
|
||||
DanariTwo,
|
||||
DanariThree,
|
||||
DanariFour,
|
||||
ElfOne,
|
||||
ElfTwo,
|
||||
ElfThree,
|
||||
OrcOne,
|
||||
OrcTwo,
|
||||
OrcThree,
|
||||
UndeadOne,
|
||||
UndeadTwo,
|
||||
UndeadThree,
|
||||
Pale = 0,
|
||||
White = 1,
|
||||
Tanned = 2,
|
||||
Brown = 3,
|
||||
TannedBrown = 4,
|
||||
TannedDarkBrown = 5,
|
||||
Iron = 6,
|
||||
Steel = 7,
|
||||
DanariOne = 8,
|
||||
DanariTwo = 9,
|
||||
DanariThree = 10,
|
||||
DanariFour = 11,
|
||||
ElfOne = 12,
|
||||
ElfTwo = 13,
|
||||
ElfThree = 14,
|
||||
OrcOne = 15,
|
||||
OrcTwo = 16,
|
||||
OrcThree = 17,
|
||||
UndeadOne = 18,
|
||||
UndeadTwo = 19,
|
||||
UndeadThree = 20,
|
||||
}
|
||||
impl Skin {
|
||||
pub fn rgb(self) -> Rgb<u8> {
|
||||
|
@ -1,58 +1,59 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Body {
|
||||
Arrow,
|
||||
Bomb,
|
||||
Scarecrow,
|
||||
Cauldron,
|
||||
ChestVines,
|
||||
Chest,
|
||||
ChestDark,
|
||||
ChestDemon,
|
||||
ChestGold,
|
||||
ChestLight,
|
||||
ChestOpen,
|
||||
ChestSkull,
|
||||
Pumpkin,
|
||||
Pumpkin2,
|
||||
Pumpkin3,
|
||||
Pumpkin4,
|
||||
Pumpkin5,
|
||||
Campfire,
|
||||
LanternGround,
|
||||
LanternGroundOpen,
|
||||
LanternStanding2,
|
||||
LanternStanding,
|
||||
PotionBlue,
|
||||
PotionGreen,
|
||||
PotionRed,
|
||||
Crate,
|
||||
Tent,
|
||||
WindowSpooky,
|
||||
DoorSpooky,
|
||||
Anvil,
|
||||
Gravestone,
|
||||
Gravestone2,
|
||||
Bench,
|
||||
Chair,
|
||||
Chair2,
|
||||
Chair3,
|
||||
Table,
|
||||
Table2,
|
||||
Table3,
|
||||
Drawer,
|
||||
BedBlue,
|
||||
Carpet,
|
||||
Bedroll,
|
||||
CarpetHumanRound,
|
||||
CarpetHumanSquare,
|
||||
CarpetHumanSquare2,
|
||||
CarpetHumanSquircle,
|
||||
Pouch,
|
||||
CraftingBench,
|
||||
BoltFire,
|
||||
ArrowSnake,
|
||||
Arrow = 0,
|
||||
Bomb = 1,
|
||||
Scarecrow = 2,
|
||||
Cauldron = 3,
|
||||
ChestVines = 4,
|
||||
Chest = 5,
|
||||
ChestDark = 6,
|
||||
ChestDemon = 7,
|
||||
ChestGold = 8,
|
||||
ChestLight = 9,
|
||||
ChestOpen = 10,
|
||||
ChestSkull = 11,
|
||||
Pumpkin = 12,
|
||||
Pumpkin2 = 13,
|
||||
Pumpkin3 = 14,
|
||||
Pumpkin4 = 15,
|
||||
Pumpkin5 = 16,
|
||||
Campfire = 17,
|
||||
LanternGround = 18,
|
||||
LanternGroundOpen = 19,
|
||||
LanternStanding2 = 20,
|
||||
LanternStanding = 21,
|
||||
PotionBlue = 22,
|
||||
PotionGreen = 23,
|
||||
PotionRed = 24,
|
||||
Crate = 25,
|
||||
Tent = 26,
|
||||
WindowSpooky = 27,
|
||||
DoorSpooky = 28,
|
||||
Anvil = 29,
|
||||
Gravestone = 30,
|
||||
Gravestone2 = 31,
|
||||
Bench = 32,
|
||||
Chair = 33,
|
||||
Chair2 = 34,
|
||||
Chair3 = 35,
|
||||
Table = 36,
|
||||
Table2 = 37,
|
||||
Table3 = 38,
|
||||
Drawer = 39,
|
||||
BedBlue = 40,
|
||||
Carpet = 41,
|
||||
Bedroll = 42,
|
||||
CarpetHumanRound = 43,
|
||||
CarpetHumanSquare = 44,
|
||||
CarpetHumanSquare2 = 45,
|
||||
CarpetHumanSquircle = 46,
|
||||
Pouch = 47,
|
||||
CraftingBench = 48,
|
||||
BoltFire = 49,
|
||||
ArrowSnake = 50,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
|
@ -1,6 +1,7 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct Body {
|
||||
pub head_upper: HeadUpper,
|
||||
pub jaw: Jaw,
|
||||
@ -35,66 +36,77 @@ impl Body {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum HeadUpper {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS_UPPER: [HeadUpper; 1] = [HeadUpper::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Jaw {
|
||||
Default,
|
||||
}
|
||||
const ALL_JAWS: [Jaw; 1] = [Jaw::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum HeadLower {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS_LOWER: [HeadLower; 1] = [HeadLower::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Tail {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAILS: [Tail; 1] = [Tail::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum TorsoBack {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS_BACK: [TorsoBack; 1] = [TorsoBack::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum TorsoMid {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS_MID: [TorsoMid; 1] = [TorsoMid::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum Ears {
|
||||
Default,
|
||||
}
|
||||
const ALL_EARS: [Ears; 1] = [Ears::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootLF {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_LF: [FootLF; 1] = [FootLF::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootRF {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_RF: [FootRF; 1] = [FootRF::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootLB {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_LB: [FootLB; 1] = [FootLB::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[repr(u32)]
|
||||
pub enum FootRB {
|
||||
Default,
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![type_length_limit = "1664759"]
|
||||
#![feature(trait_alias)]
|
||||
#![feature(trait_alias, arbitrary_enum_discriminant)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
@ -5,6 +5,7 @@ use serde_derive::{Deserialize, Serialize};
|
||||
use std::{fs, io, path::PathBuf};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct CharacterData {
|
||||
pub name: String,
|
||||
pub body: comp::Body,
|
||||
@ -12,6 +13,7 @@ pub struct CharacterData {
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
#[repr(C)]
|
||||
pub struct Meta {
|
||||
pub characters: Vec<CharacterData>,
|
||||
pub selected_character: usize,
|
||||
|
Loading…
Reference in New Issue
Block a user