Skip to content

Commit 1f0ff07

Browse files
committed
Declared some C++ objects as private since they are not directly interacted with. This includes classes that have a singleton instance as well as classes that are only exposed as an inherited class of another class.
Renamed GameEngine to EngineServer to match the name of the singleton to its class _EngineServer. The same goes for Globals which is now GlobalVars. Renamed a few engine module file names to use engine_ instead of eiface_.
1 parent 49af25d commit 1f0ff07

File tree

13 files changed

+30
-30
lines changed

13 files changed

+30
-30
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ Set(SOURCEPYTHON_EFFECTS_MODULE_SOURCES
158158
# Engine module.
159159
# ------------------------------------------------------------------
160160
Set(SOURCEPYTHON_ENGINE_MODULE_HEADERS
161-
core/modules/engine/engine${SOURCE_ENGINE}/eiface_wrap_python.h
161+
core/modules/engine/engine${SOURCE_ENGINE}/engine_wrap_python.h
162162
)
163163

164164
Set(SOURCEPYTHON_ENGINE_MODULE_SOURCES
165-
core/modules/engine/eiface_wrap_python.cpp
165+
core/modules/engine/engine_wrap_python.cpp
166166
)
167167

168168
# ------------------------------------------------------------------

src/core/modules/bot/bot_wrap_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ DECLARE_SP_MODULE(bot_c)
5353

5454
void export_botmanager()
5555
{
56-
class_<IBotManager, boost::noncopyable>("BotManager", no_init)
56+
class_<IBotManager, boost::noncopyable>("_BotManager", no_init)
5757
.def("get_bot_controller",
5858
&IBotManager::GetBotController,
5959
"Returns the BotController object for the given bot edict.",

src/core/modules/cvar/cvar_wrap_python.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ DECLARE_SP_MODULE(cvar_c)
5959
//-----------------------------------------------------------------------------
6060
void export_cvar_interface()
6161
{
62-
class_<ICvar, boost::noncopyable>("Cvar", no_init)
62+
class_<ICvar, boost::noncopyable>("_Cvar", no_init)
6363
.def("register_con_command",
6464
&ICvar::RegisterConCommand,
6565
"Registers a console command.",
@@ -154,7 +154,7 @@ void export_concommandbase()
154154
;
155155

156156
// TODO: Rename or move to ConVar
157-
class_<IConVar, boost::noncopyable>("IConVar", no_init)
157+
class_<IConVar, boost::noncopyable>("_IConVar", no_init)
158158
.def("set_string",
159159
GET_METHOD(void, IConVar, SetValue, const char*),
160160
args("value")

src/core/modules/effects/effects_wrap_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void export_effects()
110110
*/
111111
;
112112

113-
class_<IEffects, bases<IPredictionSystem>, boost::noncopyable>("Effects", no_init)
113+
class_<IEffects, bases<IPredictionSystem>, boost::noncopyable>("_Effects", no_init)
114114
.def("beam",
115115
&IEffects::Beam,
116116
"Creates a beam particle effect.",

src/core/modules/engine/eiface_wrap_python.cpp renamed to src/core/modules/engine/engine_wrap_python.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "inetchannelinfo.h"
4646
#include "eiface.h"
4747

48-
#include ENGINE_INCLUDE_PATH(eiface_wrap_python.h)
48+
#include ENGINE_INCLUDE_PATH(engine_wrap_python.h)
4949

5050

5151
extern IVEngineServer* engine;
@@ -93,7 +93,7 @@ void export_engine_interface()
9393
// Call engine specific implementation function
9494
IVEngineServer_Visitor(
9595

96-
class_<IVEngineServer, boost::noncopyable>("EngineServer", no_init)
96+
class_<IVEngineServer, boost::noncopyable>("_EngineServer", no_init)
9797
.def("change_level",
9898
&IVEngineServer::ChangeLevel,
9999
"Tells the engine to change the level. If s2 is None, the engine will execute a \
@@ -752,5 +752,5 @@ void export_engine_interface()
752752

753753
); // IVEngineServer_Visitor
754754

755-
scope().attr("GameEngine") = object(ptr(engine));
755+
scope().attr("EngineServer") = object(ptr(engine));
756756
}

src/core/modules/entity/entity_wrap_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void export_server_networkable()
235235
//-----------------------------------------------------------------------------
236236
void export_edict()
237237
{
238-
class_< CBaseEdict >("BaseEdict")
238+
class_< CBaseEdict >("_BaseEdict")
239239
.def("get_server_entity",
240240
GET_METHOD(IServerEntity*, CBaseEdict, GetIServerEntity),
241241
"Returns its ServerEntity instance.",

src/core/modules/event/event_wrap_python.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424
* Development Team grants this exception to all derivative works.
2525
*/
2626

27-
//---------------------------------------------------------------------------------
27+
//-----------------------------------------------------------------------------
2828
// Includes
29-
//---------------------------------------------------------------------------------
29+
//-----------------------------------------------------------------------------
3030
#include "igameevents.h"
3131
#include "modules/export_main.h"
3232

3333
#ifndef EVENT_DEBUG_ID_INIT
3434
#define EVENT_DEBUG_ID_INIT 42
3535
#endif
3636

37-
//---------------------------------------------------------------------------------
37+
//-----------------------------------------------------------------------------
3838
// This is the IGameEventListener2 callback class. It allows python to subclass
3939
// IGameEventListener2 then pass an instance of that to CGameEventManager.
40-
//---------------------------------------------------------------------------------
40+
//-----------------------------------------------------------------------------
4141
class CGameEventListener2: public IGameEventListener2, public wrapper<IGameEventListener2>
4242
{
4343
public:
@@ -54,14 +54,14 @@ class CGameEventListener2: public IGameEventListener2, public wrapper<IGameEvent
5454
}
5555
};
5656

57-
//---------------------------------------------------------------------------------
57+
//-----------------------------------------------------------------------------
5858
// Externals
59-
//---------------------------------------------------------------------------------
59+
//-----------------------------------------------------------------------------
6060
extern IGameEventManager2* gameeventmanager;
6161

62-
//---------------------------------------------------------------------------------
62+
//-----------------------------------------------------------------------------
6363
// Exposes the Game Event module.
64-
//---------------------------------------------------------------------------------
64+
//-----------------------------------------------------------------------------
6565
void export_igameevent();
6666
void export_igameeventlistener();
6767
void export_igameeventmanager();
@@ -73,9 +73,9 @@ DECLARE_SP_MODULE(event_c)
7373
export_igameeventmanager();
7474
}
7575

76-
//---------------------------------------------------------------------------------
76+
//-----------------------------------------------------------------------------
7777
// Exposes IGameEvent.
78-
//---------------------------------------------------------------------------------
78+
//-----------------------------------------------------------------------------
7979
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(get_bool_overload, GetBool, 1, 2);
8080
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(get_int_overload, GetInt, 1, 2);
8181
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(get_float_overload, GetFloat, 1, 2);
@@ -169,9 +169,9 @@ void export_igameevent()
169169
;
170170
}
171171

172-
//---------------------------------------------------------------------------------
172+
//-----------------------------------------------------------------------------
173173
// Exposes the game event listener.
174-
//---------------------------------------------------------------------------------
174+
//-----------------------------------------------------------------------------
175175
void export_igameeventlistener()
176176
{
177177
class_<CGameEventListener2, boost::noncopyable>("GameEventListener")
@@ -186,15 +186,15 @@ void export_igameeventlistener()
186186
;
187187
}
188188

189-
//---------------------------------------------------------------------------------
189+
//-----------------------------------------------------------------------------
190190
// Exposes the game event manager.
191-
//---------------------------------------------------------------------------------
191+
//-----------------------------------------------------------------------------
192192
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(create_event_overload, CreateEvent, 1, 2);
193193
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(fire_event_overload, FireEvent, 1, 2);
194194

195195
void export_igameeventmanager()
196196
{
197-
class_<IGameEventManager2, boost::noncopyable>("GameEventManager", no_init)
197+
class_<IGameEventManager2, boost::noncopyable>("_GameEventManager", no_init)
198198
.def("load_events_from_file",
199199
&IGameEventManager2::LoadEventsFromFile,
200200
"Loads game event descriptions from a file eg resource/gameevents.res",

src/core/modules/globals/globals_wrap_python.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void export_globals()
6363
{
6464
GlobalsBase_Visitor(
6565

66-
class_<CGlobalVarsBase>("GlobalVarsBase", init<bool>())
66+
class_<CGlobalVarsBase>("_GlobalVarsBase", init<bool>())
6767
.def("is_client",
6868
&CGlobalVarsBase::IsClient,
6969
"Returns True if the game is a client."
@@ -135,7 +135,7 @@ void export_globals()
135135

136136
Globals_Visitor(
137137

138-
class_< CGlobalVars, bases< CGlobalVarsBase> >("GlobalVars", init<bool>())
138+
class_< CGlobalVars, bases< CGlobalVarsBase> >("_GlobalVars", init<bool>())
139139
.add_property("map_name",
140140
make_getter(&CGlobalVars::mapname, return_value_policy<return_by_value>()),
141141
"Current map name."
@@ -188,5 +188,5 @@ void export_globals()
188188
.NOT_IMPLEMENTED_ATTR("edicts")
189189
);
190190

191-
scope().attr("Globals") = object(ptr(gpGlobals));
191+
scope().attr("GlobalVars") = object(ptr(gpGlobals));
192192
}

src/core/modules/listener/listener_wrap_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void export_listener_managers()
6363
//-------------------------------------------------------------------------
6464
// Exposes ListenerManager
6565
//-------------------------------------------------------------------------
66-
class_<CListenerManager, boost::noncopyable>("ListenerManager", no_init)
66+
class_<CListenerManager, boost::noncopyable>("_ListenerManager", no_init)
6767
.def("register_listener",
6868
&CListenerManager::RegisterListener,
6969
"Registers a callable object. If it was already registered it will be ignored.",

src/core/modules/recipientfilter/recipientfilter_wrap_python.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ DECLARE_SP_MODULE(recipientfilter_c)
4343
void export_mrecipientfilter()
4444
{
4545
// TODO: Rename class
46-
class_<MRecipientFilter, boost::noncopyable>("CMRecipientFilter")
46+
class_<MRecipientFilter, boost::noncopyable>("RecipientFilter")
4747
.def("is_reliable",
4848
&MRecipientFilter::IsReliable,
4949
"Whether this recipient filter will be network reliable (sent in-order)"

0 commit comments

Comments
 (0)