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

Method getCost

src/Basescape/TransferItemsState.cpp:486–505  ·  view source on GitHub ↗

* Gets the transfer cost of the currently selected item. * @return Transfer cost. */

Source from the content-addressed store, hash-verified

484 * @return Transfer cost.
485 */
486int TransferItemsState::getCost() const
487{
488 int cost = 0;
489 // Item cost
490 if (TRANSFER_ITEM == getType(_sel))
491 {
492 cost = 1;
493 }
494 // Craft cost
495 else if (TRANSFER_CRAFT == getType(_sel))
496 {
497 cost = 25;
498 }
499 // Personnel cost
500 else
501 {
502 cost = 5;
503 }
504 return (int)floor(_distance * cost);
505}
506
507/**
508 * Gets the quantity of the currently selected item

Callers 3

mouseClickMethod · 0.45
fitItemMethod · 0.45
ResearchInfoStateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected