|
| 1 | +/** |
| 2 | +* ============================================================================= |
| 3 | +* Source Python |
| 4 | +* Copyright (C) 2012-2015 Source Python Development Team. All rights reserved. |
| 5 | +* ============================================================================= |
| 6 | +* |
| 7 | +* This program is free software; you can redistribute it and/or modify it under |
| 8 | +* the terms of the GNU General Public License, version 3.0, as published by the |
| 9 | +* Free Software Foundation. |
| 10 | +* |
| 11 | +* This program is distributed in the hope that it will be useful, but WITHOUT |
| 12 | +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 13 | +* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 14 | +* details. |
| 15 | +* |
| 16 | +* You should have received a copy of the GNU General Public License along with |
| 17 | +* this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | +* |
| 19 | +* As a special exception, the Source Python Team gives you permission |
| 20 | +* to link the code of this program (as well as its derivative works) to |
| 21 | +* "Half-Life 2," the "Source Engine," and any Game MODs that run on software |
| 22 | +* by the Valve Corporation. You must obey the GNU General Public License in |
| 23 | +* all respects for all other code used. Additionally, the Source.Python |
| 24 | +* Development Team grants this exception to all derivative works. |
| 25 | +*/ |
| 26 | + |
| 27 | +//--------------------------------------------------------------------------------- |
| 28 | +// Includes. |
| 29 | +//--------------------------------------------------------------------------------- |
| 30 | +// Source.Python |
| 31 | +#include "export_main.h" |
| 32 | +#include "sp_main.h" |
| 33 | + |
| 34 | +// SDK |
| 35 | +#include "game/shared/gamerules.h" |
| 36 | + |
| 37 | + |
| 38 | +//--------------------------------------------------------------------------------- |
| 39 | +// Forward declarations. |
| 40 | +//--------------------------------------------------------------------------------- |
| 41 | +void export_gamerules(scope); |
| 42 | + |
| 43 | + |
| 44 | +//--------------------------------------------------------------------------------- |
| 45 | +// Declare the _sound module. |
| 46 | +//--------------------------------------------------------------------------------- |
| 47 | +DECLARE_SP_SUBMODULE(_engines, _gamerules) |
| 48 | +{ |
| 49 | + export_gamerules(_gamerules); |
| 50 | +} |
| 51 | + |
| 52 | + |
| 53 | +//----------------------------------------------------------------------------- |
| 54 | +// Expose gamerules. |
| 55 | +//----------------------------------------------------------------------------- |
| 56 | +void export_gamerules(scope _gamerules) |
| 57 | +{ |
| 58 | + // IGameSystem |
| 59 | + class_<IGameSystem, boost::noncopyable> GameSystem("GameSystem", no_init); |
| 60 | + |
| 61 | + GameSystem.add_property( |
| 62 | + "name", |
| 63 | + &IGameSystem::Name); |
| 64 | + |
| 65 | + GameSystem ADD_MEM_TOOLS(IGameSystem); |
| 66 | + |
| 67 | + |
| 68 | + // IGameSystemPerFrame |
| 69 | + class_<IGameSystemPerFrame, bases<IGameSystem>, boost::noncopyable> GameSystemPerFrame("GameSystemPerFrame", no_init); |
| 70 | + |
| 71 | + GameSystemPerFrame ADD_MEM_TOOLS(IGameSystemPerFrame); |
| 72 | + |
| 73 | + |
| 74 | + // CBaseGameSystemPerFrame |
| 75 | + class_<CBaseGameSystemPerFrame, bases<IGameSystemPerFrame>, boost::noncopyable> BaseGameSystemPerFrame("BaseGameSystemPerFrame", no_init); |
| 76 | + |
| 77 | + BaseGameSystemPerFrame ADD_MEM_TOOLS(CBaseGameSystemPerFrame); |
| 78 | + |
| 79 | + |
| 80 | + // CAutoGameSystemPerFrame |
| 81 | + class_<CAutoGameSystemPerFrame, bases<CBaseGameSystemPerFrame>, boost::noncopyable> AutoGameSystemPerFrame("AutoGameSystemPerFrame", no_init); |
| 82 | + |
| 83 | + AutoGameSystemPerFrame.add_property( |
| 84 | + "next", |
| 85 | + make_getter(&CAutoGameSystemPerFrame::m_pNext, reference_existing_object_policy())); |
| 86 | + |
| 87 | + AutoGameSystemPerFrame ADD_MEM_TOOLS(CAutoGameSystemPerFrame); |
| 88 | + |
| 89 | + |
| 90 | + // CGameRules |
| 91 | + class_<CGameRules, bases<CAutoGameSystemPerFrame>, boost::noncopyable> GameRules("GameRules", no_init); |
| 92 | + |
| 93 | + GameRules.add_property( |
| 94 | + "game_description", |
| 95 | + &CGameRules::GetGameDescription); |
| 96 | + |
| 97 | + GameRules.def( |
| 98 | + "should_collide", |
| 99 | + &CGameRules::ShouldCollide); |
| 100 | + |
| 101 | + GameRules.def( |
| 102 | + "get_tagged_convar_list", |
| 103 | + &CGameRules::GetTaggedConVarList); |
| 104 | + |
| 105 | + GameRules ADD_MEM_TOOLS(CGameRules); |
| 106 | + |
| 107 | + BEGIN_CLASS_INFO(CGameRules) |
| 108 | + FUNCTION_INFO(DeathNotice) |
| 109 | + END_CLASS_INFO() |
| 110 | +} |
0 commit comments