-struct IMoveAction : public InventoryAction
-{
- // count=0 means "everything"
- u16 count;
- std::string from_inv;
- std::string from_list;
- s16 from_i;
- std::string to_inv;
- std::string to_list;
- s16 to_i;
-
- IMoveAction()
- {
- count = 0;
- from_i = -1;
- to_i = -1;
- }
- IMoveAction(std::istream &is)
- {
- std::string ts;
-
- std::getline(is, ts, ' ');
- count = stoi(ts);
-
- std::getline(is, from_inv, ' ');
-
- std::getline(is, from_list, ' ');
-
- std::getline(is, ts, ' ');
- from_i = stoi(ts);
-
- std::getline(is, to_inv, ' ');
-
- std::getline(is, to_list, ' ');
-
- std::getline(is, ts, ' ');
- to_i = stoi(ts);
- }
-
- u16 getType() const
- {
- return IACTION_MOVE;
- }
-
- void serialize(std::ostream &os)
- {
- os<<"Move ";
- os<<count<<" ";
- os<<from_inv<<" ";
- os<<from_list<<" ";
- os<<from_i<<" ";
- os<<to_inv<<" ";
- os<<to_list<<" ";
- os<<to_i;
- }
-
- void apply(InventoryContext *c, InventoryManager *mgr);
-};
-
-/*
- Craft checking system
-*/
-
-enum ItemSpecType
-{
- ITEM_NONE,
- ITEM_MATERIAL,
- ITEM_CRAFT,
- ITEM_TOOL,
- ITEM_MBO
-};
-
-struct ItemSpec
-{
- enum ItemSpecType type;
- // Only other one of these is used
- std::string name;
- u16 num;
-
- ItemSpec():
- type(ITEM_NONE)
- {
- }
- ItemSpec(enum ItemSpecType a_type, std::string a_name):
- type(a_type),
- name(a_name),
- num(65535)
- {
- }
- ItemSpec(enum ItemSpecType a_type, u16 a_num):
- type(a_type),
- name(""),
- num(a_num)
- {
- }
-
- bool checkItem(InventoryItem *item);
-};
-
-/*
- items: a pointer to an array of 9 pointers to items
- specs: a pointer to an array of 9 ItemSpecs
-*/
-bool checkItemCombination(InventoryItem **items, ItemSpec *specs);
-