mirror of
https://github.com/RustySamovar/RustySamovar.git
synced 2024-11-22 02:45:34 +00:00
Add GUID calculation function
This commit is contained in:
parent
29996242ac
commit
b128782ac2
@ -46,4 +46,8 @@ impl IdManager {
|
|||||||
pub fn get_entity_id_by_type_and_sub_id(t: &proto::ProtEntityType, sub_id: u32) -> u32 {
|
pub fn get_entity_id_by_type_and_sub_id(t: &proto::ProtEntityType, sub_id: u32) -> u32 {
|
||||||
return ((*t as u32) << Self::ENTITY_ID_OFFSET) | (sub_id & Self::ENTITY_ID_MASK);
|
return ((*t as u32) << Self::ENTITY_ID_OFFSET) | (sub_id & Self::ENTITY_ID_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_guid_by_uid_and_id(uid: u32, id: u32) -> u64 {
|
||||||
|
return (((uid as u64) << 32) | (id as u64));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user