Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Types | Public Member Functions | Friends | List of all members
core::file::Behavior Class Reference

Set of behaviors for NPCs and trainers. More...

#include <Behavior.hpp>

Classes

struct  Path
 Contains data for when the behavior type is following a path. More...
 
struct  Spinning
 Contains data for when the behavior type is SpinInPlace. More...
 
struct  Standing
 Contains data if the behavior type is StandStill. More...
 
struct  Wander
 Contains data for when the behavior type is Wandering. More...
 

Public Types

enum  Type : std::uint8_t { StandStill = 0 , SpinInPlace = 1 , FollowingPath = 2 , Wandering = 3 }
 The type of behavior. More...
 

Public Member Functions

 Behavior ()
 Empty behavior. Standing still facing down. More...
 
bool legacyLoad (bl::serial::binary::InputStream &input)
 Loads the behavior data from the legacy formatted file. Use serialize and deserialize for reading and writing the new format. More...
 
Type type () const
 The type of behavior this is. More...
 
void setType (Type type)
 Set the Type of behavior. Existing behavior data is cleared. More...
 
Standingstanding ()
 The data for standing still. More...
 
Spinningspinning ()
 The data for spinning. More...
 
Pathpath ()
 The data for path following. More...
 
Wanderwander ()
 The data for wandering. More...
 
const Standingstanding () const
 The data for standing still. More...
 
const Spinningspinning () const
 The data for spinning. More...
 
const Pathpath () const
 The data for path following. More...
 
const Wanderwander () const
 The data for wandering. More...
 

Friends

struct bl::serial::binary::Serializer< Behavior >
 
struct bl::serial::SerializableObject< Behavior >
 

Detailed Description

Set of behaviors for NPCs and trainers.

Definition at line 19 of file Behavior.hpp.

Member Enumeration Documentation

◆ Type

enum core::file::Behavior::Type : std::uint8_t

The type of behavior.

Enumerator
StandStill 

The character will stand and face a given direction.

SpinInPlace 

The character will spin in place.

FollowingPath 

The character will follow a preset path.

Wandering 

The character is allowed to wander freely.

Definition at line 22 of file Behavior.hpp.

Constructor & Destructor Documentation

◆ Behavior()

core::file::Behavior::Behavior ( )

Empty behavior. Standing still facing down.

Definition at line 9 of file Behavior.cpp.

Member Function Documentation

◆ legacyLoad()

bool core::file::Behavior::legacyLoad ( bl::serial::binary::InputStream &  input)

Loads the behavior data from the legacy formatted file. Use serialize and deserialize for reading and writing the new format.

Parameters
inputThe input file
Returns
True if data was read, false on error

Definition at line 13 of file Behavior.cpp.

◆ path() [1/2]

Behavior::Path & core::file::Behavior::path ( )

The data for path following.

Definition at line 110 of file Behavior.cpp.

◆ path() [2/2]

const Behavior::Path & core::file::Behavior::path ( ) const

The data for path following.

Definition at line 112 of file Behavior.cpp.

◆ setType()

void core::file::Behavior::setType ( Type  type)

Set the Type of behavior. Existing behavior data is cleared.

Parameters
typeThe type of behavior to set to

Definition at line 77 of file Behavior.cpp.

◆ spinning() [1/2]

Behavior::Spinning & core::file::Behavior::spinning ( )

The data for spinning.

Definition at line 106 of file Behavior.cpp.

◆ spinning() [2/2]

const Behavior::Spinning & core::file::Behavior::spinning ( ) const

The data for spinning.

Definition at line 108 of file Behavior.cpp.

◆ standing() [1/2]

Behavior::Standing & core::file::Behavior::standing ( )

The data for standing still.

Definition at line 102 of file Behavior.cpp.

◆ standing() [2/2]

const Behavior::Standing & core::file::Behavior::standing ( ) const

The data for standing still.

Definition at line 104 of file Behavior.cpp.

◆ type()

Behavior::Type core::file::Behavior::type ( ) const

The type of behavior this is.

Definition at line 75 of file Behavior.cpp.

◆ wander() [1/2]

Behavior::Wander & core::file::Behavior::wander ( )

The data for wandering.

Definition at line 114 of file Behavior.cpp.

◆ wander() [2/2]

const Behavior::Wander & core::file::Behavior::wander ( ) const

The data for wandering.

Definition at line 116 of file Behavior.cpp.

Friends And Related Function Documentation

◆ bl::serial::binary::Serializer< Behavior >

friend struct bl::serial::binary::Serializer< Behavior >
friend

Definition at line 194 of file Behavior.hpp.

◆ bl::serial::SerializableObject< Behavior >

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

Definition at line 194 of file Behavior.hpp.


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