make some classes final

This commit is contained in:
altalk23 2024-06-20 23:00:04 +03:00
parent c66ddd56ac
commit ea96e2c658
13 changed files with 20 additions and 20 deletions

View file

@ -1868,7 +1868,7 @@ NS_CC_END
#ifndef GEODE_IS_MEMBER_TEST
namespace geode {
struct GEODE_DLL UserObjectSetEvent : public Event {
struct GEODE_DLL UserObjectSetEvent final : public Event {
cocos2d::CCNode* node;
const std::string id;
cocos2d::CCObject* value;
@ -1876,7 +1876,7 @@ namespace geode {
UserObjectSetEvent(cocos2d::CCNode* node, std::string const& id, cocos2d::CCObject* value);
};
class GEODE_DLL AttributeSetFilter : public EventFilter<UserObjectSetEvent> {
class GEODE_DLL AttributeSetFilter final : public EventFilter<UserObjectSetEvent> {
public:
using Callback = void(UserObjectSetEvent*);

View file

@ -25,7 +25,7 @@ namespace geode::ipc {
// example, an external application can query what mods are loaded in Geode
// by sending the `list-mods` message to `geode.loader`.
class GEODE_DLL IPCEvent : public Event {
class GEODE_DLL IPCEvent final : public Event {
protected:
void* m_rawPipeHandle;
bool m_replied = false;
@ -48,7 +48,7 @@ namespace geode::ipc {
virtual ~IPCEvent();
};
class GEODE_DLL IPCFilter : public EventFilter<IPCEvent> {
class GEODE_DLL IPCFilter final : public EventFilter<IPCEvent> {
public:
using Callback = matjson::Value(IPCEvent*);

View file

@ -51,7 +51,7 @@ namespace geode {
class LoaderImpl;
class GEODE_DLL Loader {
class GEODE_DLL Loader final {
private:
class Impl;
std::unique_ptr<Impl> m_impl;

View file

@ -75,7 +75,7 @@ namespace geode {
* Represents a Mod ingame.
* @class Mod
*/
class GEODE_DLL Mod {
class GEODE_DLL Mod final {
protected:
class Impl;
std::unique_ptr<Impl> m_impl;

View file

@ -20,7 +20,7 @@ namespace geode {
/**
* Event that is fired when a mod is loaded / unloaded / enabled / disabled
*/
class GEODE_DLL ModStateEvent : public Event {
class GEODE_DLL ModStateEvent final : public Event {
protected:
ModEventType m_type;
Mod* m_mod;
@ -34,7 +34,7 @@ namespace geode {
/**
* Listener for mod load/enable/disable/unload/data save events
*/
class GEODE_DLL ModStateFilter : public EventFilter<ModStateEvent> {
class GEODE_DLL ModStateFilter final : public EventFilter<ModStateEvent> {
public:
using Callback = void(ModStateEvent*);

View file

@ -51,7 +51,7 @@ namespace geode {
* Represents all the data gather-able
* from mod.json
*/
class GEODE_DLL ModMetadata {
class GEODE_DLL ModMetadata final {
class Impl;
std::unique_ptr<Impl> m_impl;

View file

@ -244,7 +244,7 @@ namespace geode {
};
template<class T>
class GeodeSettingValue : public SettingValue {
class GeodeSettingValue final : public SettingValue {
public:
using ValueType = typename T::ValueType;

View file

@ -8,14 +8,14 @@
#include <optional>
namespace geode {
struct GEODE_DLL SettingChangedEvent : public Event {
struct GEODE_DLL SettingChangedEvent final : public Event {
Mod* mod;
SettingValue* value;
SettingChangedEvent(Mod* mod, SettingValue* value);
};
class GEODE_DLL SettingChangedFilter : public EventFilter<SettingChangedEvent> {
class GEODE_DLL SettingChangedFilter final : public EventFilter<SettingChangedEvent> {
protected:
std::string m_modID;
std::optional<std::string> m_targetKey;

View file

@ -13,7 +13,7 @@ namespace geode {
{ T::CLASS_NAME } -> std::convertible_to<const char*>;
};
class GEODE_DLL NodeIDs {
class GEODE_DLL NodeIDs final {
public:
template<class T>
using Provider = void(GEODE_CALL*)(T*);

View file

@ -39,7 +39,7 @@ namespace geode {
};
template<InheritsCCNode T>
class EnterLayerEvent : public AEnterLayerEvent {
class EnterLayerEvent final : public AEnterLayerEvent {
public:
EnterLayerEvent(
std::string const& layerID,
@ -55,7 +55,7 @@ namespace geode {
concept InheritsEnterLayer = std::is_base_of_v<EnterLayerEvent<N>, T>;
template<class N, InheritsEnterLayer<N> T = EnterLayerEvent<N>>
class EnterLayerFilter : public EventFilter<EnterLayerEvent<N>> {
class EnterLayerFilter final : public EventFilter<EnterLayerEvent<N>> {
public:
using Callback = void(T*);

View file

@ -10,7 +10,7 @@ namespace cocos2d {
}
namespace geode {
class GEODE_DLL SceneManager {
class GEODE_DLL SceneManager final {
protected:
cocos2d::CCArray* m_persistedNodes;
cocos2d::CCScene* m_lastScene = nullptr;

View file

@ -6,14 +6,14 @@
#include "../loader/Event.hpp"
namespace geode {
struct GEODE_DLL ColorProvidedEvent : public Event {
struct GEODE_DLL ColorProvidedEvent final : public Event {
std::string id;
cocos2d::ccColor4B color;
ColorProvidedEvent(std::string const& id, cocos2d::ccColor4B const& color);
};
class GEODE_DLL ColorProvidedFilter : public EventFilter<ColorProvidedEvent> {
class GEODE_DLL ColorProvidedFilter final : public EventFilter<ColorProvidedEvent> {
public:
using Callback = void(ColorProvidedEvent*);

View file

@ -265,7 +265,7 @@ namespace geode::utils::file {
*/
GEODE_DLL Task<Result<std::vector<std::filesystem::path>>> pickMany(FilePickOptions const& options);
class GEODE_DLL FileWatchEvent : public Event {
class GEODE_DLL FileWatchEvent final : public Event {
protected:
std::filesystem::path m_path;
@ -274,7 +274,7 @@ namespace geode::utils::file {
std::filesystem::path getPath() const;
};
class GEODE_DLL FileWatchFilter : public EventFilter<FileWatchEvent> {
class GEODE_DLL FileWatchFilter final : public EventFilter<FileWatchEvent> {
protected:
std::filesystem::path m_path;