Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Member Functions | Friends | List of all members
core::system::Interaction Class Reference

The main interaction system. Manages interaction between entities. Handles item logic and NPC conversations followed by trainer battles if applicable. More...

#include <Interaction.hpp>

+ Inheritance diagram for core::system::Interaction:

Public Member Functions

 Interaction (Systems &owner)
 Construct a new Interaction system. More...
 
void init ()
 Subscribes to the game event bus. More...
 
bool interact (bl::ecs::Entity interactor)
 Performs an interation on behalf of the given entity. More...
 
bool npcTalkedTo (const std::string &name) const
 Returns whether or not the given npc has been talked to. More...
 
bool trainerTalkedto (const std::string &name) const
 Returns whether or not the given trainer has been talked to. More...
 
bool flagSet (const std::string &flag) const
 Checks if the given conversation flag has been set. More...
 
void setFlag (const std::string &flag)
 Sets the conversation flag. More...
 

Friends

struct bl::serial::SerializableObject< Interaction >
 

Detailed Description

The main interaction system. Manages interaction between entities. Handles item logic and NPC conversations followed by trainer battles if applicable.

Definition at line 26 of file Interaction.hpp.

Constructor & Destructor Documentation

◆ Interaction()

core::system::Interaction::Interaction ( Systems owner)

Construct a new Interaction system.

Parameters
ownerThe primary Systems object

Definition at line 27 of file Interaction.cpp.

Member Function Documentation

◆ flagSet()

bool core::system::Interaction::flagSet ( const std::string &  flag) const

Checks if the given conversation flag has been set.

Parameters
flagThe name of the flag to check
Returns
True if the flag is set, false otherwise

Definition at line 253 of file Interaction.cpp.

◆ init()

void core::system::Interaction::init ( )

Subscribes to the game event bus.

Definition at line 33 of file Interaction.cpp.

◆ interact()

bool core::system::Interaction::interact ( bl::ecs::Entity  interactor)

Performs an interation on behalf of the given entity.

Parameters
interactorThe entity doing the interaction
Returns
True if an interaction occurred, false if nothing happened

Definition at line 35 of file Interaction.cpp.

◆ npcTalkedTo()

bool core::system::Interaction::npcTalkedTo ( const std::string &  name) const

Returns whether or not the given npc has been talked to.

Parameters
nameThe name of the NPC
Returns
True if talked to in the current map, false otherwise

Definition at line 241 of file Interaction.cpp.

◆ setFlag()

void core::system::Interaction::setFlag ( const std::string &  flag)

Sets the conversation flag.

Parameters
flagThe name of the flag to set

Definition at line 255 of file Interaction.cpp.

◆ trainerTalkedto()

bool core::system::Interaction::trainerTalkedto ( const std::string &  name) const

Returns whether or not the given trainer has been talked to.

Parameters
nameThe name of the trainer
Returns
True if talked to in the current map, false otherwise

Definition at line 247 of file Interaction.cpp.

Friends And Related Function Documentation

◆ bl::serial::SerializableObject< Interaction >

friend struct bl::serial::SerializableObject< Interaction >
friend

Definition at line 102 of file Interaction.hpp.


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