Moved the state out to a different file

This commit is contained in:
2020-05-31 05:29:13 +02:00
parent a888ec9a8a
commit ceb26b40b1
3 changed files with 27 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
use legion::prelude::*;
use rand::prelude::*;
use serde::Serialize;
use crate::state::Object;
#[derive(Clone, Debug, PartialEq)]
struct Name {
@@ -23,13 +24,6 @@ pub struct Simulation {
world: World
}
#[derive(Clone, Serialize)]
pub struct Object {
pub name: String,
pub x: f64,
pub y: f64,
}
impl Simulation {
pub fn new() -> Self {
let universe = Universe::new();