ScummVM API documentation
shuttleenergymeter.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_NEIGHBORHOOD_MARS_SHUTTLEENERGYMETER_H
26 #define PEGASUS_NEIGHBORHOOD_MARS_SHUTTLEENERGYMETER_H
27 
28 #include "pegasus/fader.h"
29 #include "pegasus/surface.h"
30 
31 namespace Pegasus {
32 
33 static const int32 kFullShuttleEnergy = 100;
34 // Low is 20 percent
35 static const int32 kLowShuttleEnergy = kFullShuttleEnergy * 20 / 100;
36 
37 static const int32 kMinDampingEnergy = 15;
38 static const int32 kMinGravitonEnergy = 63;
39 
40 static const TimeScale kTractorBeamScale = kFifteenTicksPerSecond;
41 static const TimeValue kTractorBeamTime = kFiveSeconds * kTractorBeamScale;
42 static const int32 kTractorBeamEnergy = kLowShuttleEnergy;
43 
45 public:
47  ~ShuttleEnergyMeter() override {}
48 
49  void initShuttleEnergyMeter();
50  void disposeShuttleEnergyMeter();
51 
52  void powerUpMeter();
53 
54  void setEnergyValue(const int32);
55  int32 getEnergyValue() const;
56 
57  void dropEnergyValue(const int32);
58 
59  void drainForTractorBeam();
60 
61  bool enoughEnergyForTractorBeam() const;
62 
63  void draw(const Common::Rect &) override;
64 
65 protected:
66  Surface _meterImage;
67  Surface _lowWarning;
68 };
69 
70 } // End of namespace Pegasus
71 
72 #endif
Definition: fader.h:99
Definition: rect.h:144
Definition: shuttleenergymeter.h:44
Definition: surface.h:50
Definition: ai_action.h:33