1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
use crate::wrappers::{*, structs::*, unreal::*};
use super::*;

pub struct GameEditorWrapper(pub usize);
impl_object!(GameEditorWrapper);

impl GameEditor for GameEditorWrapper {}
impl Server for GameEditorWrapper {}
impl TeamGameEvent for GameEditorWrapper {}
impl GameEvent for GameEditorWrapper {}
impl Actor for GameEditorWrapper {}

pub trait GameEditor : Server {
    fn get_active_round_number(&self) -> i32 {
        unsafe {
            GameEvent_GameEditor_TA_Get_ActiveRoundNumber(self.addr())
        }
    }
    fn get_max_rounds(&self) -> i32 {
        unsafe {
            GameEvent_GameEditor_TA_Get_MaxRounds(self.addr())
        }
    }
    fn get_history_position(&self) -> i32 {
        unsafe {
            GameEvent_GameEditor_TA_Get_HistoryPosition(self.addr())
        }
    }
    fn get_max_undo_history(&self) -> i32 {
        unsafe {
            GameEvent_GameEditor_TA_Get_MaxUndoHistory(self.addr())
        }
    }
    fn get_fx_actor_archetype(&self) -> Option<FXActorWrapper> {
        unsafe {
            FXActorWrapper::try_new(GameEvent_GameEditor_TA_Get_FXActorArchetype(self.addr()))
        }
    }
    fn get_fx_actor(&self) -> Option<FXActorWrapper> {
        unsafe {
            FXActorWrapper::try_new(GameEvent_GameEditor_TA_Get_FXActor(self.addr()))
        }
    }
    fn rotate_actor(&self, pc: PlayerControllerWrapper, b_snap_orientation: bool) {
        unsafe {
            GameEvent_GameEditor_TA_RotateActor(self.addr(), pc.addr(), b_snap_orientation);
        }
    }
    fn prev_round(&self) {
        unsafe {
            GameEvent_GameEditor_TA_PrevRound(self.addr());
        }
    }
    fn next_round(&self) {
        unsafe {
            GameEvent_GameEditor_TA_NextRound(self.addr());
        }
    }
    fn decrease_time(&self) {
        unsafe {
            GameEvent_GameEditor_TA_DecreaseTime(self.addr());
        }
    }
    fn increase_time(&self) {
        unsafe {
            GameEvent_GameEditor_TA_IncreaseTime(self.addr());
        }
    }
    fn stop_editing(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_StopEditing(self.addr(), pc.addr());
        }
    }
    fn start_editing(&self) {
        unsafe {
            GameEvent_GameEditor_TA_StartEditing(self.addr());
        }
    }
    fn cycle_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_CycleActor(self.addr(), pc.addr());
        }
    }
    fn release_grabbed_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ReleaseGrabbedActor(self.addr(), pc.addr());
        }
    }
    fn release_rotate_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ReleaseRotateActor(self.addr(), pc.addr());
        }
    }
    fn toggle_rotate_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ToggleRotateActor(self.addr(), pc.addr());
        }
    }
    fn toggle_grab_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ToggleGrabActor(self.addr(), pc.addr());
        }
    }
    fn toggle_release_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ToggleReleaseActor(self.addr(), pc.addr());
        }
    }
    fn release_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_ReleaseActor(self.addr(), pc.addr());
        }
    }
    fn grab_actor(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_GrabActor(self.addr(), pc.addr());
        }
    }
    fn can_que_save_replay(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_CanQueSaveReplay(self.addr())
        }
    }
    fn should_update_crosshair(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_ShouldUpdateCrosshair(self.addr())
        }
    }
    fn get_player_team_number(&self) -> i32 {
        unsafe {
            GameEvent_GameEditor_TA_GetPlayerTeamNumber(self.addr())
        }
    }
    fn can_add_history(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_CanAddHistory(self.addr())
        }
    }
    fn toggle_editor_round(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ToggleEditorRound(self.addr());
        }
    }
    fn commit_redo_round(&self) {
        unsafe {
            GameEvent_GameEditor_TA_CommitRedoRound(self.addr());
        }
    }
    fn reset_round(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ResetRound(self.addr());
        }
    }
    fn save(&self) {
        unsafe {
            GameEvent_GameEditor_TA_Save(self.addr());
        }
    }
    fn redo(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_Redo(self.addr(), pc.addr());
        }
    }
    fn undo(&self, pc: PlayerControllerWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_Undo(self.addr(), pc.addr());
        }
    }
    fn get_other_history_type(&self, history_type: u8) -> u8 {
        unsafe {
            GameEvent_GameEditor_TA_GetOtherHistoryType(self.addr(), history_type)
        }
    }
    fn clamp_undo_history(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ClampUndoHistory(self.addr());
        }
    }
    fn clear_redo_history(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ClearRedoHistory(self.addr());
        }
    }
    fn clear_all_history(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ClearAllHistory(self.addr());
        }
    }
    fn destroy_actor(&self, a: ActorWrapper, history_type: u8) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_DestroyActor(self.addr(), a.addr(), history_type)
        }
    }
    fn is_in_editor_mode(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_IsInEditorMode(self.addr())
        }
    }
    fn remove_all_points_from_score(&self, team_index: i32) {
        unsafe {
            GameEvent_GameEditor_TA_RemoveAllPointsFromScore(self.addr(), team_index);
        }
    }
    fn remove_points_from_score(&self, points_to_remove: i32, team_index: i32) {
        unsafe {
            GameEvent_GameEditor_TA_RemovePointsFromScore(self.addr(), points_to_remove, team_index);
        }
    }
    fn delete_all_existing_actors_based_off_spawn_list(&self) {
        unsafe {
            GameEvent_GameEditor_TA_DeleteAllExistingActorsBasedOffSpawnList(self.addr());
        }
    }
    fn round_contains_a_switch(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_RoundContainsASwitch(self.addr())
        }
    }
    fn enable_triggers(&self, b_enable: bool) {
        unsafe {
            GameEvent_GameEditor_TA_EnableTriggers(self.addr(), b_enable);
        }
    }
    fn hide_car_spawn_points(&self, b_hide: bool) {
        unsafe {
            GameEvent_GameEditor_TA_HideCarSpawnPoints(self.addr(), b_hide);
        }
    }
    fn reset_spawn_locations(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ResetSpawnLocations(self.addr());
        }
    }
    fn on_spawned_archetype(&self, spawned_actor: ActorWrapper, history_type: u8) {
        unsafe {
            GameEvent_GameEditor_TA_OnSpawnedArchetype(self.addr(), spawned_actor.addr(), history_type);
        }
    }
    fn spawn_archetype(&self, controller: PlayerControllerWrapper, archetype_index: i32) {
        unsafe {
            GameEvent_GameEditor_TA_SpawnArchetype(self.addr(), controller.addr(), archetype_index);
        }
    }
    fn increment_selected_spawn_archetype_index(&self, direction: i32, index: i32) {
        unsafe {
            GameEvent_GameEditor_TA_IncrementSelectedSpawnArchetypeIndex(self.addr(), direction, index);
        }
    }
    fn can_change_team(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_CanChangeTeam(self.addr())
        }
    }
    fn reset_balls_to_default_position(&self) {
        unsafe {
            GameEvent_GameEditor_TA_ResetBallsToDefaultPosition(self.addr());
        }
    }
    fn fire_balls(&self) {
        unsafe {
            GameEvent_GameEditor_TA_FireBalls(self.addr());
        }
    }
    fn interact(&self) {
        unsafe {
            GameEvent_GameEditor_TA_Interact(self.addr());
        }
    }
    fn should_reset_balls(&self) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_ShouldResetBalls(self.addr())
        }
    }
    fn on_vehicle_setup(&self, car: CarWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_OnVehicleSetup(self.addr(), car.addr());
        }
    }
    fn handle_vehicle_setup(&self, car: CarWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_HandleVehicleSetup(self.addr(), car.addr());
        }
    }
    fn on_player_restarted(&self, player_car: CarWrapper) {
        unsafe {
            GameEvent_GameEditor_TA_OnPlayerRestarted(self.addr(), player_car.addr());
        }
    }
    fn choose_team(&self, team_index: i32, player: PlayerControllerWrapper) -> bool {
        unsafe {
            GameEvent_GameEditor_TA_ChooseTeam(self.addr(), team_index, player.addr())
        }
    }
    fn init_fx(&self) {
        unsafe {
            GameEvent_GameEditor_TA_InitFX(self.addr());
        }
    }

}

