VoltAir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Groups Pages
Signals | Public Member Functions | Properties | List of all members
PickupLogic Class Reference

Defines a behavior that, when added to an Actor, makes it "collectable". More...

Inheritance diagram for PickupLogic:
Logic QObject

Signals

void pickupValueChanged ()
 Emitted when pickupValue changes. More...
 
void allowNonPlayerPickupChanged ()
 Emitted when allowNonPlayerPickup changes. More...
 
void pickupSoundChanged ()
 Emitted when pickupSound changes. More...
 
void collected (Actor *otherActor)
 Emitted when actor is collected. More...
 
- Signals inherited from Logic
void activeChanged ()
 Emitted when active changes. More...
 

Public Member Functions

int getPickupValue () const
 Returns pickupValue. More...
 
void setPickupValue (int value)
 Sets pickupValue. More...
 
bool allowsNonPlayerPickup () const
 Returns allowNonPlayerPickup. More...
 
void setAllowNonPlayerPickup (bool value)
 Sets allowNonPlayerPickup. More...
 
const QStringgetPickupSound () const
 Returns pickupSound. More...
 
void setPickupSound (const QString &value)
 Sets pickupSound. More...
 
Q_INVOKABLE void reset ()
 Makes actor collectable again. More...
 
virtual void init () override
 Checks that the PickupLogic has an actor with a Body. More...
 
- Public Member Functions inherited from Logic
 Logic (QObject *parent=nullptr)
 Constructs a Logic. More...
 
ActorgetActor () const
 Returns actor. More...
 
bool isActive () const
 Returns active. More...
 
void setActive (bool value)
 Sets active. More...
 
virtual void update ()
 Performs the update (i.e. execution of behavior) of this Logic. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
virtual const QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QString &name, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegExp &regExp, QFlags< Qt::FindChildOption > options) const
 
QList< T > findChildren (const QRegularExpression &re, QFlags< Qt::FindChildOption > options) const
 
const QObjectList & children () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const
 
bool disconnect (const QObject *receiver, const char *method) const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 

Properties

int pickupValue
 Number of points awarded to Actor::PlayerActor's for collection. More...
 
bool allowNonPlayerPickup
 true if non-sensor Bodys whose parent Actor is not a Actor::PlayerActor can collect actor. More...
 
QString pickupSound
 Name of sound asset to play once upon collection. More...
 
- Properties inherited from Logic
Actor actor
 Parent actor that is affected by this Logic's behavior. More...
 
bool active
 Whether or not Engine calls update() on this Logic during the Engine::LOGICS_PHASE. More...
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 

Detailed Description

Defines a behavior that, when added to an Actor, makes it "collectable".

When a Body, whose corresponding Actor is an Actor::PlayerActor if allowNonPlayerPickup is false, comes in contact with actor, PickupLogic "collects" actor. Collection involves:

Member Function Documentation

void PickupLogic::allowNonPlayerPickupChanged ( )
signal

Emitted when allowNonPlayerPickup changes.

bool PickupLogic::allowsNonPlayerPickup ( ) const
inline
void PickupLogic::collected ( Actor otherActor)
signal

Emitted when actor is collected.

Parameters
otherActorActor who collected actor
const QString& PickupLogic::getPickupSound ( ) const
inline

Returns pickupSound.

int PickupLogic::getPickupValue ( ) const
inline

Returns pickupValue.

virtual void PickupLogic::init ( )
overridevirtual

Checks that the PickupLogic has an actor with a Body.

Reimplemented from Logic.

void PickupLogic::pickupSoundChanged ( )
signal

Emitted when pickupSound changes.

void PickupLogic::pickupValueChanged ( )
signal

Emitted when pickupValue changes.

Q_INVOKABLE void PickupLogic::reset ( )

Makes actor collectable again.

Note
If any visual or physical state changes were performed outside of this PickupLogic on previous collections, they will need to also be reset.
void PickupLogic::setAllowNonPlayerPickup ( bool  value)

Sets allowNonPlayerPickup.

Parameters
valueBoolean to set allowNonPlayerPickup to
void PickupLogic::setPickupSound ( const QString value)

Sets pickupSound.

Parameters
valueString to set pickupSound to
void PickupLogic::setPickupValue ( int  value)

Sets pickupValue.

Parameters
valueInteger to set pickupValue to

Property Documentation

bool PickupLogic::allowNonPlayerPickup
readwrite

true if non-sensor Bodys whose parent Actor is not a Actor::PlayerActor can collect actor.

QString PickupLogic::pickupSound
readwrite

Name of sound asset to play once upon collection.

int PickupLogic::pickupValue
readwrite

Number of points awarded to Actor::PlayerActor's for collection.