freg  0.3
Free-Roaming Elementary Game
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Door Class Reference

#include <blocks.h>

Inheritance diagram for Door:
Inheritance graph
[legend]
Collaboration diagram for Door:
Collaboration graph
[legend]

Public Member Functions

 Door (int sub, int id)
 
 Door (QDataStream &str, int sub, int id)
 
int ShouldAct () const override
 
void ActFrequent () override
 
void Damage (int dmg, int dmg_kind) override
 
QString FullName () const override
 
usage_types Use (Block *who) override
 
push_reaction PushResult (dirs) const override
 
- Public Member Functions inherited from Active
 Active (int sub, int id, int transp=UNDEF)
 
 Active (QDataStream &str, int sub, int id, int transp=UNDEF)
 
int X () const
 
int Y () const
 
void Move (dirs dir) override
 
void ReceiveSignal (QString) override
 Receive text signal. More...
 
ActiveActiveBlock () overridefinal
 
ShredGetShred () const
 
WorldGetWorld () const
 
void ActRare ()
 
virtual inner_actions ActInner ()
 
virtual void UpdateLightRadius ()
 
void SetShred (Shred *)
 
void Farewell ()
 
void Unregister ()
 
- Public Member Functions inherited from Block
 Block (int sub, int kind, int transp=UNDEF)
 
 Block (QDataStream &, int sub, int kind, int transp=UNDEF)
 
virtual ~Block ()
 
Blockoperator= (Block &)=delete
 
 Block (Block &)=delete
 
virtual bool Catchable () const
 
virtual bool Inscribe (QString str)
 Returns true on success. More...
 
virtual usage_types UseOnShredMove (Block *user)
 
virtual BlockDropAfterDamage (bool *delete_self)
 Should return dropped block. More...
 
virtual InventoryHasInventory ()
 
virtual AnimalIsAnimal ()
 
virtual FallingShouldFall ()
 
virtual wearable Wearable () const
 
virtual int DamageKind () const
 
virtual int DamageLevel () const
 
virtual int LightRadius () const
 
virtual int Weight () const
 
int GetId () const
 Determines kind and sub, unique for every kind-sub pair. More...
 
void Restore ()
 Set maximum durability. More...
 
void Break ()
 Set durability to null. More...
 
void Mend (int plus)
 Increase durability, no more than MAX_DURABILITY. More...
 
void SetDir (int dir)
 
dirs GetDir () const
 
int GetDurability () const
 
QString GetNote () const
 
int Transparent () const
 
int Sub () const
 
int Kind () const
 
bool operator== (const Block &) const
 
bool operator!= (const Block &) const
 
void SaveToFile (QDataStream &out)
 
void SaveNormalToFile (QDataStream &out) const
 
void RestoreDurabilityAfterSave ()
 Importart! Use it if block won't be deleted after SaveToFile. More...
 

Protected Member Functions

void SaveAttributes (QDataStream &out) const override
 
- Protected Member Functions inherited from Active
void SendSignalAround (QString) const
 
void DamageAround () const
 
void TryDestroy (int x, int y, int z) const
 Damages block and destroys it if it is broken. More...
 
bool IsSubAround (int sub) const
 Returns true if there is at least 1 block of substance sub around. More...
 
bool Gravitate (int range, int down, int up, int calmness)
 
virtual void DoRareAction ()
 
virtual int Attractive (int sub) const
 
- Protected Member Functions inherited from Xyz
 Xyz (short x, short y, short z)
 
 Xyz ()
 
short Z () const
 
void SetXyz (short x, short y, short z)
 
- Protected Member Functions inherited from Xy
 Xy (short x, short y)
 
 Xy ()
 
short X () const
 
short Y () const
 

Private Attributes

bool shifted
 
bool locked
 
push_reaction movable = NOT_MOVABLE
 

Additional Inherited Members

- Signals inherited from Active
void Moved (int)
 
void Updated ()
 
void ReceivedText (const QString)
 
- Static Public Member Functions inherited from Block
static QString SubName (int sub)
 Returns translated substance name. More...
 
static QString SubNameUpper (int sub)
 Returns translated substance name with first upper letter. More...
 
static sub_groups GetSubGroup (int sub)
 
static dirs MakeDirFromDamage (int damage_kind)
 
static QString DirString (dirs)
 
- Protected Attributes inherited from Block
quint16 noteId
 To convert DAMAGE_PUSH_UP...WEST to corresponding direction. More...
 
- Protected Attributes inherited from Xyz
short z_self
 
- Protected Attributes inherited from Xy
short x_self
 
short y_self
 

Detailed Description

Definition at line 125 of file blocks.h.

Constructor & Destructor Documentation

Door::Door ( int  sub,
int  id 
)

Definition at line 329 of file blocks.cpp.

Door::Door ( QDataStream &  str,
int  sub,
int  id 
)

Definition at line 336 of file blocks.cpp.

Member Function Documentation

void Door::ActFrequent ( )
overridevirtual

Reimplemented from Active.

Definition at line 301 of file blocks.cpp.

void Door::Damage ( int  dmg,
int  dmg_kind 
)
overridevirtual

Reimplemented from Active.

Definition at line 288 of file blocks.cpp.

QString Door::FullName ( ) const
overridevirtual

Implements Active.

Definition at line 313 of file blocks.cpp.

push_reaction Door::PushResult ( dirs  ) const
overridevirtual

Reimplemented from Block.

Definition at line 311 of file blocks.cpp.

void Door::SaveAttributes ( QDataStream &  out) const
overrideprotectedvirtual

Reimplemented from Block.

Definition at line 324 of file blocks.cpp.

int Door::ShouldAct ( ) const
overridevirtual

Reimplemented from Active.

Definition at line 310 of file blocks.cpp.

usage_types Door::Use ( Block who)
overridevirtual

Reimplemented from Block.

Definition at line 319 of file blocks.cpp.

Member Data Documentation

bool Door::locked
private

Definition at line 143 of file blocks.h.

push_reaction Door::movable = NOT_MOVABLE
private

Definition at line 144 of file blocks.h.

bool Door::shifted
private

Definition at line 142 of file blocks.h.


The documentation for this class was generated from the following files: