summaryrefslogtreecommitdiff
path: root/src/cave_type.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cave_type.hpp')
-rw-r--r--src/cave_type.hpp37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/cave_type.hpp b/src/cave_type.hpp
index 912e1091..958ace1d 100644
--- a/src/cave_type.hpp
+++ b/src/cave_type.hpp
@@ -2,6 +2,9 @@
#include "h-basic.h"
+#include <cassert>
+#include <vector>
+
/**
* A single "grid" in a Cave.
*
@@ -27,26 +30,36 @@
*/
struct cave_type
{
- u16b info; /* Hack -- cave flags */
+ u16b info = 0; /* Hack -- cave flags */
+
+ byte feat = 0; /* Hack -- feature type */
+
+ std::vector<s16b> o_idxs { }; /* Indexes of objects in this grid */
- byte feat; /* Hack -- feature type */
+ s16b m_idx = 0; /* Monster in this grid */
- s16b o_idx; /* Object in this grid */
+ s16b t_idx = 0; /* trap index (in t_list) or zero */
- s16b m_idx; /* Monster in this grid */
+ s16b special = 0; /* Special cave info */
+ s16b special2 = 0; /* Special cave info */
- s16b t_idx; /* trap index (in t_list) or zero */
+ s16b inscription = 0; /* Inscription of the grid */
- s16b special, special2; /* Special cave info */
+ byte mana = 0; /* Magical energy of the grid */
- s16b inscription; /* Inscription of the grid */
+ byte mimic = 0; /* Feature to mimic */
- byte mana; /* Magical energy of the grid */
+ byte cost = 0; /* Hack -- cost of flowing */
+ byte when = 0; /* Hack -- when cost was computed */
- byte mimic; /* Feature to mimic */
+ s16b effect = 0; /* The lasting effects */
- byte cost; /* Hack -- cost of flowing */
- byte when; /* Hack -- when cost was computed */
+ /**
+ * @brief wipe the object's state
+ */
+ void wipe() {
+ /* Reset to defaults */
+ *this = cave_type();
+ }
- s16b effect; /* The lasting effects */
};