1 #ifndef _bhlnksw_h_ 2 #define _bhlnksw_h_ 1 3 4 #include "track.h" 5 6 #ifdef __cplusplus 7 8 extern "C" { 9 10 #endif 11 12 13 void* LinkSwitchBehaveInit(void* bhdata, STRATEGYBLOCK* sbptr); 14 void LinkSwitchBehaveFun(STRATEGYBLOCK* sbptr); 15 16 extern int LinkSwitchGetSynchData(STRATEGYBLOCK* sbptr); 17 extern void LinkSwitchSetSynchData(STRATEGYBLOCK* sbptr,int status); 18 19 typedef enum link_switch_mode 20 { 21 I_lswitch_timer, 22 I_lswitch_wait, 23 I_lswitch_toggle, 24 I_lswitch_moving, 25 I_lswitch_SELFDESTRUCT, 26 27 } LSWITCH_MODE; 28 29 typedef enum link_switch_req_states 30 { 31 linkswitch_no_request, 32 linkswitch_request_on, 33 linkswitch_request_off, 34 }LINK_SWITCH_REQUEST_STATE; 35 36 typedef enum lswitch_display_types 37 { 38 linkswitch_no_display, 39 linkswitch_animate_me, 40 linkswitch_move_me, 41 linkswitch_animate_and_move_me, 42 } LSWITCH_DISPLAY_TYPES; 43 44 typedef enum ls_move_dir 45 { 46 ls_start_to_end, 47 ls_end_to_start, 48 } LS_MOVE_DIR; 49 50 51 typedef struct lswitch_item 52 { 53 STRATEGYBLOCK * bswitch; 54 char bs_name [SB_NAME_LENGTH]; 55 56 } LSWITCH_ITEM; 57 58 typedef struct link_switch_target 59 { 60 char name[SB_NAME_LENGTH]; 61 int request_message; 62 STRATEGYBLOCK* sbptr; 63 }LINK_SWITCH_TARGET; 64 65 typedef struct link_switch 66 { 67 AVP_BEHAVIOUR_TYPE bhvr_type; 68 LINK_SWITCH_REQUEST_STATE request; 69 70 BOOL system_state; 71 72 BOOL state; 73 LSWITCH_MODE ls_mode; 74 75 int num_targets; 76 77 LINK_SWITCH_TARGET* ls_targets; 78 79 int time_for_reset; // constant 80 int timer; 81 82 int security_clerance; // what the plyer has to be to use this switch 83 84 int num_linked_switches; 85 LSWITCH_ITEM* lswitch_list ; 86 87 // stuff for showing how the switch displays its state 88 89 LSWITCH_DISPLAY_TYPES ls_dtype; 90 91 TXACTRLBLK *ls_tac; // animations 92 93 // or track 94 TRACK_CONTROLLER* ls_track; 95 96 97 BOOL new_state; 98 int new_request; 99 100 LSWITCH_MODE mode_store; 101 102 // SELF DESTRUCT SEQUENCE STUFF 103 104 BOOL IS_SELF_DESTRUCT; 105 106 int soundHandle; 107 108 BOOL triggered_last; 109 110 int switch_flags; 111 VECTORCH trigger_volume_min;//for switches that can be set off by walking 112 VECTORCH trigger_volume_max;//into a given area 113 114 unsigned int switch_always_on:1; 115 unsigned int switch_off_message_same:1; 116 unsigned int switch_off_message_none:1; 117 118 int TimeUntilNetSynchAllowed; 119 120 }LINK_SWITCH_BEHAV_BLOCK; 121 122 typedef struct link_switch_tools_template 123 { 124 VECTORCH position; 125 EULER orientation; 126 127 128 BOOL rest_state; 129 int mode; 130 int time_for_reset; 131 int security_clearance; 132 133 int num_targets; 134 LINK_SWITCH_TARGET * targets; 135 136 int shape_num; 137 138 TRACK_CONTROLLER* track; 139 140 141 char nameID[SB_NAME_LENGTH]; 142 143 int num_linked_switches; 144 SBNAMEBLOCK* switchIDs; 145 146 int switch_flags; 147 VECTORCH trigger_volume_min;//for switches that can be set off by walking 148 VECTORCH trigger_volume_max;//into a given area 149 150 unsigned int switch_always_on:1; 151 unsigned int switch_off_message_same:1; 152 unsigned int switch_off_message_none:1; 153 } LINK_SWITCH_TOOLS_TEMPLATE; 154 155 156 #ifdef __cplusplus 157 158 }; 159 160 #endif 161 162 163 #endif 164