OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Production.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_PRODUCTION_H
20 #define OPENXCOM_PRODUCTION_H
21 
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 class RuleManufacture;
27 class Base;
28 class SavedGame;
29 class Ruleset;
30 enum productionProgress_e { PROGRESS_NOT_COMPLETE, PROGRESS_COMPLETE, PROGRESS_NOT_ENOUGH_MONEY, PROGRESS_NOT_ENOUGH_MATERIALS, PROGRESS_MAX, PROGRESS_CONSTRUCTION };
32 {
33 public:
34  Production (const RuleManufacture * rules, int amount);
35  int getAmountTotal () const;
36  void setAmountTotal (int);
37  bool getInfiniteAmount () const;
38  void setInfiniteAmount (bool);
39  int getTimeSpent () const;
40  void setTimeSpent (int);
41  int getAmountProduced () const;
42  int getAssignedEngineers() const;
43  void setAssignedEngineers (int);
44  bool getSellItems() const;
45  void setSellItems (bool);
46  productionProgress_e step(Base * b, SavedGame * g, const Ruleset *r);
47  const RuleManufacture * getRules() const;
48  void startItem(Base * b, SavedGame * g);
49  YAML::Node save() const;
50  void load(const YAML::Node &node);
51 private:
52  const RuleManufacture * _rules;
53  int _amount;
54  bool _infinite;
55  int _timeSpent;
56  int _engineers;
57  bool _sell;
58  bool haveEnoughMoneyForOneMoreUnit(SavedGame * g);
59  bool haveEnoughMaterialsForOneMoreUnit(Base * b);
60 };
61 }
62 #endif
The game data that gets written to disk when the game is saved.
Definition: SavedGame.h:80
Set of rules and stats for a game.
Definition: Ruleset.h:69
Definition: Production.h:31
Represents a player base on the globe.
Definition: Base.h:47
Represents the information needed to manufacture an object.
Definition: RuleManufacture.h:32