MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getSlotInPosition

Method getSlotInPosition

src/Battlescape/Inventory.cpp:373–383  ·  view source on GitHub ↗

* Gets the inventory slot located in the specified mouse position. * @param x Mouse X position. Returns the slot's X position. * @param y Mouse Y position. Returns the slot's Y position. * @return Slot rules, or NULL if none. */

Source from the content-addressed store, hash-verified

371 * @return Slot rules, or NULL if none.
372 */
373RuleInventory *Inventory::getSlotInPosition(int *x, int *y) const
374{
375 for (std::map<std::string, RuleInventory*>::iterator i = _game->getRuleset()->getInventories()->begin(); i != _game->getRuleset()->getInventories()->end(); ++i)
376 {
377 if (i->second->checkSlotInPosition(x, y))
378 {
379 return i->second;
380 }
381 }
382 return 0;
383}
384
385/**
386 * Returns the item currently grabbed by the player.

Callers

nothing calls this directly

Calls 3

getInventoriesMethod · 0.80
checkSlotInPositionMethod · 0.80
getRulesetMethod · 0.45

Tested by

no test coverage detected