Add Multiplayer support
This commit is contained in:
1 parent
d1c3b2f10c
commit
32569bafe5
34 files changed
+445
-243
No files matched your search
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "pumpkin-entity"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
num-traits = "0.2"
|
||||
num-derive = "0.4"
|
||||
@@ -0,0 +1,8 @@
|
||||
use num_derive::ToPrimitive;
|
||||
|
||||
// todo
|
||||
#[derive(ToPrimitive, Clone)]
|
||||
pub enum EntityType {
|
||||
Zombie = 124,
|
||||
Player = 128,
|
||||
}
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user