Move serverside client to a component and communications into server ecs systems

This commit is contained in:
Imbris
2019-10-15 00:06:14 -04:00
committed by Imbris
parent c02cd0a730
commit 2703c8afe1
21 changed files with 1272 additions and 1225 deletions

View File

@ -7,14 +7,14 @@ use vek::*;
pub enum ControlEvent {
Mount(Uid),
Unmount,
InventoryManip(InventoryManip),
//Respawn,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Controller {
pub struct ControllerInputs {
pub primary: bool,
pub secondary: bool,
pub move_dir: Vec2<f32>,
pub look_dir: Vec3<f32>,
pub sit: bool,
pub jump: bool,
pub roll: bool,
@ -23,6 +23,13 @@ pub struct Controller {
pub climb_down: bool,
pub wall_leap: bool,
pub respawn: bool,
pub move_dir: Vec2<f32>,
pub look_dir: Vec3<f32>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Controller {
pub inputs: ControllerInputs,
pub events: Vec<ControlEvent>,
}
@ -60,3 +67,12 @@ pub struct Mounting(pub Uid);
impl Component for Mounting {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum InventoryManip {
Pickup(Uid),
Collect(Vec3<i32>),
Use(usize),
Swap(usize, usize),
Drop(usize),
}