freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RainMachine.h
Go to the documentation of this file.
1  /* freg, Free-Roaming Elementary Game with open and interactive world
2  * Copyright (C) 2012-2014 Alexander 'mmaulwurff' Kromm
3  * mmaulwurff@gmail.com
4  *
5  * This file is part of FREG.
6  *
7  * FREG 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  * FREG 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 FREG. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef RAINMACHINE_H
21 #define RAINMACHINE_H
22 
23 #include "blocks/Inventory.h"
24 #include "blocks/Active.h"
25 #include "Shred.h"
26 
27 class RainMachine : public Active, public Inventory {
28  Q_OBJECT
29 public:
30  RainMachine(int sub, int id);
31  RainMachine(QDataStream & stream, int sub, int id);
32 
33  void DoRareAction() override;
34  int ShouldAct() const override;
35  void ReceiveSignal(QString) override;
36  void Damage(int dmg, int dmg_kind) override;
37  void SaveAttributes(QDataStream &) const override;
38  QString FullName() const override;
39  Inventory * HasInventory() override;
40  usage_types Use(Block * who) override;
42 
43 private:
44  bool isOn;
45 };
46 
47 #endif // RAINMACHINE_H
usage_types Use(Block *who) override
Definition: RainMachine.cpp:60
inner_actions ActInner()
Definition: RainMachine.cpp:72
RainMachine(int sub, int id)
Definition: RainMachine.cpp:22
int ShouldAct() const override
Definition: RainMachine.cpp:58
QString FullName() const override
Definition: RainMachine.cpp:53
inner_actions
See Shred::PhysEventsRare() for details.
Definition: Active.h:36
void ReceiveSignal(QString) override
Receive text signal.
Definition: RainMachine.cpp:59
Provides declaration for class Inventory for freg.
void SaveAttributes(QDataStream &) const override
Definition: RainMachine.cpp:36
void DoRareAction() override
Definition: RainMachine.cpp:42
Definition: Active.h:46
usage_types
Definition: header.h:196
Provides block ability to contain other blocks inside.
Definition: Inventory.h:33
const quint8 sub
Definition: Block.h:177
Inventory * HasInventory() override
Definition: RainMachine.cpp:61
Block without special physics and attributes.
Definition: Block.h:89
void Damage(int dmg, int dmg_kind) override
Definition: RainMachine.cpp:63