2019-07-21 12:42:45 +00:00
|
|
|
use rand::{seq::SliceRandom, thread_rng};
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
|
|
pub enum Body {
|
2019-09-16 15:58:40 +00:00
|
|
|
Arrow,
|
2019-07-21 12:42:45 +00:00
|
|
|
Bomb,
|
|
|
|
Scarecrow,
|
2019-07-22 12:23:22 +00:00
|
|
|
Cauldron,
|
2019-07-21 23:54:31 +00:00
|
|
|
ChestVines,
|
2019-07-21 12:42:45 +00:00
|
|
|
Chest,
|
2019-07-21 23:54:31 +00:00
|
|
|
ChestDark,
|
|
|
|
ChestDemon,
|
|
|
|
ChestGold,
|
|
|
|
ChestLight,
|
|
|
|
ChestOpen,
|
|
|
|
ChestSkull,
|
2019-07-28 09:21:17 +00:00
|
|
|
Pumpkin,
|
2019-07-21 23:54:31 +00:00
|
|
|
Pumpkin2,
|
|
|
|
Pumpkin3,
|
|
|
|
Pumpkin4,
|
|
|
|
Pumpkin5,
|
|
|
|
Campfire,
|
|
|
|
LanternGround,
|
|
|
|
LanternGroundOpen,
|
|
|
|
LanternStanding2,
|
|
|
|
LanternStanding,
|
|
|
|
PotionBlue,
|
|
|
|
PotionGreen,
|
|
|
|
PotionRed,
|
|
|
|
Crate,
|
2019-07-23 23:21:37 +00:00
|
|
|
Tent,
|
2019-07-24 00:49:16 +00:00
|
|
|
WindowSpooky,
|
|
|
|
DoorSpooky,
|
|
|
|
Anvil,
|
2019-07-28 09:21:17 +00:00
|
|
|
Gravestone,
|
2019-07-24 00:49:16 +00:00
|
|
|
Gravestone2,
|
|
|
|
Bench,
|
|
|
|
Chair,
|
2019-07-28 09:21:17 +00:00
|
|
|
Chair2,
|
|
|
|
Chair3,
|
2019-07-24 00:49:16 +00:00
|
|
|
Table,
|
2019-07-28 09:21:17 +00:00
|
|
|
Table2,
|
|
|
|
Table3,
|
2019-07-24 00:49:16 +00:00
|
|
|
Drawer,
|
|
|
|
BedBlue,
|
2019-07-28 09:21:17 +00:00
|
|
|
Carpet,
|
|
|
|
Bedroll,
|
|
|
|
CarpetHumanRound,
|
|
|
|
CarpetHumanSquare,
|
|
|
|
CarpetHumanSquare2,
|
|
|
|
CarpetHumanSquircle,
|
2019-07-29 16:19:08 +00:00
|
|
|
Pouch,
|
2019-10-02 10:05:17 +00:00
|
|
|
CraftingBench,
|
2019-10-17 20:59:36 +00:00
|
|
|
BoltFire,
|
|
|
|
ArrowSnake,
|
2019-07-21 12:42:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Body {
|
|
|
|
pub fn random() -> Self {
|
|
|
|
let mut rng = thread_rng();
|
|
|
|
*(&ALL_OBJECTS).choose(&mut rng).unwrap()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-17 20:59:36 +00:00
|
|
|
const ALL_OBJECTS: [Body; 50] = [
|
2019-09-16 15:58:40 +00:00
|
|
|
Body::Arrow,
|
2019-07-21 23:54:31 +00:00
|
|
|
Body::Bomb,
|
|
|
|
Body::Scarecrow,
|
2019-07-22 12:23:22 +00:00
|
|
|
Body::Cauldron,
|
2019-07-21 23:54:31 +00:00
|
|
|
Body::ChestVines,
|
|
|
|
Body::Chest,
|
|
|
|
Body::ChestDark,
|
|
|
|
Body::ChestDemon,
|
|
|
|
Body::ChestGold,
|
|
|
|
Body::ChestLight,
|
|
|
|
Body::ChestOpen,
|
|
|
|
Body::ChestSkull,
|
2019-07-28 09:21:17 +00:00
|
|
|
Body::Pumpkin,
|
2019-07-21 23:54:31 +00:00
|
|
|
Body::Pumpkin2,
|
|
|
|
Body::Pumpkin3,
|
|
|
|
Body::Pumpkin4,
|
|
|
|
Body::Pumpkin5,
|
|
|
|
Body::Campfire,
|
|
|
|
Body::LanternGround,
|
|
|
|
Body::LanternGroundOpen,
|
|
|
|
Body::LanternStanding,
|
|
|
|
Body::LanternStanding2,
|
|
|
|
Body::PotionRed,
|
|
|
|
Body::PotionBlue,
|
|
|
|
Body::PotionGreen,
|
|
|
|
Body::Crate,
|
2019-07-23 23:21:37 +00:00
|
|
|
Body::Tent,
|
2019-07-24 00:49:16 +00:00
|
|
|
Body::WindowSpooky,
|
|
|
|
Body::DoorSpooky,
|
|
|
|
Body::Anvil,
|
2019-07-28 09:21:17 +00:00
|
|
|
Body::Gravestone,
|
2019-07-24 00:49:16 +00:00
|
|
|
Body::Gravestone2,
|
|
|
|
Body::Bench,
|
|
|
|
Body::Chair,
|
2019-07-28 09:21:17 +00:00
|
|
|
Body::Chair2,
|
|
|
|
Body::Chair3,
|
2019-07-24 00:49:16 +00:00
|
|
|
Body::Table,
|
2019-07-28 09:21:17 +00:00
|
|
|
Body::Table2,
|
|
|
|
Body::Table3,
|
2019-07-24 00:49:16 +00:00
|
|
|
Body::Drawer,
|
|
|
|
Body::BedBlue,
|
2019-07-28 09:21:17 +00:00
|
|
|
Body::Carpet,
|
|
|
|
Body::Bedroll,
|
|
|
|
Body::CarpetHumanRound,
|
|
|
|
Body::CarpetHumanSquare,
|
|
|
|
Body::CarpetHumanSquare2,
|
|
|
|
Body::CarpetHumanSquircle,
|
2019-10-02 10:05:17 +00:00
|
|
|
Body::CraftingBench,
|
2019-10-17 20:59:36 +00:00
|
|
|
Body::BoltFire,
|
|
|
|
Body::ArrowSnake,
|
2019-07-21 23:54:31 +00:00
|
|
|
];
|