freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Dwarf.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 DWARF_H
21 #define DWARF_H
22 
23 #include "blocks/Animal.h"
24 #include "Inventory.h"
25 
26 const int MIN_DWARF_LIGHT_RADIUS = 2;
27 
28 class Dwarf : public Animal, public Inventory {
29  Q_OBJECT
30 public:
31  Dwarf(int sub, int id);
32  Dwarf(QDataStream & str, int sub, int id);
33 
34  int ShouldAct() const override;
35  int DamageKind() const override;
36  void Move(dirs direction) override;
37  int Start() const override;
38  int Weight() const override;
39  int DamageLevel() const override;
40  void Damage(int dmg, int dmg_kind) override;
41  void UpdateLightRadius() override;
42  QString FullName() const override;
43  QString InvFullName(int slot_number) const override;
44 
45  bool Access() const override;
46  bool Inscribe(QString str) override;
47  bool GetExact(Block *, int to) override;
48  void ReceiveSignal(QString) override;
49  int LightRadius() const override;
50  int NutritionalValue(subs) const override;
51  Block * DropAfterDamage(bool * delete_block) override;
52  Inventory * HasInventory() override;
53 
54 protected:
55  void SaveAttributes(QDataStream & out) const override;
56 
57 private:
58  enum {
64  };
65 
66  int UpdateLightRadiusInner() const;
67 
69 };
70 
71 #endif // DWARF_H
int DamageKind() const override
Definition: Dwarf.cpp:68
int lightRadius
Definition: Dwarf.h:68
int UpdateLightRadiusInner() const
Definition: Dwarf.cpp:60
QString FullName() const override
Definition: Dwarf.cpp:49
int Start() const override
Definition: Dwarf.cpp:43
bool GetExact(Block *, int to) override
Returns true if block found its place.
Definition: Dwarf.cpp:130
int ShouldAct() const override
Definition: Dwarf.cpp:42
Block * DropAfterDamage(bool *delete_block) override
Should return dropped block.
Definition: Dwarf.cpp:36
void SaveAttributes(QDataStream &out) const override
Definition: Dwarf.cpp:153
Dwarf(int sub, int id)
Definition: Dwarf.cpp:176
void ReceiveSignal(QString) override
Definition: Dwarf.cpp:47
Provides declaration for class Inventory for freg.
Definition: Animal.h:27
void Move(dirs direction) override
Definition: Dwarf.cpp:109
subs
Substance block is made from.
Definition: header.h:157
int LightRadius() const override
Definition: Dwarf.cpp:44
int NutritionalValue(subs) const override
Definition: Dwarf.cpp:120
quint8 direction
Definition: Block.h:178
dirs
Definition: header.h:85
Provides block ability to contain other blocks inside.
Definition: Inventory.h:33
bool Access() const override
Definition: Dwarf.cpp:45
const quint8 sub
Definition: Block.h:177
int Weight() const override
Definition: Dwarf.cpp:26
Definition: Dwarf.h:28
void Damage(int dmg, int dmg_kind) override
Definition: Dwarf.cpp:85
bool Inscribe(QString str) override
Returns true on success.
Definition: Dwarf.cpp:158
QString InvFullName(int slot_number) const override
Definition: Dwarf.cpp:163
Block without special physics and attributes.
Definition: Block.h:89
Inventory * HasInventory() override
Definition: Dwarf.cpp:46
void UpdateLightRadius() override
Definition: Dwarf.cpp:55
int DamageLevel() const override
Definition: Dwarf.cpp:74
const int MIN_DWARF_LIGHT_RADIUS
Definition: Dwarf.h:26