Commit e49b0adf authored by Luke Jones's avatar Luke Jones

Move `world.rs` to manager dir

parent 6ef39a15
/// The world ECS controller
pub mod world;
/// Systems that the World uses
pub mod systems;
/// The possible messages between components
......@@ -131,7 +129,7 @@ impl Velocity {
/// Used by collisions and physics
pub struct AABB {
rect: Rect,
pub rect: Rect,
}
impl AABB {
pub fn new(x:i32, y:i32, w:u32, h:u32) -> AABB {
......@@ -196,8 +194,8 @@ impl Default for Player {
}
pub struct Ai {
speed: f32,
jump_h: f32,
pub speed: f32,
pub jump_h: f32,
}
impl Ai {
pub fn new(s:f32, jh:f32) -> Ai {
......@@ -241,14 +239,14 @@ impl Sprite {
/// links to a resource sheet and shifts frames over it
pub struct Animation {
counter: u32,
speed: u32,
current: u32,
start_frame: u32,
per_anim: u32,
columns: u32,
pub counter: u32,
pub speed: u32,
pub current: u32,
pub start_frame: u32,
pub per_anim: u32,
pub columns: u32,
/// Stores the name of the sequence and frame start number
keys: HashMap<String, u32>,
pub keys: HashMap<String, u32>,
pub frame: Rect,
pub sid: String,
}
......@@ -292,8 +290,8 @@ impl Animation {
}
pub struct Health {
current: i32,
max: i32,
pub current: i32,
pub max: i32,
}
impl Health {
pub fn new(current:i32, max:i32) -> Health {
......@@ -307,8 +305,8 @@ impl Default for Health {
}
pub struct Armour {
current: i32,
max: i32,
pub current: i32,
pub max: i32,
}
impl Armour {
pub fn new(current:i32, max:i32) -> Armour {
......@@ -322,8 +320,8 @@ impl Default for Armour {
}
pub struct Inventory {
weapons: Vec<Weapon>,
items: Vec<Item>,
pub weapons: Vec<Weapon>,
pub items: Vec<Item>,
}
impl Default for Inventory {
fn default () -> Inventory {
......@@ -339,15 +337,15 @@ pub enum Weapon {
}
pub struct WeaponRanged {
name: String,
range: u32,
damage: u32,
speed: u32,
spread: u32,
max_ammo: u32,
cur_ammo: u32,
reload_speed: u32,
shot_count: u32,
pub name: String,
pub range: u32,
pub damage: u32,
pub speed: u32,
pub spread: u32,
pub max_ammo: u32,
pub cur_ammo: u32,
pub reload_speed: u32,
pub shot_count: u32,
}
impl WeaponRanged {
pub fn new(n:String, r:u32, d:u32, s:u32, sp:u32, ma:u32, ca:u32, rs:u32, sc:u32) -> WeaponRanged {
......@@ -381,10 +379,10 @@ impl Default for WeaponRanged {
}
pub struct WeaponMelee {
name: String,
range: u32,
damage: u32,
speed: u32,
pub name: String,
pub range: u32,
pub damage: u32,
pub speed: u32,
}
impl WeaponMelee {
pub fn new(n:String, r:u32, d:u32, s:u32) -> WeaponMelee {
......@@ -405,8 +403,8 @@ pub enum ItemEffects {
Armour(u32),
}
pub struct Item {
name: String,
effect: ItemEffects,
pub name: String,
pub effect: ItemEffects,
}
impl Item {
pub fn new(n:String, e:ItemEffects) -> Item {
......
......@@ -7,3 +7,5 @@ pub mod input;
pub mod states;
/// Load and parse level files plus set up tile_sets
pub mod levels;
//// The world controls such things as the viewport, rendering, entities and their updates
pub mod world;
......@@ -9,7 +9,7 @@ use manager::input::Input;
use manager::bindings::Bindings;
use manager::levels::*;
use resource::SpriteStore;
use components::world::World;
use manager::world::World;
use std::collections::HashMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment