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  bool isFinished();
45  void setAssigned (int nb);
47  int getAssigned() const;
49  int getSpent() const;
51  void setSpent (int spent);
53  int getCost() const;
55  void setCost(int f);
57  const RuleResearch * getRules() const;
59  void load(const YAML::Node& node);
61  YAML::Node save() const;
63  std::string getResearchProgress() const;
64 };
65 
66 }
void setSpent(int spent)
set time already spent on this ResearchProject
Definition: ResearchProject.cpp:87
void setAssigned(int nb)
set the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:55
const RuleResearch * getRules() const
get the ResearchProject Mod
Definition: ResearchProject.cpp:60
void setCost(int f)
set time cost of this ResearchProject
Definition: ResearchProject.cpp:105
YAML::Node save() const
save the ResearchProject to YAML
Definition: ResearchProject.cpp:125
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:96
bool isFinished()
gets state of project.
Definition: ResearchProject.cpp:46
std::string getResearchProgress() const
Get a string describing current progress.
Definition: ResearchProject.cpp:139
Represents one research project.
Definition: RuleResearch.h:38
int getSpent() const
get time already spent on this ResearchProject
Definition: ResearchProject.cpp:78
void load(const YAML::Node &node)
load the ResearchProject from YAML
Definition: ResearchProject.cpp:114
int getAssigned() const
get the number of scientist assigned to this ResearchProject
Definition: ResearchProject.cpp:69
Definition: BaseInfoState.cpp:40