XJ music engine  1.9.6
In-game runtime engine for XJ music.
Chain.h
Go to the documentation of this file.
1 // Copyright (c) XJ Music Inc. (https://xjmusic.com) All Rights Reserved.
2 
3 #ifndef CHAIN_H
4 #define CHAIN_H
5 
6 #include <string>
7 
9 
11 
12 namespace XJ {
13 
14  class Chain {
15  public:
16 
17  enum Type {
20  };
21 
22  enum State {
27  };
28 
29  Chain() = default;
30 
35  std::string shipKey{};
37  std::string name{};
39 
45  static Type parseType(const std::string &value);
46 
52  static State parseState(const std::string &value);
53 
59  static std::string toString(const Type &type);
60 
66  static std::string toString(const State &state);
67 
73  [[nodiscard]] bool equals(const Chain &chain) const;
74 
79  [[nodiscard]] unsigned long long hashCode() const;
80 
87  friend bool operator<(const Chain &lhs, const Chain &rhs) {
88  return lhs.id < rhs.id;
89  }
90  };
91 
92 }// namespace XJ
93 
94 #endif//CHAIN_H
Definition: Chain.h:14
State
Definition: Chain.h:22
@ Draft
Definition: Chain.h:23
@ Failed
Definition: Chain.h:26
@ Fabricate
Definition: Chain.h:25
@ Ready
Definition: Chain.h:24
TemplateConfig config
Definition: Chain.h:36
std::string name
Definition: Chain.h:37
std::string shipKey
Definition: Chain.h:35
UUID id
Definition: Chain.h:31
static Type parseType(const std::string &value)
Definition: Chain.cpp:26
Type
Definition: Chain.h:17
@ Preview
Definition: Chain.h:18
@ Production
Definition: Chain.h:19
Chain()=default
bool equals(const Chain &chain) const
Definition: Chain.cpp:52
long long updatedAt
Definition: Chain.h:38
static std::string toString(const Type &type)
Definition: Chain.cpp:42
static State parseState(const std::string &value)
Definition: Chain.cpp:34
friend bool operator<(const Chain &lhs, const Chain &rhs)
Definition: Chain.h:87
Type type
Definition: Chain.h:33
State state
Definition: Chain.h:34
unsigned long long hashCode() const
Definition: Chain.cpp:63
UUID templateId
Definition: Chain.h:32
static long long currentTimeMillis()
Definition: EntityUtils.h:62
Definition: TemplateConfig.h:16
Definition: ActiveAudio.h:11
std::string UUID
Definition: EntityUtils.h:28