ScummVM API documentation
airmask.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_ITEMS_INVENTORY_AIRMASK_H
26 #define PEGASUS_ITEMS_INVENTORY_AIRMASK_H
27 
28 #include "pegasus/hotspot.h"
29 #include "pegasus/timers.h"
30 #include "pegasus/items/inventory/inventoryitem.h"
31 
32 namespace Pegasus {
33 
34 class AirMask : public InventoryItem, private Idler {
35 public:
36  AirMask(const ItemID, const NeighborhoodID, const RoomID, const DirectionConstant);
37  ~AirMask() override;
38 
39  void writeToStream(Common::WriteStream *) override;
40  void readFromStream(Common::ReadStream *) override;
41 
42  void setItemState(const ItemState) override;
43  void putMaskOn();
44  void takeMaskOff();
45  void toggleItemState() override;
46  void airQualityChanged();
47 
48  bool isAirMaskInUse();
49  bool isAirMaskOn();
50  bool isAirFilterOn();
51 
52  void refillAirMask();
53 
54  // Returns a percentage
55  uint getAirLeft();
56 
57  void activateAirMaskHotspots();
58  void clickInAirMaskHotspot();
59 
60 protected:
61  void airMaskTimerExpired();
62 
63  void removedFromInventory() override;
64  void addedToInventory() override;
65  void useIdleTime() override;
66 
67  Hotspot _toggleSpot;
68  FuseFunction _oxygenTimer;
69 };
70 
71 extern AirMask *g_airMask;
72 
73 } // End of namespace Pegasus
74 
75 #endif
Definition: timers.h:37
Definition: airmask.h:34
Definition: stream.h:77
Definition: timers.h:239
Definition: hotspot.h:85
Definition: stream.h:385
Definition: ai_action.h:33
Definition: inventoryitem.h:39