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
Bucket Class Reference

#include <Bucket.h>

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

Public Member Functions

 Bucket (int sub, int id)
 
 Bucket (QDataStream &str, int sub, int id)
 
int Weight () const override
 
void ReceiveSignal (QString str) override
 Receive text signal. More...
 
bool Get (Block *block, int start) override
 Returns true on success. More...
 
void Damage (int dmg, int dmg_kind) override
 
QString FullName () const override
 
usage_types Use (Block *) override
 
InventoryHasInventory () overridefinal
 
- 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 void Move (dirs direction)
 
virtual usage_types UseOnShredMove (Block *user)
 
virtual push_reaction PushResult (dirs) const
 
virtual BlockDropAfterDamage (bool *delete_self)
 Should return dropped block. More...
 
virtual AnimalIsAnimal ()
 
virtual ActiveActiveBlock ()
 
virtual FallingShouldFall ()
 
virtual wearable Wearable () const
 
virtual int DamageKind () const
 
virtual int DamageLevel () const
 
virtual int LightRadius () 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...
 
- Public Member Functions inherited from Inventory
Inventoryoperator= (Inventory &)=delete
 
 Inventory (Inventory &inv)=delete
 
virtual bool Drop (int src, int dest, int num, Inventory *to)
 Returns true on success. More...
 
virtual bool GetAll (Inventory *from)
 Returns true on success. More...
 
virtual bool Access () const
 
virtual int Start () const
 
virtual bool GetExact (Block *block, int num)
 Returns true if block found its place. More...
 
virtual QString InvFullName (int num) const
 
void Pull (int num)
 Removes block from inventory. Does not delete block. More...
 
void MoveInside (int num_from, int num_to, int num)
 
bool MiniCraft (int num)
 Returns true on success (something has been crafted). More...
 
bool InscribeInv (int num, QString str)
 Returns true on success. More...
 
int GetInvSub (int i) const
 Returns AIR if slot number i is empty. More...
 
int GetInvKind (int i) const
 Returns BLOCK if slot number i is empty. More...
 
int Size () const
 
int GetInvWeight (int i) const
 
int Number (int i) const
 
BlockShowBlock (int slot) const
 
BlockShowBlockInSlot (int slot, int index) const
 Don't move block shown by this function. More...
 
bool IsEmpty () const
 
void Push (int x, int y, int z, int push_direction)
 
void Shake ()
 Stacks items in inventory if possible. More...
 

Protected Member Functions

void SaveAttributes (QDataStream &out) const override
 
- Protected Member Functions inherited from Inventory
 Inventory (int sz=INV_SIZE)
 It is not recommended to make inventory size more than 26. More...
 
 Inventory (QDataStream &str, int size=INV_SIZE)
 
virtual ~Inventory ()
 

Additional Inherited Members

- 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...
 

Detailed Description

Definition at line 26 of file Bucket.h.

Constructor & Destructor Documentation

Bucket::Bucket ( int  sub,
int  id 
)

Definition at line 22 of file Bucket.cpp.

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

Definition at line 27 of file Bucket.cpp.

Member Function Documentation

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

Reimplemented from Block.

Definition at line 32 of file Bucket.cpp.

QString Bucket::FullName ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 37 of file Bucket.cpp.

bool Bucket::Get ( Block block,
int  start 
)
overridevirtual

Returns true on success.

Reimplemented from Inventory.

Definition at line 53 of file Bucket.cpp.

Inventory * Bucket::HasInventory ( )
finaloverridevirtual

Reimplemented from Block.

Definition at line 34 of file Bucket.cpp.

void Bucket::ReceiveSignal ( QString  )
overridevirtual

Receive text signal.

Reimplemented from Block.

Definition at line 33 of file Bucket.cpp.

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

Reimplemented from Block.

Definition at line 64 of file Bucket.cpp.

usage_types Bucket::Use ( Block )
overridevirtual

Reimplemented from Block.

Definition at line 35 of file Bucket.cpp.

int Bucket::Weight ( ) const
overridevirtual

Reimplemented from Block.

Definition at line 68 of file Bucket.cpp.


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