ScummVM API documentation
item_selection_process.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_WORLD_ITEMSELECTIONPROCESS_H
23 #define ULTIMA8_WORLD_ITEMSELECTIONPROCESS_H
24 
25 #include "ultima/ultima8/kernel/process.h"
26 #include "ultima/ultima8/misc/classtype.h"
27 
28 namespace Ultima {
29 namespace Ultima8 {
30 
31 class Item;
32 
36 class ItemSelectionProcess : public Process {
37 public:
40 
41  ENABLE_RUNTIME_CLASSTYPE()
42 
43  void run() override;
44 
46  bool selectNextItem(bool grab);
47 
49  void clearSelection();
50 
52  void avatarMoved();
53 
55  void useSelectedItem();
56 
57  bool loadData(Common::ReadStream *rs, uint32 version);
58  void saveData(Common::WriteStream *ws) override;
59 
60  static ItemSelectionProcess *get_instance() {
61  return _instance;
62  }
63 
64  uint16 getSelectedItem() const {
65  return _selectedItem;
66  }
67 
68 private:
69  void putItemSelectionOnItem(Item *item);
70 
71  uint16 _selectedItem;
72  int32 _ax;
73  int32 _ay;
74  int32 _az;
75 
76  static ItemSelectionProcess *_instance;
77 };
78 
79 } // End of namespace Ultima8
80 } // End of namespace Ultima
81 
82 #endif
void avatarMoved()
Avatar moved - clear the selector if needed.
Definition: stream.h:77
void clearSelection()
Clear the selector sprite.
Definition: process.h:34
Definition: item.h:42
Definition: item_selection_process.h:36
void useSelectedItem()
Use the selected item (if any)
Definition: detection.h:27
void saveData(Common::WriteStream *ws) override
save Process data
Definition: stream.h:385
bool selectNextItem(bool grab)
Select the next item. If grab is true, pick up loose items now.