1 /*
2  *  This file is part of Dune Legacy.
3  *
4  *  Dune Legacy is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  Dune Legacy is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with Dune Legacy.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef CHOAM_H
19 #define CHOAM_H
20 
21 #include <structures/BuilderBase.h>
22 #include <misc/InputStream.h>
23 #include <misc/OutputStream.h>
24 
25 #include <vector>
26 
27 class House;
28 
29 class Choam {
30 public:
31     explicit Choam(House* pHouse);
32     ~Choam();
33 
34     void save(OutputStream& stream) const;
35     void load(InputStream& stream);
36 
37     int getPrice(Uint32 itemID) const;
38     bool isCheap(Uint32 itemID) const;
39     int getNumAvailable(Uint32 itemID) const;
40 
41     bool setNumAvailable(Uint32 itemID, int newValue);
42 
43     void addItem(Uint32 itemID, int num);
44 
45     void update();
46 
47 private:
48     House*                  house;               ///< The house of this choam
49     std::vector<BuildItem>  availableItems;      ///< This list contains all the things that can be bought from a Starport
50 };
51 
52 #endif // CHOAM_H
53