Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: d0f2fdc78a3784f45825fd93c9a37a58dfd3bc73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/*
   core/slot.h
   This file is part of the Osirion project and is distributed under
   the terms of the GNU General Public License version 2.
*/

#ifndef __INCLUDED_CORE_SLOT_H__
#define __INCLUDED_CORE_SLOT_H__

#include "math/vector3f.h"
#include "math/axis.h"

#include "core/item.h"

#include <string>

namespace core
{
	
/**
 * @brief A mount point for a weapon or a piece of equipment
 * */
class Slot {
public:
	/**
	 * @brief default constructor
	 * Creates an empty slot
	 * */
	Slot();
	
	/**
	 * @brief creates and empty slot at a given location
	 * */
	Slot(const math::Vector3f & location);
	
	/**
	 * @brief default destructor
	 * */
	~Slot();
	
	/**
	 * @brief location of the slot within the parent model
	 * */
	inline const math::Vector3f & location() const
	{
		return slot_location;
	}

	/**
	 * @brief axis indication the slot's orientation
	 * */
	inline const math::Axis & axis() const
	{
		return slot_axis;
	}
	
	/**
	 * @brief the name of the particlesystem used to render
	 * projectiles generated by this slot
	 * */

		
	/* --- mutators -------------------------------------------- */

	/**
	 * @brief set the slot's location
	 * */
	inline void set_location(const math::Vector3f &location)
	{
		slot_location.assign(location);
	}
	
	/**
	 * @brief set the slot's orientation
	 */
	inline void set_axis(const math::Axis & axis)
	{
		slot_axis.assign(axis);
	}
	
	/**
	 * @brief set the slot's timestamp
	 * The timestamp indicates when the slot's configuration was last changed.
	 * */
	inline void set_timestamp(unsigned long timestamp)
	{
		slot_timestamp = timestamp;
	}
		
	/**
	 * @brief set the item this slot is holding
	 * */
	inline void set_item(Item *item);
	
private:
	math::Vector3f	slot_location;
	math::Axis	slot_axis;
	
	unsigned long	slot_timestamp;
	// FIXME consolidate into slot_flags
	bool		slot_active;
	
	std::string	slot_particlesystem_name;
	
	// fire rate, in projectiles per second
	float		slot_fire_rate;
	// fire range, in game units
	float		slot_fire_range;
	
	Item		*slot_item;
};

} // namespace core

#endif // __INCLUDED_CORE_SLOTS_H__