Files
GoakeFlax/Source/Game/MyScript.h
2025-12-21 17:46:25 +02:00

120 lines
6.2 KiB
C++

#pragma once
#include "Engine/Scripting/Script.h"
#include <Engine/Animations/Curve.h>
#include <Engine/AI/Behavior.h>
#include "Engine/Graphics/PostProcessEffect.h"
#include "Engine/Graphics/RenderTask.h"
#include "Engine/Graphics/Graphics.h"
#include "Engine/Scripting/SoftTypeReference.h"
#include "Engine/Content/SceneReference.h"
#include "Engine/Content/Assets/Model.h"
#include "Engine/Networking/NetworkChannelType.h"
#include "Engine/Online/IOnlinePlatform.h"
#include "Engine/Render2D/FontAsset.h"
API_STRUCT(NoDefault) struct TestStruct : public ISerializable
{
API_AUTO_SERIALIZATION();
DECLARE_SCRIPTING_TYPE_MINIMAL(TestStruct);
// Var
API_FIELD() Float3 Vector = Float3::One;
// Ref
API_FIELD() ScriptingObject* Object = nullptr;
// Soft Type Ref
API_FIELD() SoftTypeReference<ScriptingObject> SoftTypeRef;
// Scene Ref
API_FIELD() SceneReference SceneRef;
friend bool operator==(const TestStruct& lhs, const TestStruct& rhs)
{
return lhs.Vector == rhs.Vector &&
lhs.Object == rhs.Object &&
lhs.SoftTypeRef == rhs.SoftTypeRef &&
lhs.SceneRef == rhs.SceneRef;
}
};
API_CLASS() class GAME_API MyScript2 : public Script
{
API_AUTO_SERIALIZATION();
DECLARE_SCRIPTING_TYPE(MyScript2);
API_FUNCTION() virtual void GetStats(API_PARAM(Ref) int64& allocations, API_PARAM(Ref) int64& deallocations) {};
API_FUNCTION() virtual void ManagedCoverageTests() {};
API_FUNCTION() virtual void CoverageTest1(int32 a, bool b, Actor* c, String& d, StringAnsi& e, Float3 f) {};
API_FUNCTION() virtual void CoverageTest1Array(Array<int32> a, Array<bool> b, Array<Actor*> c, Array<String> d, Array<StringAnsi> e, Array<Float3> f) {};
API_FUNCTION() virtual void CoverageTest1ByRef(API_PARAM(Ref) int32& a, API_PARAM(Ref) bool& b, API_PARAM(Ref) String& d, API_PARAM(Ref) StringAnsi& e, API_PARAM(Ref) Float3& f) {};
API_FUNCTION() virtual void CoverageTest1ArrayByRef(API_PARAM(Ref) Array<int32>& a, API_PARAM(Ref) Array<bool>& b, API_PARAM(Ref) Array<String>& d, API_PARAM(Ref) Array<StringAnsi>& e, API_PARAM(Ref) Array<Float3>& f) {};
API_FUNCTION() virtual void CoverageTest2(Guid a, AssetReference<FontAsset> b, Array<Guid> c, Array<AssetReference<FontAsset>> d) {};
API_FUNCTION() virtual void CoverageTest3(ModelLOD* a, API_PARAM(Out) Array<ModelLOD*>& b) {};
API_FUNCTION() virtual void CoverageNamespaces1(NetworkChannelType a, Array<NetworkChannelType> b, OnlineLeaderboardSortModes c, Array<OnlineLeaderboardSortModes> d, OnlineLeaderboardValueFormats e, Array<OnlineLeaderboardValueFormats> f) {};
API_FUNCTION() virtual void SimpleCall() {};
API_FUNCTION() virtual void SimpleParams(int32 a, float b, char c, double d, int64 e) {};
API_FUNCTION() virtual void StringParamAnsi(StringAnsi str) {};
API_FUNCTION() virtual void StringParam(String str) {};
API_FUNCTION() virtual void StringParamRef(String& str) {};
API_FUNCTION() virtual void StringParamRefConst(const String& str) {};
API_FUNCTION() virtual void StringParamAsRef(API_PARAM(Ref) String& str) {};
API_FUNCTION() virtual void ActorParam(Actor* actor) {};
API_FUNCTION() virtual void ComplexParam(BehaviorUpdateContext context) {};
API_FUNCTION() virtual void Complex2Param(RenderContext& context) {};
API_FUNCTION() virtual void Complex2ParamConst(const RenderContext& context) {};
API_FUNCTION() virtual void Complex2ParamAsRef(API_PARAM(Ref) RenderContext& context) {};
API_FUNCTION() virtual void SimpleArrayParam(Array<int> arr) {};
API_FUNCTION() virtual void SimpleArrayParamRef(Array<int>& arr) {};
API_FUNCTION() virtual void SimpleArrayParamRefConst(const Array<int>& arr) {};
API_FUNCTION() virtual void SimpleArrayParamAsRef(API_PARAM(Ref) Array<int>& arr) {};
API_FUNCTION() virtual void ActorArrayParam(Array<Actor*> arr) {};
API_FUNCTION() virtual void ActorArrayParamRef(Array<Actor*>& arr) {};
API_FUNCTION() virtual void ActorArrayParamRefConst(const Array<Actor*>& arr) {};
//API_FUNCTION() virtual void ActorArrayParamAsRef(API_PARAM(Ref) Array<Actor*>& arr) {};
API_FUNCTION() virtual void ComplexArrayParam(Array<TestStruct> arr) {};
API_FUNCTION() virtual void ComplexArrayParamRef(Array<TestStruct>& arr) {};
API_FUNCTION() virtual void ComplexArrayParamRefConst(const Array<TestStruct>& arr) {};
API_FUNCTION() virtual void ComplexArrayParamAsRef(API_PARAM(Ref) Array<TestStruct>& arr) {};
//API_EVENT() Delegate<int32, Float3, const String&, String&, TestStruct&, const Array<TestStruct>&, Array<TestStruct>&> TestEvent;
};
API_CLASS() class GAME_API MyScript : public Script
{
API_AUTO_SERIALIZATION();
DECLARE_SCRIPTING_TYPE(MyScript);
/*API_STRUCT() struct GAME_API InnerStructer
{
public:
float floaty;
};*/
//API_FIELD() MyThinger<int> thingey;
// [Script]
void OnStart() override;
void OnEnable() override;
void OnDisable() override;
void OnUpdate() override;
API_FUNCTION() virtual void ManagedCoverageTests() {};
API_FUNCTION() virtual void CoverageTest1(int32 a, bool b, Actor* c, String& d, StringAnsi& e, Float3 f) {};
API_FUNCTION() virtual void CoverageTest1Array(Array<int32> a, Array<bool> b, Array<Actor*> c, Array<String> d, Array<StringAnsi> e, Array<Float3> f) {};
API_FUNCTION() virtual void CoverageTest1ByRef(API_PARAM(Ref) int32& a, API_PARAM(Ref) bool& b, API_PARAM(Ref) String& d, API_PARAM(Ref) StringAnsi& e, API_PARAM(Ref) Float3& f) {};
API_FUNCTION() virtual void CoverageTest1ArrayByRef(API_PARAM(Ref) Array<int32>& a, API_PARAM(Ref) Array<bool>& b, API_PARAM(Ref) Array<String>& d, API_PARAM(Ref) Array<StringAnsi>& e, API_PARAM(Ref) Array<Float3>& f) {};
API_FUNCTION() virtual void CoverageTest2(Guid a, AssetReference<FontAsset> b, Array<Guid> c, Array<AssetReference<FontAsset>> d) {};
API_FUNCTION() virtual void CoverageNamespaces1(NetworkChannelType a, Array<NetworkChannelType> b, OnlineLeaderboardSortModes c, Array<OnlineLeaderboardSortModes> d, OnlineLeaderboardValueFormats e, Array<OnlineLeaderboardValueFormats> f) {};
//API_FUNCTION() void Test1(API_PARAM(REF) Array<TestTypeEnum>& eenums) {};
//API_FUNCTION() BezierCurve<Transform>.Keyframe Test2(BezierCurve<Transform> kef) {};
};