1#ifndef NANOMMO_CLIENT_BAG_WINDOW_H_
2#define NANOMMO_CLIENT_BAG_WINDOW_H_
11#include "protocol/nanommo.pb.h"
18 const items::Stack& stack);
21std::optional<uint32_t>
FirstEmptySlot(
const protocol::Inventory& bag);
27 const protocol::Inventory& bag,
28 const protocol::Place& place);
40 const protocol::Inventory& bag,
41 const protocol::Place& place,
42 float size,
bool locked =
false);
64 void Toggle() { visible_ = !visible_; }
67 std::optional<protocol::ItemAction>
Build(
68 const protocol::Inventory& bag,
const protocol::TradeSide& offered = {});
72 std::optional<protocol::ItemAction> BuildThrowAway(
73 const protocol::Inventory& bag);
76 bool visible_ =
false;
77 std::optional<protocol::Place> throwing_;
std::optional< protocol::ItemAction > Build(const protocol::Inventory &bag, const protocol::TradeSide &offered={})
What's offered in a trade stays in its slot until the trade's over.
BagWindow(ItemTable items)
std::optional< uint32_t > FirstEmptySlot(const protocol::Inventory &bag)
The first slot of the bag with nothing in it, if it has one.
std::optional< protocol::ItemAction > QuickAction(const ItemTable &items, const protocol::Inventory &bag, const protocol::Place &place)
std::optional< protocol::Place > AcceptItem()
std::optional< protocol::ItemAction > ItemSlot(const ItemTable &items, const protocol::Inventory &bag, const protocol::Place &place, float size, bool locked)
bool StackSlot(const ItemTable &items, const items::Stack *stack, float size, uint32_t edge)
std::vector< std::string > ItemLines(const ItemTable &items, const items::Stack &stack)
The items in the items file, by id.