XJ music engine  1.9.6
In-game runtime engine for XJ music.
InstrumentMeme.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef XJMUSIC_INSTRUMENT_MEME_H
4 #define XJMUSIC_INSTRUMENT_MEME_H
5 
6 #include <string>
7 #include <set>
8 
10 #include "ContentEntity.h"
11 
12 namespace XJ {
13 
14  class InstrumentMeme : public ContentEntity {
15  public:
16 
17  InstrumentMeme() = default;
18 
20  std::string name;
21 
27  static std::set<std::string> getNames(const std::set<const InstrumentMeme *>& instrumentMemes);
28 
29  };
30 
36  inline void from_json(const json &json, InstrumentMeme &entity) {
37  EntityUtils::setRequired(json, "id", entity.id);
38  EntityUtils::setRequired(json, "instrumentId", entity.instrumentId);
39  EntityUtils::setIfNotNull(json, "name", entity.name);
40  }
41 
42 }// namespace XJ
43 
44 #endif//XJMUSIC_INSTRUMENT_MEME_H
nlohmann::json json
Definition: EntityUtils.h:14
Definition: ContentEntity.h:12
UUID id
Definition: ContentEntity.h:17
static void setIfNotNull(const json &json, const std::string &key, std::string &value)
Definition: EntityUtils.cpp:27
static void setRequired(const json &json, const std::string &key, UUID &value)
Definition: EntityUtils.cpp:16
Definition: InstrumentMeme.h:14
UUID instrumentId
Definition: InstrumentMeme.h:19
std::string name
Definition: InstrumentMeme.h:20
static std::set< std::string > getNames(const std::set< const InstrumentMeme * > &instrumentMemes)
Definition: InstrumentMeme.cpp:7
InstrumentMeme()=default
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28
void from_json(const json &json, Instrument &entity)
Definition: Instrument.h:106