mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Switch everything to IDVStorage (No tuning yet.)
This commit is contained in:
parent
35bf253081
commit
03253d3cc0
@ -6,6 +6,7 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sphynx = { git = "https://gitlab.com/veloren/sphynx.git", features = ["serde1"] }
|
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"] }
|
specs = { version = "0.14.2", features = ["serde", "nightly"] }
|
||||||
vek = { version = "0.9.8", features = ["serde"] }
|
vek = { version = "0.9.8", features = ["serde"] }
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use specs::{Component, FlaggedStorage, VecStorage};
|
use specs::{Component, FlaggedStorage};
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct ActionState {
|
pub struct ActionState {
|
||||||
@ -24,5 +25,5 @@ impl Default for ActionState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for ActionState {
|
impl Component for ActionState {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use specs::{Component, Entity as EcsEntity, VecStorage};
|
use specs::{Component, Entity as EcsEntity};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum Agent {
|
pub enum Agent {
|
||||||
@ -14,5 +15,5 @@ pub enum Agent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Agent {
|
impl Component for Agent {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use specs::{Component, FlaggedStorage, VecStorage};
|
use specs::{Component, FlaggedStorage};
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum Animation {
|
pub enum Animation {
|
||||||
@ -29,5 +30,5 @@ impl Default for AnimationInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for AnimationInfo {
|
impl Component for AnimationInfo {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,8 @@ pub mod object;
|
|||||||
pub mod quadruped;
|
pub mod quadruped;
|
||||||
pub mod quadruped_medium;
|
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)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||||
pub enum Body {
|
pub enum Body {
|
||||||
@ -14,5 +15,5 @@ pub enum Body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Body {
|
impl Component for Body {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use specs::{Component, FlaggedStorage, VecStorage};
|
use specs::{Component, FlaggedStorage};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Controller {
|
pub struct Controller {
|
||||||
@ -12,5 +13,5 @@ pub struct Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Controller {
|
impl Component for Controller {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
|
use specs::{Component, FlaggedStorage, NullStorage};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
pub struct Respawning;
|
pub struct Respawning;
|
||||||
@ -69,19 +70,19 @@ impl Rolling {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for MoveDir {
|
impl Component for MoveDir {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Wielding {
|
impl Component for Wielding {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Attacking {
|
impl Component for Attacking {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Rolling {
|
impl Component for Rolling {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Component for OnGround {
|
impl Component for OnGround {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use specs::{Component, VecStorage};
|
use specs::Component;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||||
pub enum Weapon {
|
pub enum Weapon {
|
||||||
@ -60,5 +61,5 @@ pub enum Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Item {
|
impl Component for Item {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use specs::{Component, VecStorage};
|
use specs::Component;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
//Re-Exports
|
//Re-Exports
|
||||||
pub mod item;
|
pub mod item;
|
||||||
@ -42,5 +43,5 @@ impl Inventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Inventory {
|
impl Component for Inventory {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
use specs::{Component, NullStorage, VecStorage};
|
use specs::{Component, NullStorage};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
// Position
|
// Position
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Pos(pub Vec3<f32>);
|
pub struct Pos(pub Vec3<f32>);
|
||||||
|
|
||||||
impl Component for Pos {
|
impl Component for Pos {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Velocity
|
// Velocity
|
||||||
@ -14,7 +15,7 @@ impl Component for Pos {
|
|||||||
pub struct Vel(pub Vec3<f32>);
|
pub struct Vel(pub Vec3<f32>);
|
||||||
|
|
||||||
impl Component for Vel {
|
impl Component for Vel {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Orientation
|
// Orientation
|
||||||
@ -22,7 +23,7 @@ impl Component for Vel {
|
|||||||
pub struct Ori(pub Vec3<f32>);
|
pub struct Ori(pub Vec3<f32>);
|
||||||
|
|
||||||
impl Component for Ori {
|
impl Component for Ori {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ForceUpdate
|
// ForceUpdate
|
||||||
|
@ -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;
|
const MAX_ALIAS_LEN: usize = 32;
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ impl Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Player {
|
impl Component for Player {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use crate::state::Uid;
|
use crate::state::Uid;
|
||||||
use specs::{Component, FlaggedStorage, VecStorage};
|
use specs::{Component, FlaggedStorage};
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||||
pub enum HealthSource {
|
pub enum HealthSource {
|
||||||
@ -129,7 +130,7 @@ impl Stats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Stats {
|
impl Component for Stats {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
||||||
@ -138,5 +139,5 @@ pub struct Dying {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for Dying {
|
impl Component for Dying {
|
||||||
type Storage = VecStorage<Self>;
|
type Storage = IDVStorage<Self>;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use specs::{Component, FlaggedStorage, VecStorage};
|
use specs::{Component, FlaggedStorage};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
use specs_idvs::IDVStorage;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct LightEmitter {
|
pub struct LightEmitter {
|
||||||
@ -19,5 +20,5 @@ impl Default for LightEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Component for LightEmitter {
|
impl Component for LightEmitter {
|
||||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user