freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Illuminator.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 ILLUMINATOR_H
21 #define ILLUMINATOR_H
22 
23 #include "blocks/Active.h"
24 
26 
27 class Illuminator : public Active {
28  Q_OBJECT
29 public:
30  Illuminator(int sub, int id);
31  Illuminator(QDataStream & str, int sub, int id);
32 
33  int ShouldAct() const override;
34  int DamageKind() const override;
35  int LightRadius() const override;
36  Block * DropAfterDamage(bool * delete_block) override;
37  QString FullName() const override;
38  wearable Wearable() const override;
39  usage_types Use(Block *) override;
40  inner_actions ActInner() override;
41 
42 protected:
43  void DoRareAction() override;
44  void SaveAttributes(QDataStream & out) const override;
45 
46 private:
47  quint16 fuelLevel;
48  bool isOn;
49 };
50 
51 #endif // ILLUMINATOR_H
wearable Wearable() const override
Definition: Illuminator.cpp:87
Illuminator(int sub, int id)
Definition: Illuminator.cpp:25
void SaveAttributes(QDataStream &out) const override
void DoRareAction() override
Definition: Illuminator.cpp:89
quint16 fuelLevel
Definition: Illuminator.h:47
Block * DropAfterDamage(bool *delete_block) override
Should return dropped block.
Definition: Illuminator.cpp:53
inner_actions
See Shred::PhysEventsRare() for details.
Definition: Active.h:36
QString FullName() const override
Definition: Illuminator.cpp:43
int LightRadius() const override
Definition: Illuminator.cpp:75
wearable
Definition: Block.h:28
Definition: Active.h:46
usage_types
Definition: header.h:196
usage_types Use(Block *) override
Definition: Illuminator.cpp:60
inner_actions ActInner() override
Definition: Illuminator.cpp:93
const quint8 sub
Definition: Block.h:177
int ShouldAct() const override
Definition: Illuminator.cpp:86
const int MAX_FUEL
Definition: Illuminator.h:25
int DamageKind() const override
Definition: Illuminator.cpp:39
Block without special physics and attributes.
Definition: Block.h:89