Extract headless sim crate from server
Move chunk, entity, world, map, sim and load_world into a new sim library crate together with the game rules from shared (player_action, action_delta, delta_action, step_allowed, tile_collidable, tick constants). shared keeps only the wire types and re-exports the rules, so server and client compile unchanged. First step toward a local single-player build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5610c2c343
commit
303c587aee
Executable
+19
@@ -0,0 +1,19 @@
|
||||
pub struct Entity {
|
||||
pub id: u32,
|
||||
pub type_id: u16, // 0 = player
|
||||
pub pos: (i16, i16),
|
||||
pub hp: u16,
|
||||
pub hp_max: u16,
|
||||
}
|
||||
|
||||
impl Entity {
|
||||
pub fn new(id: u32, type_id: u16, pos: (i16, i16), hp: u16) -> Self {
|
||||
Self {
|
||||
id,
|
||||
type_id,
|
||||
pos,
|
||||
hp,
|
||||
hp_max: hp,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user