From d5836730810c2007382d342eba13d23537cdf818 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Tue, 14 Feb 2023 19:09:27 +0100 Subject: [PATCH] ad entity to shared --- kubi-shared/src/entity.rs | 18 ++++++++++++++++++ kubi-shared/src/lib.rs | 1 + 2 files changed, 19 insertions(+) create mode 100644 kubi-shared/src/entity.rs diff --git a/kubi-shared/src/entity.rs b/kubi-shared/src/entity.rs new file mode 100644 index 0000000..bf2f183 --- /dev/null +++ b/kubi-shared/src/entity.rs @@ -0,0 +1,18 @@ +use shipyard::Component; + +#[derive(Component)] +pub struct Entity; + +#[derive(Component)] +pub struct Health { + pub current: u8, + pub max: u8, +} +impl Health { + fn new(health: u8) -> Self { + Self { + current: health, + max: health + } + } +} diff --git a/kubi-shared/src/lib.rs b/kubi-shared/src/lib.rs index 13cb165..3817e6f 100644 --- a/kubi-shared/src/lib.rs +++ b/kubi-shared/src/lib.rs @@ -3,3 +3,4 @@ pub mod networking; pub mod worldgen; pub mod chunk; pub mod transform; +pub mod entity;