Fix some minor component issues
This commit is contained in:
parent
37b042e434
commit
86d46b8d5b
@ -5,7 +5,7 @@ use specs::prelude::*;
|
|||||||
use specs::saveload::{ConvertSaveload, Marker};
|
use specs::saveload::{ConvertSaveload, Marker};
|
||||||
use specs_derive::*;
|
use specs_derive::*;
|
||||||
|
|
||||||
#[derive(Component, ConvertSaveload, Clone)]
|
#[derive(Component, ConvertSaveload, Copy, Clone)]
|
||||||
pub struct Position {
|
pub struct Position {
|
||||||
pub x: i32,
|
pub x: i32,
|
||||||
pub y: i32,
|
pub y: i32,
|
||||||
@ -13,19 +13,13 @@ pub struct Position {
|
|||||||
|
|
||||||
impl From<(i32, i32)> for Position {
|
impl From<(i32, i32)> for Position {
|
||||||
fn from(f: (i32, i32)) -> Self {
|
fn from(f: (i32, i32)) -> Self {
|
||||||
Position {
|
Position { x: f.0, y: f.1 }
|
||||||
x: f.0,
|
|
||||||
y: f.1,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Point> for Position {
|
impl From<Point> for Position {
|
||||||
fn from(p: Point) -> Self {
|
fn from(p: Point) -> Self {
|
||||||
Position {
|
Position { x: p.x, y: p.y }
|
||||||
x: p.x,
|
|
||||||
y: p.y,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +547,10 @@ fn main() -> rltk::BError {
|
|||||||
gs.ecs.insert(Map::new(1));
|
gs.ecs.insert(Map::new(1));
|
||||||
gs.ecs.insert(Point::zero());
|
gs.ecs.insert(Point::zero());
|
||||||
gs.ecs.insert(rltk::RandomNumberGenerator::new());
|
gs.ecs.insert(rltk::RandomNumberGenerator::new());
|
||||||
gs.ecs.insert(spawner::player(&mut gs.ecs, 0, 0));
|
|
||||||
|
let player_entity = spawner::player(&mut gs.ecs, 0, 0);
|
||||||
|
gs.ecs.insert(player_entity);
|
||||||
|
|
||||||
gs.ecs.insert(RunState::MapGeneration {});
|
gs.ecs.insert(RunState::MapGeneration {});
|
||||||
gs.ecs.insert(GameLog::new("Welcome to Rusty Roguelike"));
|
gs.ecs.insert(GameLog::new("Welcome to Rusty Roguelike"));
|
||||||
gs.ecs.insert(particle_system::ParticleBuilder::new());
|
gs.ecs.insert(particle_system::ParticleBuilder::new());
|
||||||
|
Loading…
Reference in New Issue
Block a user