2019-05-23 15:14:39 +00:00
|
|
|
use specs::{Component, NullStorage, FlaggedStorage, VecStorage};
|
2019-04-10 17:23:27 +00:00
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
pub struct Player {
|
|
|
|
pub alias: String,
|
2019-05-19 00:45:02 +00:00
|
|
|
pub view_distance: Option<u32>,
|
2019-04-10 17:23:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Player {
|
2019-05-19 00:45:02 +00:00
|
|
|
pub fn new(alias: String, view_distance: Option<u32>) -> Self {
|
|
|
|
Self {
|
|
|
|
alias,
|
|
|
|
view_distance,
|
|
|
|
}
|
2019-04-10 17:23:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Player {
|
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
|
|
|
}
|
2019-05-23 15:14:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
|
|
|
pub struct Respawn;
|
|
|
|
impl Component for Respawn {
|
|
|
|
type Storage = NullStorage<Self>;
|
|
|
|
}
|