naia_shared/world/entity/
global_entity.rs

1use crate::BigMapKey;
2use naia_serde::{BitReader, BitWrite, Serde, SerdeErr};
3
4// GlobalEntity
5#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
6pub struct GlobalEntity(u64);
7
8impl BigMapKey for GlobalEntity {
9    fn to_u64(&self) -> u64 {
10        self.0
11    }
12
13    fn from_u64(value: u64) -> Self {
14        GlobalEntity(value)
15    }
16}
17
18impl Serde for GlobalEntity {
19    fn ser(&self, _: &mut dyn BitWrite) {
20        panic!("shouldn't call this");
21    }
22
23    fn de(_: &mut BitReader) -> Result<Self, SerdeErr> {
24        panic!("shouldn't call this");
25    }
26
27    fn bit_length(&self) -> u32 {
28        panic!("shouldn't call this");
29    }
30}