OpenXcom  1.0
Open-source clone of the original X-Com
ResearchProject.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom 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  * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include <yaml-cpp/yaml.h>
21 
22 namespace OpenXcom
23 {
24 
25 class RuleResearch;
26 class Mod;
27 
33 {
34  RuleResearch * _project;
35  int _assigned;
36  int _spent;
37  int _cost;
38 public:
39  ResearchProject(RuleResearch * p, int c = 0);
41  bool step();
43  void setAssigned (int nb);
45  int getAssigned() const;
47  int getSpent() const;
49  void setSpent (int spent);
51  int getCost() const;
53  void setCost(int f);
55  const RuleResearch * getRules() const;
57  void load(const YAML::Node& node);
59  YAML::Node save() const;
61  std::string getResearchProgress() const;
62 };
63 
64 }
void setSpent(int spent)
set time already spent on this ResearchProject
Definition: ResearchProject.cpp:83
void setAssigned(int nb)
set the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:51
const RuleResearch * getRules() const
get the ResearchProject Mod
Definition: ResearchProject.cpp:56
void setCost(int f)
set time cost of this ResearchProject
Definition: ResearchProject.cpp:101
YAML::Node save() const
save the ResearchProject to YAML
Definition: ResearchProject.cpp:121
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:32
bool step()
Game logic. Called every new day to compute time spent.
Definition: ResearchProject.cpp:37
int getCost() const
get time cost of this ResearchProject
Definition: ResearchProject.cpp:92
std::string getResearchProgress() const
Get a string describing current progress.
Definition: ResearchProject.cpp:135
Represents one research project.
Definition: RuleResearch.h:38
int getSpent() const
get time already spent on this ResearchProject
Definition: ResearchProject.cpp:74
void load(const YAML::Node &node)
load the ResearchProject from YAML
Definition: ResearchProject.cpp:110
int getAssigned() const
get the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:65
Definition: BaseInfoState.cpp:40