summaryrefslogtreecommitdiff
path: root/src/group.h
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-05-14 18:38:54 +0000
committeralberth <alberth@openttd.org>2011-05-14 18:38:54 +0000
commit990ec6f0a91038dabde458d6aa28a608ba3c52f5 (patch)
treefcf64c9fd4357c51798b7895a6adc3c081276ac0 /src/group.h
parent28092366ec8aaf953b6e8bb92d745ee2c32fad1e (diff)
downloadopenttd-990ec6f0a91038dabde458d6aa28a608ba3c52f5.tar.xz
(svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker).
Diffstat (limited to 'src/group.h')
-rw-r--r--src/group.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/group.h b/src/group.h
index 335b4c768..15087d59d 100644
--- a/src/group.h
+++ b/src/group.h
@@ -7,7 +7,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
-/** @file group.h Base class from groups. */
+/** @file group.h Base class for groups and group functions. */
#ifndef GROUP_H
#define GROUP_H
@@ -19,12 +19,13 @@
#include "engine_type.h"
typedef Pool<Group, GroupID, 16, 64000> GroupPool;
-extern GroupPool _group_pool;
+extern GroupPool _group_pool; ///< Pool of groups.
+/** Group data. */
struct Group : GroupPool::PoolItem<&_group_pool> {
char *name; ///< Group Name
- uint16 num_vehicle; ///< Number of vehicles wich belong to the group
+ uint16 num_vehicle; ///< Number of vehicles in the group
OwnerByte owner; ///< Group Owner
VehicleTypeByte vehicle_type; ///< Vehicle type of the group
@@ -69,12 +70,20 @@ static inline uint GetGroupArraySize()
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e);
+/**
+ * Increase the number of vehicles by one in a group.
+ * @param id_g Group id.
+ */
static inline void IncreaseGroupNumVehicle(GroupID id_g)
{
Group *g = Group::GetIfValid(id_g);
if (g != NULL) g->num_vehicle++;
}
+/**
+ * Decrease the number of vehicles by one in a group.
+ * @param id_g Group id.
+ */
static inline void DecreaseGroupNumVehicle(GroupID id_g)
{
Group *g = Group::GetIfValid(id_g);