Switch everything to IDVStorage (No tuning yet.)

This commit is contained in:
Acrimon 2019-07-29 21:54:48 +02:00
parent 35bf253081
commit 03253d3cc0
13 changed files with 43 additions and 30 deletions

View File

@ -6,6 +6,7 @@ edition = "2018"
[dependencies]
sphynx = { git = "https://gitlab.com/veloren/sphynx.git", features = ["serde1"] }
specs-idvs = { git = "http://gitlab.nebulanet.cc/xacrimon/specs-idvs.git" }
specs = { version = "0.14.2", features = ["serde", "nightly"] }
vek = { version = "0.9.8", features = ["serde"] }

View File

@ -1,4 +1,5 @@
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActionState {
@ -24,5 +25,5 @@ impl Default for ActionState {
}
impl Component for ActionState {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}

View File

@ -1,5 +1,6 @@
use specs::{Component, Entity as EcsEntity, VecStorage};
use specs::{Component, Entity as EcsEntity};
use vek::*;
use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug)]
pub enum Agent {
@ -14,5 +15,5 @@ pub enum Agent {
}
impl Component for Agent {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}

View File

@ -1,4 +1,5 @@
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Animation {
@ -29,5 +30,5 @@ impl Default for AnimationInfo {
}
impl Component for AnimationInfo {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}

View File

@ -3,7 +3,8 @@ pub mod object;
pub mod quadruped;
pub mod quadruped_medium;
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Body {
@ -14,5 +15,5 @@ pub enum Body {
}
impl Component for Body {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}

View File

@ -1,5 +1,6 @@
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use vek::*;
use specs_idvs::IDVStorage;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Controller {
@ -12,5 +13,5 @@ pub struct Controller {
}
impl Component for Controller {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}

View File

@ -1,5 +1,6 @@
use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
use specs::{Component, FlaggedStorage, NullStorage};
use vek::*;
use specs_idvs::IDVStorage;
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct Respawning;
@ -69,19 +70,19 @@ impl Rolling {
}
impl Component for MoveDir {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}
impl Component for Wielding {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for Attacking {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for Rolling {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for OnGround {

View File

@ -1,4 +1,5 @@
use specs::{Component, VecStorage};
use specs::Component;
use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Weapon {
@ -60,5 +61,5 @@ pub enum Item {
}
impl Component for Item {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}

View File

@ -1,4 +1,5 @@
use specs::{Component, VecStorage};
use specs::Component;
use specs_idvs::IDVStorage;
//Re-Exports
pub mod item;
@ -42,5 +43,5 @@ impl Inventory {
}
impl Component for Inventory {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}

View File

@ -1,12 +1,13 @@
use specs::{Component, NullStorage, VecStorage};
use specs::{Component, NullStorage};
use vek::*;
use specs_idvs::IDVStorage;
// Position
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Pos(pub Vec3<f32>);
impl Component for Pos {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}
// Velocity
@ -14,7 +15,7 @@ impl Component for Pos {
pub struct Vel(pub Vec3<f32>);
impl Component for Vel {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}
// Orientation
@ -22,7 +23,7 @@ impl Component for Vel {
pub struct Ori(pub Vec3<f32>);
impl Component for Ori {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}
// ForceUpdate

View File

@ -1,4 +1,5 @@
use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
use specs::{Component, FlaggedStorage, NullStorage};
use specs_idvs::IDVStorage;
const MAX_ALIAS_LEN: usize = 32;
@ -23,7 +24,7 @@ impl Player {
}
impl Component for Player {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
#[derive(Clone, Debug, Default, Serialize, Deserialize)]

View File

@ -1,5 +1,6 @@
use crate::state::Uid;
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
pub enum HealthSource {
@ -129,7 +130,7 @@ impl Stats {
}
impl Component for Stats {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
@ -138,5 +139,5 @@ pub struct Dying {
}
impl Component for Dying {
type Storage = VecStorage<Self>;
type Storage = IDVStorage<Self>;
}

View File

@ -1,5 +1,6 @@
use specs::{Component, FlaggedStorage, VecStorage};
use specs::{Component, FlaggedStorage};
use vek::*;
use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LightEmitter {
@ -19,5 +20,5 @@ impl Default for LightEmitter {
}
impl Component for LightEmitter {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}