Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-30 21:20:08 +0000
committerStijn Buys <ingar@osirion.org>2012-11-30 21:20:08 +0000
commit85bbfb39bdc272614a2a1526c96f757cb58335d9 (patch)
tree087834dc8ae7bfc4809530bc01b64cb1ab5f5f71 /src/core
parent846700d05808157e43b7ae56b57a031d4b9c7a0d (diff)
Save weapon slot positions.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/slots.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/core/slots.h b/src/core/slots.h
index aefffb7..6ac9eb8 100644
--- a/src/core/slots.h
+++ b/src/core/slots.h
@@ -38,16 +38,34 @@ public:
void clear();
/**
- * @brief found a mounted item
+ * @brief find a mounted item
* */
Slot *find(Item *item);
+ /**
+ * @brief return the slot at the specified index
+ * */
+ inline Slot *operator[](size_t index)
+ {
+ if (index < slots_container.size()) {
+ return slots_container[index];
+ } else {
+ return 0;
+ }
+ }
+
+ inline size_t size() const
+ {
+ return slots_container.size();
+ }
- inline iterator begin() {
+ inline iterator begin()
+ {
return slots_container.begin();
}
- inline iterator end() {
+ inline iterator end()
+ {
return slots_container.end();
}