1 /**
2  * @file
3  * @brief Header file for inventory handling and Equipment menu.
4  */
5 
6 /*
7 Copyright (C) 2002-2013 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 /**
29  * @brief A list of filter types in the market and production view.
30  * @note Run-time only, please do not use this in savegame/structures and the like.
31  * Please also do not use hardcoded numbers to access this (e.g. in a .ufo script).
32  * @sa inv_shared.c:INV_ItemMatchesFilter
33  * @sa inv_shared.c:INV_GetFilterTypeID
34  */
35 typedef enum {
36 	/* All types starting with "FILTER_S_" contain items that can be used on/with soldiers (i.e. personal equipment). */
37 	FILTER_S_PRIMARY,		/**< All 'Primary' weapons and their ammo for soldiers (Except for heavy weapons). */
38 	FILTER_S_SECONDARY,		/**< All 'Secondary' weapons and their ammo for soldiers. */
39 	FILTER_S_HEAVY,			/**< Heavy weapons for soldiers. */
40 	FILTER_S_MISC,			/**< Misc. soldier equipment (i.e. everything else that is not in the other soldier-item filters) */
41 	FILTER_S_ARMOUR,		/**< Armour for soldiers. */
42 	FILTER_S_IMPLANT,		/**< Implants */
43 	MAX_SOLDIER_FILTERTYPES,
44 
45 	/* Non-soldier items */
46 	FILTER_CRAFTITEM,	/**< Aircraft equipment. */
47 	FILTER_UGVITEM,		/**< Heavy equipment like tanks (i.e. these are actually employees) and their parts.
48 						 * Some of the content are special normal items (like for soldiers).
49 						 * The UGVs themself are specially handled.*/
50 	FILTER_AIRCRAFT,	/**< Aircrafts. */
51 	FILTER_DUMMY,		/**< Everything that is not in _any_ of the other filter types.
52 						 * Mostly plot-relevant stuff, unproducible stuff and stuff. */
53 	FILTER_DISASSEMBLY,
54 
55 	MAX_FILTERTYPES,
56 
57 	FILTER_ENSURE_32BIT = 0x7FFFFFFF
58 } itemFilterTypes_t;
59 
60 bool INV_MoveItem(Inventory* inv, const invDef_t* toContainer, int px, int py, const invDef_t* fromContainer, Item *fItem, Item** tItem);
61 bool INV_LoadWeapon(const Item *weapon, Inventory* inv, const invDef_t* srcContainer, const invDef_t* destContainer);
62 bool INV_UnloadWeapon(Item *weapon, Inventory* inv, const invDef_t* container);
63 const equipDef_t* INV_GetEquipmentDefinitionByID(const char* name);
64 void INV_InitStartup(void);
65 itemFilterTypes_t INV_GetFilterFromItem(const objDef_t* obj);
66 const char* INV_GetFilterType(itemFilterTypes_t id);
67 itemFilterTypes_t INV_GetFilterTypeID(const char*  filterTypeID);
68 bool INV_ItemMatchesFilter(const objDef_t* obj, const itemFilterTypes_t filterType);
69 Item *INV_SearchInInventoryWithFilter(const Inventory* const i, const invDef_t* container, const objDef_t* item,  const itemFilterTypes_t filterType) __attribute__((nonnull(1)));
70 void INV_ItemDescription(const objDef_t* od);
71