34 info->name =
_(
"unnamed");
37 info->display.sprites.push_back(std::move(errorSprite));
44static std::optional<ActorSprite::TargetCursorSize> targetCursorSizeFromString(
const std::string &cursor)
53static std::optional<Cursor> cursorFromString(
const std::string &cursor)
73 const auto cursorSize = targetCursorSizeFromString(size);
76 Log::info(
"Unknown targetCursor value \"%s\" for %s",
77 size.c_str(),
name.c_str());
84 const auto cursor = cursorFromString(cursorName);
87 Log::info(
"Unknown hoverCursor value \"%s\" for %s",
88 cursorName.c_str(),
name.c_str());
95 mSounds[event].push_back(
"sfx/" + filename);
100 static const std::string empty;
103 return i ==
mSounds.end() ? empty :
104 i->second.at(rand() % i->second.size());
109 static const Attack empty {
110 SpriteAction::ATTACK,
118 return it ==
mAttacks.end() ? empty : it->second;
Holds information about a certain type of monster.
static BeingInfo * Unknown
std::map< SoundEvent, std::vector< std::string > > mSounds
std::map< int, Attack > mAttacks
const Attack & getAttack(int id) const
ActorSprite::TargetCursorSize targetCursorSize
void addSound(SoundEvent event, const std::string &filename)
void setHoverCursor(const std::string &cursorName)
void addAttack(int id, Attack attack)
const std::string & getSound(SoundEvent event) const
void setTargetCursorSize(const std::string &size)
std::string getStringValue(const std::string &key) const
int getIntValue(const std::string &key) const
returns a value corresponding to the given key.
Configuration paths
XML default paths information reader.
void info(const char *log_text,...) LOG_PRINTF_ATTR