1
1
// //////////////////////////////////////////////////////////////////////////
2
- // Module : script_game_object_script.cpp
3
- // Created : 25.09.2003
4
- // Modified : 29.06.2004
5
- // Author : Dmitriy Iassenev
6
- // Description : XRay Script game object script export
2
+ // Module : script_game_object_script.cpp
3
+ // Created : 25.09.2003
4
+ // Modified : 29.06.2004
5
+ // Author : Dmitriy Iassenev
6
+ // Description : XRay Script game object script export
7
7
// //////////////////////////////////////////////////////////////////////////
8
8
9
9
#include " pch_script.h"
@@ -21,85 +21,86 @@ extern class_<CScriptGameObject> &script_register_game_object_trader(class_<CScr
21
21
22
22
SCRIPT_EXPORT (CScriptGameObject, (),
23
23
{
24
+ // XXX nitrocaster: one can export enum like class, without defining dummy type
24
25
class EnumCallbackType {};
25
- class_<CScriptGameObject> instance (" game_object" );
26
+ class_<CScriptGameObject> instance (" game_object" );
26
27
27
- module (luaState)
28
- [
29
- class_<CSightParams>(" CSightParams" )
30
- .enum_ (" bla-bla" )
31
- [
32
- value (" eSightTypeCurrentDirection" , int (SightManager::eSightTypeCurrentDirection )),
33
- value (" eSightTypePathDirection" , int (SightManager::eSightTypePathDirection )),
34
- value (" eSightTypeDirection" , int (SightManager::eSightTypeDirection )),
35
- value (" eSightTypePosition" , int (SightManager::eSightTypePosition )),
36
- value (" eSightTypeObject" , int (SightManager::eSightTypeObject )),
37
- value (" eSightTypeCover" , int (SightManager::eSightTypeCover )),
38
- value (" eSightTypeSearch" , int (SightManager::eSightTypeSearch )),
39
- value (" eSightTypeLookOver" , int (SightManager::eSightTypeLookOver )),
40
- value (" eSightTypeCoverLookOver" , int (SightManager::eSightTypeCoverLookOver )),
41
- value (" eSightTypeFireObject" , int (SightManager::eSightTypeFireObject )),
42
- value (" eSightTypeFirePosition" , int (SightManager::eSightTypeFirePosition )),
43
- value (" eSightTypeAnimationDirection" , int (SightManager::eSightTypeAnimationDirection )),
44
- value (" eSightTypeDummy" , int (SightManager::eSightTypeDummy ))
45
- ]
46
- .def ( constructor<>())
47
- .def_readonly (" m_object" , &CSightParams::m_object)
48
- .def_readonly (" m_vector" , &CSightParams::m_vector)
49
- .def_readonly (" m_sight_type" , &CSightParams::m_sight_type),
50
-
51
- script_register_game_object2 (
52
- script_register_game_object1 (
53
- script_register_game_object_trader (instance)
54
- )
55
- ),
28
+ module (luaState)
29
+ [
30
+ class_<CSightParams>(" CSightParams" )
31
+ .enum_ (" bla-bla" )
32
+ [
33
+ value (" eSightTypeCurrentDirection" , int (SightManager::eSightTypeCurrentDirection )),
34
+ value (" eSightTypePathDirection" , int (SightManager::eSightTypePathDirection )),
35
+ value (" eSightTypeDirection" , int (SightManager::eSightTypeDirection )),
36
+ value (" eSightTypePosition" , int (SightManager::eSightTypePosition )),
37
+ value (" eSightTypeObject" , int (SightManager::eSightTypeObject )),
38
+ value (" eSightTypeCover" , int (SightManager::eSightTypeCover )),
39
+ value (" eSightTypeSearch" , int (SightManager::eSightTypeSearch )),
40
+ value (" eSightTypeLookOver" , int (SightManager::eSightTypeLookOver )),
41
+ value (" eSightTypeCoverLookOver" , int (SightManager::eSightTypeCoverLookOver )),
42
+ value (" eSightTypeFireObject" , int (SightManager::eSightTypeFireObject )),
43
+ value (" eSightTypeFirePosition" , int (SightManager::eSightTypeFirePosition )),
44
+ value (" eSightTypeAnimationDirection" , int (SightManager::eSightTypeAnimationDirection )),
45
+ value (" eSightTypeDummy" , int (SightManager::eSightTypeDummy ))
46
+ ]
47
+ .def ( constructor<>())
48
+ .def_readonly (" m_object" , &CSightParams::m_object)
49
+ .def_readonly (" m_vector" , &CSightParams::m_vector)
50
+ .def_readonly (" m_sight_type" , &CSightParams::m_sight_type),
51
+
52
+ script_register_game_object2 (
53
+ script_register_game_object1 (
54
+ script_register_game_object_trader (instance)
55
+ )
56
+ ),
56
57
57
- class_<EnumCallbackType>(" callback" )
58
- .enum_ (" callback_types" )
59
- [
60
- value (" trade_start" , int (GameObject::eTradeStart)),
61
- value (" trade_stop" , int (GameObject::eTradeStop)),
62
- value (" trade_sell_buy_item" , int (GameObject::eTradeSellBuyItem)),
63
- value (" trade_perform_operation" , int (GameObject::eTradePerformTradeOperation)),
64
- value (" trader_global_anim_request" , int (GameObject::eTraderGlobalAnimationRequest)),
65
- value (" trader_head_anim_request" , int (GameObject::eTraderHeadAnimationRequest)),
66
- value (" trader_sound_end" , int (GameObject::eTraderSoundEnd)),
67
- value (" zone_enter" , int (GameObject::eZoneEnter)),
68
- value (" zone_exit" , int (GameObject::eZoneExit)),
69
- value (" level_border_exit" , int (GameObject::eExitLevelBorder)),
70
- value (" level_border_enter" , int (GameObject::eEnterLevelBorder)),
71
- value (" death" , int (GameObject::eDeath)),
72
- value (" patrol_path_in_point" , int (GameObject::ePatrolPathInPoint)),
73
- value (" inventory_pda" , int (GameObject::eInventoryPda)),
74
- value (" inventory_info" , int (GameObject::eInventoryInfo)),
75
- value (" article_info" , int (GameObject::eArticleInfo)),
76
- value (" use_object" , int (GameObject::eUseObject)),
77
- value (" hit" , int (GameObject::eHit)),
78
- value (" sound" , int (GameObject::eSound)),
79
- value (" action_removed" , int (GameObject::eActionTypeRemoved)),
80
- value (" action_movement" , int (GameObject::eActionTypeMovement)),
81
- value (" action_watch" , int (GameObject::eActionTypeWatch)),
82
- value (" action_animation" , int (GameObject::eActionTypeAnimation)),
83
- value (" action_sound" , int (GameObject::eActionTypeSound)),
84
- value (" action_particle" , int (GameObject::eActionTypeParticle)),
85
- value (" action_object" , int (GameObject::eActionTypeObject)),
86
- value (" actor_sleep" , int (GameObject::eActorSleep)),
87
- value (" helicopter_on_point" , int (GameObject::eHelicopterOnPoint)),
88
- value (" helicopter_on_hit" , int (GameObject::eHelicopterOnHit)),
89
- value (" on_item_take" , int (GameObject::eOnItemTake)),
90
- value (" on_item_drop" , int (GameObject::eOnItemDrop)),
91
- value (" script_animation" , int (GameObject::eScriptAnimation)),
92
- value (" task_state" , int (GameObject::eTaskStateChange)),
93
- value (" take_item_from_box" , int (GameObject::eInvBoxItemTake)),
94
- value (" weapon_no_ammo" , int (GameObject::eWeaponNoAmmoAvailable)),
95
-
96
- value (" map_location_added" , int (GameObject::eMapLocationAdded))
97
- ],
58
+ class_<EnumCallbackType>(" callback" )
59
+ .enum_ (" callback_types" )
60
+ [
61
+ value (" trade_start" , int (GameObject::eTradeStart)),
62
+ value (" trade_stop" , int (GameObject::eTradeStop)),
63
+ value (" trade_sell_buy_item" , int (GameObject::eTradeSellBuyItem)),
64
+ value (" trade_perform_operation" , int (GameObject::eTradePerformTradeOperation)),
65
+ value (" trader_global_anim_request" , int (GameObject::eTraderGlobalAnimationRequest)),
66
+ value (" trader_head_anim_request" , int (GameObject::eTraderHeadAnimationRequest)),
67
+ value (" trader_sound_end" , int (GameObject::eTraderSoundEnd)),
68
+ value (" zone_enter" , int (GameObject::eZoneEnter)),
69
+ value (" zone_exit" , int (GameObject::eZoneExit)),
70
+ value (" level_border_exit" , int (GameObject::eExitLevelBorder)),
71
+ value (" level_border_enter" , int (GameObject::eEnterLevelBorder)),
72
+ value (" death" , int (GameObject::eDeath)),
73
+ value (" patrol_path_in_point" , int (GameObject::ePatrolPathInPoint)),
74
+ value (" inventory_pda" , int (GameObject::eInventoryPda)),
75
+ value (" inventory_info" , int (GameObject::eInventoryInfo)),
76
+ value (" article_info" , int (GameObject::eArticleInfo)),
77
+ value (" use_object" , int (GameObject::eUseObject)),
78
+ value (" hit" , int (GameObject::eHit)),
79
+ value (" sound" , int (GameObject::eSound)),
80
+ value (" action_removed" , int (GameObject::eActionTypeRemoved)),
81
+ value (" action_movement" , int (GameObject::eActionTypeMovement)),
82
+ value (" action_watch" , int (GameObject::eActionTypeWatch)),
83
+ value (" action_animation" , int (GameObject::eActionTypeAnimation)),
84
+ value (" action_sound" , int (GameObject::eActionTypeSound)),
85
+ value (" action_particle" , int (GameObject::eActionTypeParticle)),
86
+ value (" action_object" , int (GameObject::eActionTypeObject)),
87
+ value (" actor_sleep" , int (GameObject::eActorSleep)),
88
+ value (" helicopter_on_point" , int (GameObject::eHelicopterOnPoint)),
89
+ value (" helicopter_on_hit" , int (GameObject::eHelicopterOnHit)),
90
+ value (" on_item_take" , int (GameObject::eOnItemTake)),
91
+ value (" on_item_drop" , int (GameObject::eOnItemDrop)),
92
+ value (" script_animation" , int (GameObject::eScriptAnimation)),
93
+ value (" task_state" , int (GameObject::eTaskStateChange)),
94
+ value (" take_item_from_box" , int (GameObject::eInvBoxItemTake)),
95
+ value (" weapon_no_ammo" , int (GameObject::eWeaponNoAmmoAvailable)),
96
+
97
+ value (" map_location_added" , int (GameObject::eMapLocationAdded))
98
+ ],
98
99
99
- def (" buy_condition" , (void (*)(CScriptIniFile*,LPCSTR))(&::buy_condition)),
100
- def (" buy_condition" , (void (*)(float ,float ))(&::buy_condition)),
101
- def (" sell_condition" , (void (*)(CScriptIniFile*,LPCSTR))(&::sell_condition)),
102
- def (" sell_condition" , (void (*)(float ,float ))(&::sell_condition)),
103
- def (" show_condition" , &::show_condition)
104
- ];
100
+ def (" buy_condition" , (void (*)(CScriptIniFile*,LPCSTR))(&::buy_condition)),
101
+ def (" buy_condition" , (void (*)(float ,float ))(&::buy_condition)),
102
+ def (" sell_condition" , (void (*)(CScriptIniFile*,LPCSTR))(&::sell_condition)),
103
+ def (" sell_condition" , (void (*)(float ,float ))(&::sell_condition)),
104
+ def (" show_condition" , &::show_condition)
105
+ ];
105
106
});
0 commit comments