From 686f898259fa05bccf45299e955694dfdf1333cc Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 26 Apr 2020 20:12:31 +0200 Subject: [PATCH] WeatherChangeEvent. C Interface. --- CInterface/Battling/EventHooks.cpp | 8 ++++++++ src/Battling/EventHooks/WeatherChangeEvent.hpp | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 CInterface/Battling/EventHooks.cpp diff --git a/CInterface/Battling/EventHooks.cpp b/CInterface/Battling/EventHooks.cpp new file mode 100644 index 0000000..c74e106 --- /dev/null +++ b/CInterface/Battling/EventHooks.cpp @@ -0,0 +1,8 @@ +#include "../../src/Battling/EventHooks/WeatherChangeEvent.hpp" +#include "../Core.hpp" +using namespace PkmnLib::Battling; + +export void PkmnLib_WeatherChangeEvent_Destruct(WeatherChangeEvent* p) { delete p; } +export const char* PkmnLib_WeatherChangeEvent_GetWeatherName(WeatherChangeEvent* p) { + return p->GetWeatherName().c_str(); +} \ No newline at end of file diff --git a/src/Battling/EventHooks/WeatherChangeEvent.hpp b/src/Battling/EventHooks/WeatherChangeEvent.hpp index bf79ad1..752828b 100644 --- a/src/Battling/EventHooks/WeatherChangeEvent.hpp +++ b/src/Battling/EventHooks/WeatherChangeEvent.hpp @@ -14,6 +14,8 @@ namespace PkmnLib::Battling { [[nodiscard]] CreatureLib::Battling::EventDataKind GetKind() const noexcept override { return static_cast(PkmnEventDataKind::WeatherChange); } + + const Arbutils::CaseInsensitiveConstString GetWeatherName() const noexcept { return _weatherName; } }; }