JSBEnum.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. // LICENSE: Atomic Game Engine Editor and Tools EULA
  4. // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for
  5. // license information: https://github.com/AtomicGameEngine/AtomicGameEngine
  6. //
  7. #pragma once
  8. #include <Atomic/Core/Object.h>
  9. using namespace Atomic;
  10. namespace ToolCore
  11. {
  12. class JSBPackage;
  13. class JSBModule;
  14. class JSBHeader;
  15. class JSBEnum : public Object
  16. {
  17. OBJECT(JSBEnum)
  18. public:
  19. JSBEnum(Context* context, JSBModule* module, const String& name);
  20. virtual ~JSBEnum();
  21. const String& GetName() { return name_; }
  22. JSBHeader* GetHeader() { return header_; }
  23. JSBPackage* GetPackage();
  24. HashMap<String, String>& GetValues() { return values_; }
  25. void SetHeader(JSBHeader* header) { header_ = header; }
  26. void Preprocess();
  27. void AddValue(const String& name, const String& constantValue = String::EMPTY) { values_[name] = constantValue; }
  28. private:
  29. String name_;
  30. SharedPtr<JSBModule> module_;
  31. HashMap<String, String> values_;
  32. JSBHeader* header_;
  33. };
  34. }