summaryrefslogtreecommitdiff
path: root/src/resources/mod.rs
blob: 2f218fecd38f3680a7a9c8e81d3d7321e8c889ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

mod ground;
mod newentities;

pub use ground::Ground;
pub use newentities::NewEntities;

use std::collections::{HashMap};
use specs::{Entity};

use crate::{
	Pos,
	controls::Control,
	worldmessages::WorldMessage,
	PlayerId,
	RoomId,
	playerstate::RoomPos
};


#[derive(Default)]
pub struct Input {
	pub actions: HashMap<PlayerId, Control>
}

#[derive(Default)]
pub struct Output {
	pub output: HashMap<PlayerId, WorldMessage>
}

#[derive(Default)]
pub struct Size {
	pub width: i64,
	pub height: i64
}

#[derive(Default)]
pub struct Spawn {
	pub pos: Pos
}


#[derive(Default)]
pub struct Players {
	pub entities: HashMap<PlayerId, Entity>
}

#[derive(Default)]
pub struct Emigration {
	pub emigrants: Vec<(PlayerId, RoomId, RoomPos)>
}

#[derive(Default)]
pub struct TimeStamp {
	pub time: i64
}