Add Multiplayer support

This commit is contained in:
Snowiiii committed 2024-08-06 16:19:03 +02:00
1 parent d1c3b2f10c
commit 32569bafe5
34 files changed
+445 -243

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
[package]
name = "pumpkin-entity"
version.workspace = true
edition.workspace = true
[dependencies]
num-traits = "0.2"
num-derive = "0.4"
+8
View File
@@ -0,0 +1,8 @@
use num_derive::ToPrimitive;
// todo
#[derive(ToPrimitive, Clone)]
pub enum EntityType {
Zombie = 124,
Player = 128,
}
+19
View File
@@ -0,0 +1,19 @@
use entity_type::EntityType;
pub mod entity_type;
pub type EntityId = i32;
pub struct Entity {
pub entity_id: EntityId,
pub entity_type: EntityType,
}
impl Entity {
pub fn new(entity_id: EntityId, entity_type: EntityType) -> Self {
Self {
entity_id,
entity_type,
}
}
}