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

#include <blocks.h>

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

Public Member Functions

int ShouldAct () const override
 
int DamageKind () const override
 
int DamageLevel () const override
 
int LightRadius () const override
 
bool Inscribe (QString) override
 Returns true on success. More...
 
void Damage (int dmg, int dmg_kind) override
 
QString FullName () const override
 
BlockDropAfterDamage (bool *delete_block) override
 Should return dropped block. More...
 
wearable Wearable () const override
 
push_reaction PushResult (dirs) const override
 
inner_actions ActInner () override
 
- Public Member Functions inherited from Falling
 Falling (int sub, int id, int transp=UNDEF)
 
 Falling (QDataStream &str, int sub, int id, int transp=UNDEF)
 
void Move (dirs dir) override
 
FallingShouldFall () overridefinal
 
void FallDamage ()
 
bool IsFalling () const
 
void SetFalling (bool set)
 
- 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 ReceiveSignal (QString) override
 Receive text signal. More...
 
ActiveActiveBlock () overridefinal
 
ShredGetShred () const
 
WorldGetWorld () const
 
virtual void ActFrequent ()
 
void ActRare ()
 
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 usage_types Use (Block *user)
 
virtual usage_types UseOnShredMove (Block *user)
 
virtual InventoryHasInventory ()
 
virtual AnimalIsAnimal ()
 
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 DoRareAction () override
 
- Protected Member Functions inherited from Falling
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 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
 

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 46 of file blocks.h.

Member Function Documentation

inner_actions Liquid::ActInner ( )
overridevirtual

Reimplemented from Active.

Definition at line 102 of file blocks.cpp.

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

Reimplemented from Active.

Definition at line 105 of file blocks.cpp.

int Liquid::DamageKind ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 88 of file blocks.cpp.

int Liquid::DamageLevel ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 96 of file blocks.cpp.

void Liquid::DoRareAction ( )
overrideprotectedvirtual

Reimplemented from Active.

Definition at line 67 of file blocks.cpp.

Block * Liquid::DropAfterDamage ( bool *  delete_self)
overridevirtual

Should return dropped block.

It can be pile(BOX, DIFFERENT) containing all dropped blocks, or block itself. Set delete_self false if this block itself should not be deleted. (by default block is deleted, beware).

Reimplemented from Block.

Definition at line 111 of file blocks.cpp.

QString Liquid::FullName ( ) const
overridevirtual

Reimplemented from Falling.

Definition at line 116 of file blocks.cpp.

bool Liquid::Inscribe ( QString  str)
overridevirtual

Returns true on success.

Reimplemented from Block.

Definition at line 100 of file blocks.cpp.

int Liquid::LightRadius ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 99 of file blocks.cpp.

push_reaction Liquid::PushResult ( dirs  ) const
overridevirtual

Reimplemented from Falling.

Definition at line 103 of file blocks.cpp.

int Liquid::ShouldAct ( ) const
overridevirtual

Reimplemented from Active.

Definition at line 98 of file blocks.cpp.

wearable Liquid::Wearable ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 101 of file blocks.cpp.


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