Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-14 16:03:19 +0000
committerStijn Buys <ingar@osirion.org>2012-11-14 16:03:19 +0000
commit0cf596e0505f1198748931787b93f469f3e58db7 (patch)
tree04404ff2404c824ff7a3c7c5a1703fe0a1878708 /src/core/slot.h
parent6b737ea7f6e5a31d3c6024105ee11890f1a5451f (diff)
Add more Slot properties, corrected a bug in EntityControlable control flags handling.
Diffstat (limited to 'src/core/slot.h')
-rw-r--r--src/core/slot.h73
1 files changed, 64 insertions, 9 deletions
diff --git a/src/core/slot.h b/src/core/slot.h
index d0f2fdc..6b6c47b 100644
--- a/src/core/slot.h
+++ b/src/core/slot.h
@@ -22,6 +22,8 @@ namespace core
* */
class Slot {
public:
+ enum Flags {Active = 1};
+
/**
* @brief default constructor
* Creates an empty slot
@@ -59,6 +61,27 @@ public:
* projectiles generated by this slot
* */
+ /**
+ * */
+ inline unsigned long last_fired() const
+ {
+ return slot_last_fired;
+ }
+
+ inline unsigned long interval() const
+ {
+ return slot_interval;
+ }
+
+ inline unsigned long lifespan() const
+ {
+ return slot_lifespan;
+ }
+
+ inline float speed() const
+ {
+ return slot_speed;
+ }
/* --- mutators -------------------------------------------- */
@@ -86,28 +109,60 @@ public:
{
slot_timestamp = timestamp;
}
-
+
+ /**
+ * @brief
+ * */
+ inline void set_last_fired(unsigned long last_fired)
+ {
+ slot_last_fired = last_fired;
+ }
+
+ inline void set_interval(unsigned long interval)
+ {
+ slot_interval = interval;
+ }
+
+ inline void set_lifespan(unsigned long lifespan)
+ {
+ slot_lifespan = lifespan;
+ }
+
+ inline void set_speed(float speed)
+ {
+ slot_speed = speed;
+ }
+
/**
* @brief set the item this slot is holding
* */
- inline void set_item(Item *item);
+ void set_item(Item *item);
private:
math::Vector3f slot_location;
+
math::Axis slot_axis;
+
+ // slot flags
+ unsigned int slot_flags;
unsigned long slot_timestamp;
- // FIXME consolidate into slot_flags
- bool slot_active;
- std::string slot_particlesystem_name;
+ unsigned long slot_last_fired;
- // fire rate, in projectiles per second
- float slot_fire_rate;
- // fire range, in game units
- float slot_fire_range;
+ // interval between two shots, in milliseconds
+ unsigned long slot_interval;
+ // projectile lifespane
+ unsigned long slot_lifespan;
+
+ // projectile speed, in gameunits / second
+ float slot_speed;
+
+ // item mounted in this slot
Item *slot_item;
+
+ std::string slot_particlesystem_name;
};
} // namespace core