|
| 1 | +/** |
| 2 | +* ============================================================================= |
| 3 | +* Source Python |
| 4 | +* Copyright (C) 2014 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 | +#ifndef _DATAMAP_CSGO_H |
| 28 | +#define _DATAMAP_CSGO_H |
| 29 | + |
| 30 | +//----------------------------------------------------------------------------- |
| 31 | +// Includes. |
| 32 | +//----------------------------------------------------------------------------- |
| 33 | +#include "datamap.h" |
| 34 | + |
| 35 | +//----------------------------------------------------------------------------- |
| 36 | +// Expose datamap_t. |
| 37 | +//----------------------------------------------------------------------------- |
| 38 | +template<class T> |
| 39 | +T DataMap_Visitor(T cls) |
| 40 | +{ |
| 41 | + cls |
| 42 | + .def_readonly("packed_size", &datamap_t::m_nPackedSize) |
| 43 | + |
| 44 | + // TODO: Expose optimized_datamap_t... |
| 45 | + .def_readonly("optimized_datamap", &datamap_t::m_pOptimizedDataMap) |
| 46 | + ; |
| 47 | + return cls; |
| 48 | +} |
| 49 | + |
| 50 | +//----------------------------------------------------------------------------- |
| 51 | +// Expose typedescription_t. |
| 52 | +//----------------------------------------------------------------------------- |
| 53 | +class TypeDescExt |
| 54 | +{ |
| 55 | +public: |
| 56 | + static int get_flat_offset(typedescription_t pTypeDesc) |
| 57 | + { |
| 58 | + // return pTypeDesc.flatOffset[TD_OFFSET_NORMAL]; |
| 59 | + return NULL; |
| 60 | + } |
| 61 | +}; |
| 62 | + |
| 63 | +template<class T> |
| 64 | +T TypeDesc_Visitor(T cls) |
| 65 | +{ |
| 66 | + cls |
| 67 | + .def_readonly("offset", &typedescription_t::fieldOffset) |
| 68 | + .def_readonly("flat_offset", &TypeDescExt::get_flat_offset) |
| 69 | + .def_readonly("flat_group", &typedescription_t::flatGroup) |
| 70 | + ; |
| 71 | + return cls; |
| 72 | +} |
| 73 | + |
| 74 | +//----------------------------------------------------------------------------- |
| 75 | +// Expose fieldtype_t. |
| 76 | +//----------------------------------------------------------------------------- |
| 77 | +template<class T> |
| 78 | +T FieldTypes_Visitor(T cls) |
| 79 | +{ |
| 80 | + cls |
| 81 | + .value("INTEGER64", FIELD_INTEGER64) |
| 82 | + .value("VECTOR4D", FIELD_VECTOR4D) |
| 83 | + ; |
| 84 | + return cls; |
| 85 | +} |
| 86 | + |
| 87 | +#endif // _DATAMAP_CSGO_H |
0 commit comments