Creepy-simulation
 
Loading...
Searching...
No Matches
SimulationFabric Class Reference

A factory class for configuring and creating Simulation objects. More...

#include <SimulationFabric.hpp>

Public Member Functions

 SimulationFabric ()=default
 Default constructor for SimulationFabric.
 
SimulationFabricsetFieldParams (const Rectangle &bounds, const std::function< double(Point p1, Point p2)> &distanceFunc)
 Sets the field parameters for the simulation.
 
decltype(fieldParams_) getFieldParams ()
 Retrieves the field parameters.
 
SimulationFabricsetCreeperParams (double moveRadius=10, double explodeRadius=10, uint32_t count=0)
 Sets the parameters for creepers in the simulation.
 
decltype(CreepersParams_) getCreepersParams_ ()
 
SimulationFabricsetSteveParams (double moveRadius=10, uint32_t count=0)
 Sets the parameters for Steves in the simulation.
 
decltype(StevesParams_) getStevesParams_ ()
 
SimulationFabricsetBedrock (const Rectangle &bedrock)
 
Simulation build ()
 

Detailed Description

A factory class for configuring and creating Simulation objects.

Constructor & Destructor Documentation

◆ SimulationFabric()

SimulationFabric::SimulationFabric ( )
default

Default constructor for SimulationFabric.

Member Function Documentation

◆ build()

Simulation SimulationFabric::build ( )
inline

◆ getCreepersParams_()

decltype(CreepersParams_) SimulationFabric::getCreepersParams_ ( )
inline

◆ getFieldParams()

decltype(fieldParams_) SimulationFabric::getFieldParams ( )
inline

Retrieves the field parameters.

Returns
Shared pointer to the field parameters.
Exceptions
std::invalid_argumentif the field parameters are not set.

◆ getStevesParams_()

decltype(StevesParams_) SimulationFabric::getStevesParams_ ( )
inline

◆ setBedrock()

SimulationFabric & SimulationFabric::setBedrock ( const Rectangle bedrock)
inline

◆ setCreeperParams()

SimulationFabric & SimulationFabric::setCreeperParams ( double  moveRadius = 10,
double  explodeRadius = 10,
uint32_t  count = 0 
)
inline

Sets the parameters for creepers in the simulation.

Parameters
moveRadiusMovement radius for creepers.
explodeRadiusExplosion radius for creepers.
countNumber of creepers.
Returns
Reference to the SimulationFabric object for chaining.
Exceptions
std::invalid_argumentif the field parameters are not set.

◆ setFieldParams()

SimulationFabric & SimulationFabric::setFieldParams ( const Rectangle bounds,
const std::function< double(Point p1, Point p2)> &  distanceFunc 
)
inline

Sets the field parameters for the simulation.

Parameters
boundsThe rectangular bounds of the field.
distanceFuncFunction to calculate distance between two points.
Returns
Reference to the SimulationFabric object for chaining.

◆ setSteveParams()

SimulationFabric & SimulationFabric::setSteveParams ( double  moveRadius = 10,
uint32_t  count = 0 
)
inline

Sets the parameters for Steves in the simulation.

Parameters
moveRadiusMovement radius for Steves.
countNumber of Steves.
Returns
Reference to the SimulationFabric object for chaining.
Exceptions
std::invalid_argumentif the field parameters are not set.

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