Debian Codegraph @

common/main/d_levelstate.h

raw
1 /*
2 * This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
3 * It is copyright by its individual contributors, as recorded in the
4 * project's Git history. See COPYING.txt at the top level for license
5 * terms and a link to the Git history.
6 */
7
8 #pragma once
9 #include "dxxsconf.h"
10 #include "object.h"
11 #include "morph.h"
12
13 #ifdef DXX_BUILD_DESCENT
14 namespace dcx {
15
16 struct d_level_unique_morph_object_state
17 {
18 std::array<morph_data::ptr, 5> morph_objects;
19 ~d_level_unique_morph_object_state();
20 };
21
22 }
23
24 namespace dsx {
25
26 struct d_level_unique_object_state
27 {
28 unsigned num_objects{0};
29 /* `accumulated_robots` counts robots present at level entry and
30 * robots added later via materialization centers / boss gating. It
31 * never decreases, so it is not a shortcut for counting the number
32 * of currently live objects with type OBJ_ROBOT.
33 */
34 unsigned accumulated_robots;
35 unsigned total_hostages;
36 unsigned Debris_object_count{0};
37 #if DXX_BUILD_DESCENT == 2
38 d_unique_buddy_state BuddyState;
39 d_thief_unique_state ThiefState;
40 d_guided_missile_indices Guided_missile;
41 #endif
42 std::array<imobjidx_t, MAX_OBJECTS> free_obj_list = init_object_number_array<imobjidx_t>(std::make_index_sequence<MAX_OBJECTS>());
43 object_array Objects;
44 d_level_unique_boss_state BossState;
45 d_level_unique_control_center_state ControlCenterState;
46 vms_vector last_console_player_position;
47 d_level_unique_morph_object_state MorphObjectState;
48 uint8_t Level_path_created{0};
49 auto &get_objects()
50 {
51 return Objects;
52 }
53 const auto &get_objects() const
54 {
55 return Objects;
56 }
57 };
58
59 extern d_level_unique_object_state LevelUniqueObjectState;
60
61 }
62 #endif