Polyphase Game Engine
Loading...
Searching...
No Matches
BuildTargetRegistry.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "EngineTypes.h"
8
9#include <string>
10#include <vector>
11
25struct RegisteredBuildTarget
26{
27 HookId mHookId = 0;
28 bool mIsBuiltIn = false;
30 /* Deep-copied strings — own the memory the descriptor points at. */
31 std::string mTargetId;
32 std::string mDisplayName;
33 std::string mIconText;
34 std::string mCategory;
35 std::string mBinaryExtension;
36 std::string mPlatformExtensionDir; // empty unless addon provides a runtime
37
39 PolyphaseBuildTargetDesc mDesc{};
40};
41
51class BuildTargetRegistry
52{
53public:
63 void Register(HookId hookId, const PolyphaseBuildTargetDesc* desc, bool isBuiltIn = false);
64
66 void Unregister(HookId hookId, const char* targetId);
67
69 void RemoveAllForHook(HookId hookId);
70
72 const RegisteredBuildTarget* Find(const char* targetId) const;
73
75 const RegisteredBuildTarget* FindBuiltInByPlatform(Platform platform) const;
76
78 const std::vector<RegisteredBuildTarget>& GetAll() const { return mTargets; }
79
81 size_t Count() const { return mTargets.size(); }
82
84 void Clear();
85
86private:
87 std::vector<RegisteredBuildTarget> mTargets;
88};
89
90#endif /* EDITOR */
Editor UI extension system for native addons.
Platform
Definition EngineTypes.h:31
Stable C ABI header for native build-target addons.