Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/slot.h')
-rw-r--r--src/core/slot.h49
1 files changed, 38 insertions, 11 deletions
diff --git a/src/core/slot.h b/src/core/slot.h
index 5466de8..99353ee 100644
--- a/src/core/slot.h
+++ b/src/core/slot.h
@@ -23,20 +23,30 @@ namespace core
* */
class Slot {
public:
- enum Flags {Mounted = 1, Active = 2};
+ enum Flags {None = 0, Mounted = 1, Active = 2};
/**
* @brief default constructor
* Creates an empty slot
* */
Slot();
-
+
/**
* @brief default destructor
* */
~Slot();
/**
+ * @brief load slot configuration from a model slot
+ * */
+ void load(const model::Slot *slot_tag, const float modelscale);
+
+ /**
+ * @brief clear slot values
+ * */
+ void clear();
+
+ /**
* @brief location of the slot within the parent model
* */
inline const math::Vector3f & location() const
@@ -86,9 +96,17 @@ public:
}
/**
+ * @brief slot radius
+ * */
+ inline const float radius() const
+ {
+ return slot_radius;
+ }
+
+ /**
* @brief slot fire cone, in degrees
* */
- inline float cone() const
+ inline const float cone() const
{
return slot_cone;
}
@@ -96,7 +114,7 @@ public:
/**
* @brief weapon slot type
* */
- inline const model::Weapon::Type type() const
+ inline const model::Slot::Type type() const
{
return slot_type;
}
@@ -161,9 +179,17 @@ public:
}
/**
+ * @brief set slot slot_radius
+ * */
+ void set_radius(const float radius)
+ {
+ slot_radius = radius;
+ }
+
+ /**
* @brief set slot type
* */
- void set_type(const model::Weapon::Type type)
+ void set_type(const model::Slot::Type type)
{
slot_type = type;
}
@@ -171,13 +197,19 @@ public:
/**
* @brief load slot parameters from a model weapon tag
* */
- void load(const model::Weapon *weapon_tag);
+ void load(const model::Slot *slot_tag);
private:
+ model::Slot::Type slot_type;
+
math::Vector3f slot_location;
math::Axis slot_axis;
+
+ float slot_radius;
+
+ float slot_cone;
// slot flags
unsigned int slot_flags;
@@ -188,13 +220,8 @@ private:
// timestamp indicating when the slot last generated a projectile, server-side
unsigned long slot_last_fired;
-
// item mounted in this slot
Item *slot_item;
-
- model::Weapon::Type slot_type;
-
- float slot_cone;
};
} // namespace core