载入中...
搜索中...
未找到
eve::growth::Growth类 参考

Farm growth module facade (eve.Growth): species registry + world step. 更多...

#include <Growth.h>

类 eve::growth::Growth 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Growth)
 
 Growth ()=default
 
 ~Growth () override=default
 
Result< int > registerSpeciesFromJson (const std::string &json)
 Registers species from a JSON object or array.
 
void clearSpecies ()
 Clears species (tests / demos).
 
bool hasSpecies (const std::string &id) const
 
int speciesCount () const
 
Result< void > setDaysPerSeason (int days)
 
Result< void > setSeasonLayoutFromJson (const std::string &json)
 Configures a custom season layout from JSON (alien year cycles). @cost Cheap: parses a small season table.
 
Result< void > setSecondsPerSimDay (double seconds)
 
void setRngSeed (std::uint64_t seed)
 
Result< void > advanceDays (double days)
 
Result< void > stepSeconds (double seconds)
 
std::int64_t dayIndex () const
 
std::int64_t year () const
 
std::string seasonName () const
 
Result< Organism * > spawn (const std::string &speciesId)
 Spawns any registered species (plant, animal, or custom lifeform).
 
Result< Organism * > plant (const std::string &speciesId)
 Convenience: spawn when species.kindId == "plant".
 
Result< Organism * > spawnAnimal (const std::string &speciesId)
 Convenience: spawn when species.kindId == "animal".
 
Result< void > tryBreed (Organism *carrier, Organism *partner)
 
Result< void > tryReproduce (Organism *organism)
 Solo reproduction for self_bud / fission / spore_burst species.
 
void clearEvents ()
 
int eventCount () const
 
std::string eventKind (int index) const
 
std::uint64_t eventOrganismId (int index) const
 
std::string eventSpeciesId (int index) const
 
std::string eventDetail (int index) const
 
void resetWorld ()
 Resets calendar, events, and species for demos/tests.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 

详细描述

Farm growth module facade (eve.Growth): species registry + world step.

在文件 Growth.h 第 19 行定义.

构造及析构函数说明

◆ Growth()

eve::growth::Growth::Growth ( )
default

◆ ~Growth()

eve::growth::Growth::~Growth ( )
overridedefault

成员函数说明

◆ advanceDays()

Result< void > eve::growth::Growth::advanceDays ( double  days)

◆ clearEvents()

void eve::growth::Growth::clearEvents ( )

◆ clearSpecies()

void eve::growth::Growth::clearSpecies ( )

Clears species (tests / demos).

在文件 Growth.cpp 第 17 行定义.

引用了 eve::growth::SpeciesRegistry::clear().

◆ dayIndex()

std::int64_t eve::growth::Growth::dayIndex ( ) const

◆ eventCount()

int eve::growth::Growth::eventCount ( ) const

◆ eventDetail()

std::string eve::growth::Growth::eventDetail ( int  index) const

◆ eventKind()

std::string eve::growth::Growth::eventKind ( int  index) const

◆ eventOrganismId()

std::uint64_t eve::growth::Growth::eventOrganismId ( int  index) const

◆ eventSpeciesId()

std::string eve::growth::Growth::eventSpeciesId ( int  index) const

◆ hasSpecies()

bool eve::growth::Growth::hasSpecies ( const std::string &  id) const

在文件 Growth.cpp 第 19 行定义.

引用了 eve::growth::SpeciesRegistry::has().

◆ Module_REG()

eve::growth::Growth::Module_REG ( Growth  )

◆ plant()

Result< Organism * > eve::growth::Growth::plant ( const std::string &  speciesId)

Convenience: spawn when species.kindId == "plant".

在文件 Growth.cpp 第 58 行定义.

引用了 created, eve::growth::Organism::createOrganism(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::growth::Organism::release().

◆ registerSpeciesFromJson()

Result< int > eve::growth::Growth::registerSpeciesFromJson ( const std::string &  json)

Registers species from a JSON object or array.

在文件 Growth.cpp 第 15 行定义.

引用了 eve::growth::SpeciesRegistry::loadFromJson().

◆ resetWorld()

void eve::growth::Growth::resetWorld ( )

Resets calendar, events, and species for demos/tests.

在文件 Growth.cpp 第 123 行定义.

引用了 eve::growth::SpeciesRegistry::clear() , 以及 eve::growth::GrowthWorld::resetInstance().

◆ seasonName()

std::string eve::growth::Growth::seasonName ( ) const

◆ setDaysPerSeason()

Result< void > eve::growth::Growth::setDaysPerSeason ( int  days)

◆ setRngSeed()

void eve::growth::Growth::setRngSeed ( std::uint64_t  seed)

◆ setSeasonLayoutFromJson()

Result< void > eve::growth::Growth::setSeasonLayoutFromJson ( const std::string &  json)

Configures a custom season layout from JSON (alien year cycles). @cost Cheap: parses a small season table.

在文件 Growth.cpp 第 25 行定义.

引用了 eve::growth::GrowthWorld::calendar(), eve::growth::GrowthWorld::instance() , 以及 eve::growth::GrowthCalendar::setSeasonLayoutFromJson().

◆ setSecondsPerSimDay()

Result< void > eve::growth::Growth::setSecondsPerSimDay ( double  seconds)

◆ spawn()

Result< Organism * > eve::growth::Growth::spawn ( const std::string &  speciesId)

Spawns any registered species (plant, animal, or custom lifeform).

在文件 Growth.cpp 第 56 行定义.

引用了 eve::growth::Organism::createOrganism().

◆ spawnAnimal()

Result< Organism * > eve::growth::Growth::spawnAnimal ( const std::string &  speciesId)

Convenience: spawn when species.kindId == "animal".

在文件 Growth.cpp 第 70 行定义.

引用了 created, eve::growth::Organism::createOrganism(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::growth::Organism::release().

◆ speciesCount()

int eve::growth::Growth::speciesCount ( ) const

在文件 Growth.cpp 第 21 行定义.

引用了 eve::growth::SpeciesRegistry::count().

◆ stepSeconds()

◆ tryBreed()

Result< void > eve::growth::Growth::tryBreed ( Organism *  carrier,
Organism *  partner 
)

◆ tryReproduce()

Result< void > eve::growth::Growth::tryReproduce ( Organism *  organism)

Solo reproduction for self_bud / fission / spore_burst species.

在文件 Growth.cpp 第 90 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::GrowthWorld::instance(), eve::InvalidArgument , 以及 eve::growth::GrowthWorld::tryReproduce().

◆ year()

std::int64_t eve::growth::Growth::year ( ) const

该类的文档由以下文件生成: