1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-25 22:53:19 +00:00

placed all extra hread/hwrite functions here

This commit is contained in:
Zeno Rogue 2021-04-07 18:01:57 +02:00
parent 5403859b41
commit 82fcf76005

View File

@ -8,11 +8,14 @@ namespace hr {
using pcell = cell*;
void hwrite(hstream& hs, const pcell& c) {
inline void hread(hstream& hs, transmatrix& h) { for(int i=0; i<MDIM; i++) hread(hs, h[i]); }
inline void hwrite(hstream& hs, transmatrix h) { for(int i=0; i<MDIM; i++) hwrite(hs, h[i]); }
inline void hwrite(hstream& hs, const pcell& c) {
hs.write<int>(mapstream::cellids[c]);
}
void hread(hstream& hs, pcell& c) {
inline void hread(hstream& hs, pcell& c) {
int32_t at = hs.get<int>();
c = mapstream::cellbyid[at];
}