* Get the topmost item sprite to draw on the battlescape. * @return item sprite ID in floorob, or -1 when no item */
| 735 | * @return item sprite ID in floorob, or -1 when no item |
| 736 | */ |
| 737 | int Tile::getTopItemSprite() |
| 738 | { |
| 739 | int biggestWeight = -1; |
| 740 | int biggestItem = -1; |
| 741 | for (std::vector<BattleItem*>::iterator i = _inventory.begin(); i != _inventory.end(); ++i) |
| 742 | { |
| 743 | if ((*i)->getRules()->getWeight() > biggestWeight) |
| 744 | { |
| 745 | biggestWeight = (*i)->getRules()->getWeight(); |
| 746 | biggestItem = (*i)->getRules()->getFloorSprite(); |
| 747 | } |
| 748 | } |
| 749 | return biggestItem; |
| 750 | } |
| 751 | |
| 752 | /** |
| 753 | * New turn preparations. |
no test coverage detected