57 lines
1.0 KiB
Rust
57 lines
1.0 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
pub mod item;
|
|
pub mod locations;
|
|
pub mod meta;
|
|
pub mod parameters;
|
|
pub mod player;
|
|
pub mod response;
|
|
pub mod token;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Copy, Clone)]
|
|
pub enum Dimension {
|
|
Overworld,
|
|
Nether,
|
|
TheEnd,
|
|
}
|
|
|
|
impl Default for Dimension {
|
|
fn default() -> Self {
|
|
Self::Overworld
|
|
}
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Copy, Clone)]
|
|
pub enum Direction {
|
|
North,
|
|
East,
|
|
South,
|
|
West,
|
|
}
|
|
|
|
#[derive(Default, Serialize, Deserialize, Debug, Copy, Clone)]
|
|
pub struct Position {
|
|
pub x: i32,
|
|
pub y: i32,
|
|
pub dimension: Dimension,
|
|
}
|
|
|
|
impl Position {
|
|
pub fn new(x: i32, y: i32, dimension: Dimension) -> Self {
|
|
Self { x, y, dimension }
|
|
}
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct Tunnel {
|
|
direction: Direction,
|
|
number: i32,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Ord, PartialOrd, Eq, Hash)]
|
|
pub enum CommandLevel {
|
|
ALL = 0,
|
|
REGISTERED = 1,
|
|
ADMIN = 2,
|
|
}
|