[nostalgia/core] Add Fill command to tilesheet editor and make ClipboardObject more efficient
This commit is contained in:
@@ -17,6 +17,25 @@ class Size;
|
||||
|
||||
namespace nostalgia::core {
|
||||
|
||||
class BaseClipboardObject {
|
||||
public:
|
||||
virtual ~BaseClipboardObject() = default;
|
||||
|
||||
virtual ox::String typeId() const noexcept = 0;
|
||||
|
||||
constexpr auto typeMatch(auto name, auto version) const noexcept {
|
||||
auto inId = ox::sfmt("{};{}", name, version);
|
||||
return typeId() == inId;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
class ClipboardObject: public BaseClipboardObject {
|
||||
ox::String typeId() const noexcept final {
|
||||
return ox::sfmt("{};{}", T::TypeName, T::TypeVersion);
|
||||
}
|
||||
};
|
||||
|
||||
class Context;
|
||||
class Drawer;
|
||||
|
||||
@@ -59,7 +78,7 @@ class Context {
|
||||
#ifndef OX_BARE_METAL
|
||||
AssetManager assetManager;
|
||||
int uninterruptedRefreshes = 0;
|
||||
ox::Buffer clipboard;
|
||||
ox::UniquePtr<BaseClipboardObject> clipboard;
|
||||
#endif
|
||||
protected:
|
||||
#ifndef OX_BARE_METAL
|
||||
|
||||
Reference in New Issue
Block a user