Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
core::battle::Battle Struct Reference

Convenience struct that owns all the components required for a battle and resolves some boilerplate setup. This is the top level object. More...

#include <Battle.hpp>

Public Types

enum class  Type { WildPeoplemon , Trainer , Online }
 Represents the different types of battles. Affects only the intro. More...
 

Public Member Functions

void setController (std::unique_ptr< BattleController > &&controller)
 Sets and initializes the controller to use in battle. More...
 

Static Public Member Functions

static std::unique_ptr< Battlecreate (bl::engine::Engine &engine, const std::string &location, system::Player &player, Type type)
 Creates the battle struct and initializes the player battler. More...
 

Public Attributes

const std::string location
 
system::Playerplayer
 
const Type type
 
BattleState state
 
std::unique_ptr< BattleControllercontroller
 
BattleView view
 
Result result
 

Detailed Description

Convenience struct that owns all the components required for a battle and resolves some boilerplate setup. This is the top level object.

Definition at line 23 of file Battle.hpp.

Member Enumeration Documentation

◆ Type

Represents the different types of battles. Affects only the intro.

Enumerator
WildPeoplemon 
Trainer 
Online 

Definition at line 25 of file Battle.hpp.

Member Function Documentation

◆ create()

std::unique_ptr< Battle > core::battle::Battle::create ( bl::engine::Engine &  engine,
const std::string &  location,
system::Player player,
Type  type 
)
static

Creates the battle struct and initializes the player battler.

Parameters
engineThe game engine instance
locationThe name of the map, town, or route where the battle is taking place
playerThe player data
typeThe type of battle this is
Returns
std::unique_ptr<Battle> The new battle struct

Definition at line 42 of file Battle.cpp.

◆ setController()

void core::battle::Battle::setController ( std::unique_ptr< BattleController > &&  controller)

Sets and initializes the controller to use in battle.

Parameters
controllerThe battle controller to use

Definition at line 55 of file Battle.cpp.

Member Data Documentation

◆ controller

std::unique_ptr<BattleController> core::battle::Battle::controller

Definition at line 50 of file Battle.hpp.

◆ location

const std::string core::battle::Battle::location

Definition at line 46 of file Battle.hpp.

◆ player

system::Player& core::battle::Battle::player

Definition at line 47 of file Battle.hpp.

◆ result

Result core::battle::Battle::result

Definition at line 52 of file Battle.hpp.

◆ state

BattleState core::battle::Battle::state

Definition at line 49 of file Battle.hpp.

◆ type

const Type core::battle::Battle::type

Definition at line 48 of file Battle.hpp.

◆ view

BattleView core::battle::Battle::view

Definition at line 51 of file Battle.hpp.


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