MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / getClassDescriptionForTuning

Method getClassDescriptionForTuning

source/gamemap/GameMap.cpp:530–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530CreatureDefinition* GameMap::getClassDescriptionForTuning(const std::string& name)
531{
532 for (std::pair<const CreatureDefinition*,CreatureDefinition*>& def : mClassDescriptions)
533 {
534 if(def.second != nullptr)
535 {
536 if (def.second->getClassName().compare(name) == 0)
537 return def.second;
538 }
539 else if(def.first->getClassName().compare(name) == 0)
540 {
541 def.second = new CreatureDefinition(*def.first);
542 return def.second;
543 }
544 }
545
546 // It is a new definition
547 CreatureDefinition* def = new CreatureDefinition(name);
548 mClassDescriptions.push_back(std::pair<const CreatureDefinition*,CreatureDefinition*>(nullptr, def));
549 return def;
550}
551
552std::vector<Creature*> GameMap::getCreaturesByAlliedSeat(const Seat* seat) const
553{

Callers 1

readGameMapFromFileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected