OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ResearchProject.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_RESEARCHPROJECT_H
20 #define OPENXCOM_RESEARCHPROJECT_H
21 
22 #include <yaml-cpp/yaml.h>
23 
24 namespace OpenXcom
25 {
26 class RuleResearch;
27 class Ruleset;
28 
34 {
35  RuleResearch * _project;
36  int _assigned;
37  int _spent;
38  int _cost;
39 public:
40  ResearchProject(RuleResearch * p, int c = 0);
42  bool step();
44  void setAssigned (int nb);
46  int getAssigned () const;
48  int getSpent () const;
50  void setSpent (int spent);
52  int getCost() const;
54  void setCost(int f);
56  const RuleResearch * getRules () const;
58  void load(const YAML::Node& node);
60  YAML::Node save() const;
62  std::string getResearchProgress () const;
63 };
64 }
65 #endif
void setSpent(int spent)
set time already spent on this ResearchProject
Definition: ResearchProject.cpp:85
void setAssigned(int nb)
set the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:53
void setCost(int f)
set time cost of this ResearchProject
Definition: ResearchProject.cpp:103
int getCost() const
get time cost of this ResearchProject
Definition: ResearchProject.cpp:94
int getAssigned() const
get the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:67
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:33
bool step()
Game logic. Called every new day to compute time spent.
Definition: ResearchProject.cpp:39
int getSpent() const
get time already spent on this ResearchProject
Definition: ResearchProject.cpp:76
Represents one research project.
Definition: RuleResearch.h:40
const RuleResearch * getRules() const
get the ResearchProject Ruleset
Definition: ResearchProject.cpp:58
void load(const YAML::Node &node)
load the ResearchProject from YAML
Definition: ResearchProject.cpp:112
std::string getResearchProgress() const
Get a string describing current progress.
Definition: ResearchProject.cpp:137
YAML::Node save() const
save the ResearchProject to YAML
Definition: ResearchProject.cpp:123