19 #ifndef OPENXCOM_INVENTORY_H
20 #define OPENXCOM_INVENTORY_H
22 #include "../Engine/InteractiveSurface.h"
44 Surface *_grid, *_items, *_selection;
50 std::map<int, std::map<int, int> > _stackLevel;
59 Inventory(
Game *game,
int width,
int height,
int x = 0,
int y = 0,
bool base =
false);
63 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256);
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
A game state that receives user input and reacts accordingly.
Definition: State.h:44
static bool overlapItems(BattleUnit *unit, BattleItem *item, RuleInventory *slot, int x=0, int y=0)
Checks for item overlap.
Definition: Inventory.cpp:342
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
BattleItem * getSelectedItem() const
Gets the currently selected item.
Definition: Inventory.cpp:389
void arrangeGround(bool alterOffset=true)
Arranges items on the ground.
Definition: Inventory.cpp:801
void setTuMode(bool tu)
Sets the inventory's Time Unit mode.
Definition: Inventory.cpp:102
Interactive view of an inventory.
Definition: Inventory.h:40
void drawGrid()
Draws the inventory grid.
Definition: Inventory.cpp:130
Represents a single item in the battlescape.
Definition: BattleItem.h:39
void setSelectedUnit(BattleUnit *unit)
Sets the inventory's selected unit.
Definition: Inventory.cpp:111
Coloured box with text inside that fades out after it is displayed.
Definition: WarningMessage.h:35
bool canBeStacked(BattleItem *itemA, BattleItem *itemB)
Checks if two items can be stacked on one another.
Definition: Inventory.cpp:927
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
bool unload()
Unloads the selected weapon.
Definition: Inventory.cpp:749
Inventory(Game *game, int width, int height, int x=0, int y=0, bool base=false)
Creates a new inventory view at the specified position and size.
Definition: Inventory.cpp:55
void drawItems()
Draws the inventory items.
Definition: Inventory.cpp:206
void think()
Handles timers.
Definition: Inventory.cpp:419
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the inventory's palette.
Definition: Inventory.cpp:86
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
~Inventory()
Cleans up the inventory.
Definition: Inventory.cpp:71
Number digits displayed on the screen.
Definition: NumberText.h:31
void blit(Surface *surface)
Blits the inventory onto another surface.
Definition: Inventory.cpp:428
void setSelectedItem(BattleItem *item)
Sets the currently selected item.
Definition: Inventory.cpp:398
void mouseClick(Action *action, State *state)
Special handling for mouse clicks.
Definition: Inventory.cpp:455
void draw()
Draws the inventory.
Definition: Inventory.cpp:121
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58
bool fitItem(RuleInventory *newSlot, BattleItem *item, std::string &warning)
Attempts to place an item in an inventory slot.
Definition: Inventory.cpp:895
void mouseOver(Action *action, State *state)
Special handling for mouse hovers.
Definition: Inventory.cpp:443
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:44