OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ResearchInfoState.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_RESEARCHINFOSTATE
20 #define OPENXCOM_RESEARCHINFOSTATE
21 
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class TextButton;
28 class Window;
29 class Text;
30 class Base;
31 class RuleResearch;
32 class ResearchProject;
33 class ArrowButton;
34 class Timer;
35 class InteractiveSurface;
36 
40 class ResearchInfoState : public State
41 {
42 private:
43  Base *_base;
44  TextButton *_btnOk;
45  TextButton *_btnCancel;
46  ArrowButton * _btnMore, *_btnLess;
47  Window *_window;
48  Text *_txtTitle, *_txtAvailableScientist, *_txtAvailableSpace, *_txtAllocatedScientist, *_txtMore, *_txtLess;
49  void setAssignedScientist();
50  ResearchProject * _project;
51  RuleResearch * _rule;
52  void buildUi ();
53  Timer *_timerMore, *_timerLess;
54  InteractiveSurface *_surfaceScientists;
55 public:
57  ResearchInfoState(Game *game, Base *base, RuleResearch * rule);
58  ResearchInfoState(Game *game, Base *base, ResearchProject * project);
60  void btnOkClick(Action *action);
62  void btnCancelClick(Action *action);
64  void more();
66  void moreByValue(int change);
68  void less();
70  void lessByValue(int change);
72  void handleWheel(Action *action);
74  void morePress(Action *action);
76  void moreRelease(Action *action);
78  void moreClick(Action *action);
80  void lessPress(Action *action);
82  void lessRelease(Action *action);
84  void lessClick(Action *action);
86  void think();
87 };
88 }
89 
90 #endif
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void moreRelease(Action *action)
Handler for releasing the More button.
Definition: ResearchInfoState.cpp:238
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Box with a coloured border and custom background.
Definition: Window.h:42
Timer used to run code in fixed intervals.
Definition: Timer.h:37
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
void lessClick(Action *action)
Handler for clicking the Less button.
Definition: ResearchInfoState.cpp:287
void morePress(Action *action)
Handler for pressing the More button.
Definition: ResearchInfoState.cpp:229
Text string displayed on screen.
Definition: Text.h:41
Window which allows changing of the number of assigned scientist to a project.
Definition: ResearchInfoState.h:40
Represent a ResearchProject Contain information about assigned scientist, time already spent and cost...
Definition: ResearchProject.h:33
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: ResearchInfoState.cpp:192
void lessByValue(int change)
Remove the given number of scientists from the project if possible.
Definition: ResearchInfoState.cpp:335
void handleWheel(Action *action)
Handler for using the mouse wheel.
Definition: ResearchInfoState.cpp:219
void more()
Function called every time the _timerMore timer is triggered.
Definition: ResearchInfoState.cpp:298
void lessRelease(Action *action)
Handler for releasing the Less button.
Definition: ResearchInfoState.cpp:273
void moreByValue(int change)
Add given number of scientists to the project if possible.
Definition: ResearchInfoState.cpp:308
ResearchInfoState(Game *game, Base *base, RuleResearch *rule)
Creates the ResearchProject state.
Definition: ResearchInfoState.cpp:49
void moreClick(Action *action)
Handler for clicking the More button.
Definition: ResearchInfoState.cpp:252
void lessPress(Action *action)
Handler for pressing the Less button.
Definition: ResearchInfoState.cpp:264
Represents a player base on the globe.
Definition: Base.h:47
Coloured button with a text label.
Definition: TextButton.h:40
Represents one research project.
Definition: RuleResearch.h:40
Button with an arrow on it.
Definition: ArrowButton.h:37
void less()
Function called every time the _timerLess timer is triggered.
Definition: ResearchInfoState.cpp:325
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
void think()
Runs state functionality every cycle(used to update the timer).
Definition: ResearchInfoState.cpp:351
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: ResearchInfoState.cpp:182