extern "C" {
    fn GameEvent_GameEditor_TA_Get_ActiveRoundNumber(obj: usize) -> i32;
    fn GameEditorWrapper_SetActiveRoundNumber(obj: usize, new_val: i32);
    fn GameEvent_GameEditor_TA_Get_MaxRounds(obj: usize) -> i32;
    fn GameEditorWrapper_SetMaxRounds(obj: usize, new_val: i32);
    fn GameEvent_GameEditor_TA_Get_HistoryPosition(obj: usize) -> i32;
    fn GameEditorWrapper_SetHistoryPosition(obj: usize, new_val: i32);
    fn GameEvent_GameEditor_TA_Get_MaxUndoHistory(obj: usize) -> i32;
    fn GameEditorWrapper_SetMaxUndoHistory(obj: usize, new_val: i32);
    fn GameEvent_GameEditor_TA_Get_FXActorArchetype(obj: usize) -> usize;
    fn GameEditorWrapper_SetFXActorArchetype(obj: usize, new_val: usize);
    fn GameEvent_GameEditor_TA_Get_FXActor(obj: usize) -> usize;
    fn GameEditorWrapper_SetFXActor(obj: usize, new_val: usize);
    fn GameEvent_GameEditor_TA_RotateActor(obj: usize, PC: usize, bSnapOrientation: bool);
    fn GameEvent_GameEditor_TA_PrevRound(obj: usize);
    fn GameEvent_GameEditor_TA_NextRound(obj: usize);
    fn GameEvent_GameEditor_TA_DecreaseTime(obj: usize);
    fn GameEvent_GameEditor_TA_IncreaseTime(obj: usize);
    fn GameEvent_GameEditor_TA_StopEditing(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_StartEditing(obj: usize);
    fn GameEvent_GameEditor_TA_CycleActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ReleaseGrabbedActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ReleaseRotateActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ToggleRotateActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ToggleGrabActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ToggleReleaseActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_ReleaseActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_GrabActor(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_CanQueSaveReplay(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_ShouldUpdateCrosshair(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_GetPlayerTeamNumber(obj: usize) -> i32;
    fn GameEvent_GameEditor_TA_CanAddHistory(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_ToggleEditorRound(obj: usize);
    fn GameEvent_GameEditor_TA_CommitRedoRound(obj: usize);
    fn GameEvent_GameEditor_TA_ResetRound(obj: usize);
    fn GameEvent_GameEditor_TA_Save(obj: usize);
    fn GameEvent_GameEditor_TA_Redo(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_Undo(obj: usize, PC: usize);
    fn GameEvent_GameEditor_TA_GetOtherHistoryType(obj: usize, HistoryType: u8) -> u8;
    fn GameEvent_GameEditor_TA_ClampUndoHistory(obj: usize);
    fn GameEvent_GameEditor_TA_ClearRedoHistory(obj: usize);
    fn GameEvent_GameEditor_TA_ClearAllHistory(obj: usize);
    fn GameEvent_GameEditor_TA_DestroyActor(obj: usize, A: usize, HistoryType: u8) -> bool;
    fn GameEvent_GameEditor_TA_IsInEditorMode(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_RemoveAllPointsFromScore(obj: usize, TeamIndex: i32);
    fn GameEvent_GameEditor_TA_RemovePointsFromScore(obj: usize, PointsToRemove: i32, TeamIndex: i32);
    fn GameEvent_GameEditor_TA_DeleteAllExistingActorsBasedOffSpawnList(obj: usize);
    fn GameEvent_GameEditor_TA_RoundContainsASwitch(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_EnableTriggers(obj: usize, bEnable: bool);
    fn GameEvent_GameEditor_TA_HideCarSpawnPoints(obj: usize, bHide: bool);
    fn GameEvent_GameEditor_TA_ResetSpawnLocations(obj: usize);
    fn GameEvent_GameEditor_TA_OnSpawnedArchetype(obj: usize, SpawnedActor: usize, HistoryType: u8);
    fn GameEvent_GameEditor_TA_SpawnArchetype(obj: usize, Controller: usize, ArchetypeIndex: i32);
    fn GameEvent_GameEditor_TA_IncrementSelectedSpawnArchetypeIndex(obj: usize, Direction: i32, Index: i32);
    fn GameEvent_GameEditor_TA_CanChangeTeam(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_ResetBallsToDefaultPosition(obj: usize);
    fn GameEvent_GameEditor_TA_FireBalls(obj: usize);
    fn GameEvent_GameEditor_TA_Interact(obj: usize);
    fn GameEvent_GameEditor_TA_ShouldResetBalls(obj: usize) -> bool;
    fn GameEvent_GameEditor_TA_OnVehicleSetup(obj: usize, Car: usize);
    fn GameEvent_GameEditor_TA_HandleVehicleSetup(obj: usize, Car: usize);
    fn GameEvent_GameEditor_TA_OnPlayerRestarted(obj: usize, PlayerCar: usize);
    fn GameEvent_GameEditor_TA_ChooseTeam(obj: usize, TeamIndex: i32, Player: usize) -> bool;
    fn GameEvent_GameEditor_TA_InitFX(obj: usize);

}