diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
commit | cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch) | |
tree | f647b20e1823f1846af88e832cf82a4a02e96e69 /src/OpaqueWorld.h | |
parent | Improve clang-format config file, remove automatically enforced code style from contrib guide. (diff) | |
download | cuberite-clang-format-codebase.tar cuberite-clang-format-codebase.tar.gz cuberite-clang-format-codebase.tar.bz2 cuberite-clang-format-codebase.tar.lz cuberite-clang-format-codebase.tar.xz cuberite-clang-format-codebase.tar.zst cuberite-clang-format-codebase.zip |
Diffstat (limited to 'src/OpaqueWorld.h')
-rw-r--r-- | src/OpaqueWorld.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/OpaqueWorld.h b/src/OpaqueWorld.h index d0d4e7fd0..7ff4b5353 100644 --- a/src/OpaqueWorld.h +++ b/src/OpaqueWorld.h @@ -11,15 +11,24 @@ class cWorldInterface; /** Utilities to allow casting a cWorld to one of its interfaces without including World.h. */ namespace World { - // Defined in World.cpp - cBroadcastInterface * GetBroadcastInterface(cWorld * a_World); - cForEachChunkProvider * GetFECProvider (cWorld * a_World); - cWorldInterface * GetWorldInterface (cWorld * a_World); +// Defined in World.cpp +cBroadcastInterface * GetBroadcastInterface(cWorld * a_World); +cForEachChunkProvider * GetFECProvider(cWorld * a_World); +cWorldInterface * GetWorldInterface(cWorld * a_World); - inline cBroadcastInterface & GetBroadcastInterface(cWorld & a_World) { return *GetBroadcastInterface(&a_World); } - inline cForEachChunkProvider & GetFECProvider (cWorld & a_World) { return *GetFECProvider(&a_World); } - inline cWorldInterface & GetWorldInterface (cWorld & a_World) { return *GetWorldInterface(&a_World); } - - // cChunkInterface is more like a pimpl for cChunkMap than an interface so it needs to be returned by value - cChunkInterface GetChunkInterface(cWorld & a_World); +inline cBroadcastInterface & GetBroadcastInterface(cWorld & a_World) +{ + return *GetBroadcastInterface(&a_World); +} +inline cForEachChunkProvider & GetFECProvider(cWorld & a_World) +{ + return *GetFECProvider(&a_World); } +inline cWorldInterface & GetWorldInterface(cWorld & a_World) +{ + return *GetWorldInterface(&a_World); +} + +// cChunkInterface is more like a pimpl for cChunkMap than an interface so it needs to be returned by value +cChunkInterface GetChunkInterface(cWorld & a_World); +} // namespace World |