Integrating latest 47acbe8
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "NodeableTestingLibrary.h"
|
||||
|
||||
#include "SharedDataSlotExample.h"
|
||||
#include "ValuePointerReferenceExample.h"
|
||||
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include "Source/Nodes/Nodeables/SharedDataSlotExample.generated.h"
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
void NodeableTestingLibrary::Reflect(AZ::ReflectContext* reflection)
|
||||
{
|
||||
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection);
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<NodeableTestingLibrary, ScriptCanvas::Library::LibraryDefinition>()
|
||||
->Version(1);
|
||||
|
||||
AZ::EditContext* editContext = serializeContext->GetEditContext();
|
||||
if (editContext)
|
||||
{
|
||||
editContext->Class<NodeableTestingLibrary>("Nodeable Testing", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NodeableTestingLibrary::InitNodeRegistry(ScriptCanvas::NodeRegistry& nodeRegistry)
|
||||
{
|
||||
ScriptCanvas::Library::AddNodeToRegistry<NodeableTestingLibrary, ::Nodes::InputMethodSharedDataSlotExampleNode>(nodeRegistry);
|
||||
ScriptCanvas::Library::AddNodeToRegistry<NodeableTestingLibrary, ::Nodes::BranchMethodSharedDataSlotExampleNode>(nodeRegistry);
|
||||
|
||||
ScriptCanvas::Library::AddNodeToRegistry<NodeableTestingLibrary, ::Nodes::ReturnTypeExampleNode>(nodeRegistry);
|
||||
ScriptCanvas::Library::AddNodeToRegistry<NodeableTestingLibrary, ::Nodes::InputTypeExampleNode>(nodeRegistry);
|
||||
ScriptCanvas::Library::AddNodeToRegistry<NodeableTestingLibrary, ::Nodes::BranchInputTypeExampleNode>(nodeRegistry);
|
||||
}
|
||||
|
||||
AZStd::vector<AZ::ComponentDescriptor*> NodeableTestingLibrary::GetComponentDescriptors()
|
||||
{
|
||||
return AZStd::vector<AZ::ComponentDescriptor*>({
|
||||
::Nodes::InputMethodSharedDataSlotExampleNode::CreateDescriptor(),
|
||||
::Nodes::BranchMethodSharedDataSlotExampleNode::CreateDescriptor(),
|
||||
::Nodes::ReturnTypeExampleNode::CreateDescriptor(),
|
||||
::Nodes::InputTypeExampleNode::CreateDescriptor(),
|
||||
::Nodes::BranchInputTypeExampleNode::CreateDescriptor()
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <ScriptCanvas/Libraries/Libraries.h>
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
struct NodeableTestingLibrary : public ScriptCanvas::Library::LibraryDefinition
|
||||
{
|
||||
AZ_RTTI(NodeableTestingLibrary, "{F48EF27C-EA32-455C-88AB-191A132F093B}", ScriptCanvas::Library::LibraryDefinition);
|
||||
|
||||
static void Reflect(AZ::ReflectContext*);
|
||||
static void InitNodeRegistry(ScriptCanvas::NodeRegistry& nodeRegistry);
|
||||
static AZStd::vector<AZ::ComponentDescriptor*> GetComponentDescriptors();
|
||||
|
||||
~NodeableTestingLibrary() override = default;
|
||||
};
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScriptCanvas Include="Source/Nodes/Nodeables/SharedDataSlotExample.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Class Name="InputMethodSharedDataSlotExample"
|
||||
QualifiedName="ScriptCanvasTesting::Nodeables::InputMethodSharedDataSlotExample"
|
||||
PreferredClassName="InputMethodSharedDataSlotExample"
|
||||
Base="ScriptCanvas::Nodeable"
|
||||
Icon="Editor/Icons/ScriptCanvas/Placeholder.png"
|
||||
Category="Tests"
|
||||
GeneratePropertyFriend="True"
|
||||
Namespace="None"
|
||||
Description="Input Method Shared Data">
|
||||
<Input Name="Append Hello" Description="" DisplayGroup="InputMethodGroup">
|
||||
<Parameter Name="str" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Return Name="Output" Type="ScriptCanvas::Data::StringType" Shared="true" DisplayGroup="InputMethodGroup"/>
|
||||
</Input>
|
||||
<Input Name="Concatenate Two" Description="" DisplayGroup="Concatenate Two">
|
||||
<Parameter Name="a" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Parameter Name="b" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Return Name="Output" Type="ScriptCanvas::Data::StringType" Shared="true" DisplayGroup="InputMethodGroup"/>
|
||||
</Input>
|
||||
<Input Name="Concatenate Three" Description="" DisplayGroup="Concatenate Three">
|
||||
<Parameter Name="a" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Parameter Name="b" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Parameter Name="c" Type="const ScriptCanvas::Data::StringType&"/>
|
||||
<Return Name="Output" Type="ScriptCanvas::Data::StringType" Shared="true" DisplayGroup="InputMethodGroup"/>
|
||||
</Input>
|
||||
</Class>
|
||||
<Class Name="BranchMethodSharedDataSlotExample"
|
||||
QualifiedName="ScriptCanvasTesting::Nodeables::BranchMethodSharedDataSlotExample"
|
||||
PreferredClassName="BranchMethodSharedDataSlotExample"
|
||||
Base="ScriptCanvas::Nodeable"
|
||||
Icon="Editor/Icons/ScriptCanvas/Placeholder.png"
|
||||
Category="Tests"
|
||||
GeneratePropertyFriend="True"
|
||||
Description="Branch Test">
|
||||
<Branch Name="String Magicbox" Description="">
|
||||
<Parameter Name="input" Type="ScriptCanvas::Data::NumberType" DefaultValue="0.0"/>
|
||||
</Branch>
|
||||
<Output Name="One String" DisplayGroup="String Magicbox">
|
||||
<Parameter Name="string" Type="ScriptCanvas::Data::StringType"/>
|
||||
</Output>
|
||||
<Output Name="Two Strings" Type="ScriptCanvas::Data::StringType" DisplayGroup="String Magicbox">
|
||||
<Parameter Name="string1" Type="ScriptCanvas::Data::StringType"/>
|
||||
<Parameter Name="string2" Type="ScriptCanvas::Data::StringType"/>
|
||||
</Output>
|
||||
<Output Name="Three Strings" Type="Data::StringType" DisplayGroup="String Magicbox">
|
||||
<Parameter Name="string1" Type="ScriptCanvas::Data::StringType"/>
|
||||
<Parameter Name="string2" Type="ScriptCanvas::Data::StringType"/>
|
||||
<Parameter Name="string3" Type="ScriptCanvas::Data::StringType"/>
|
||||
</Output>
|
||||
<Output Name="Square" Type="ScriptCanvas::Data::StringType"/>
|
||||
<Output Name="Pants" Type="ScriptCanvas::Data::StringType"/>
|
||||
<Output Name="Hello" Type="ScriptCanvas::Data::StringType" DisplayGroup="BranchExecutionGroup"/>
|
||||
</Class>
|
||||
</ScriptCanvas>
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "SharedDataSlotExample.h"
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
namespace Nodeables
|
||||
{
|
||||
AZStd::string InputMethodSharedDataSlotExample::AppendHello(const ScriptCanvas::Data::StringType& arg)
|
||||
{
|
||||
return AZStd::string::format("%sHello", arg.c_str());
|
||||
}
|
||||
|
||||
AZStd::string InputMethodSharedDataSlotExample::ConcatenateTwo(const ScriptCanvas::Data::StringType& arg1, const ScriptCanvas::Data::StringType& arg2)
|
||||
{
|
||||
return AZStd::string::format("%s%s", arg1.c_str(), arg2.c_str());
|
||||
}
|
||||
|
||||
AZStd::string InputMethodSharedDataSlotExample::ConcatenateThree(const ScriptCanvas::Data::StringType& arg1, const ScriptCanvas::Data::StringType& arg2, const ScriptCanvas::Data::StringType& arg3)
|
||||
{
|
||||
return AZStd::string::format("%s%s%s", arg1.c_str(), arg2.c_str(), arg3.c_str());
|
||||
}
|
||||
|
||||
void BranchMethodSharedDataSlotExample::StringMagicbox(int arg)
|
||||
{
|
||||
switch (arg)
|
||||
{
|
||||
case 1:
|
||||
CallOneString("Hello1");
|
||||
break;
|
||||
case 2:
|
||||
CallTwoStrings("Bob", "Hello2");
|
||||
break;
|
||||
case 3:
|
||||
CallThreeStrings("Square", "Pants", "Hello3");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ScriptCanvas/Core/Nodeable.h>
|
||||
#include <ScriptCanvas/Core/NodeableNode.h>
|
||||
#include <ScriptCanvas/CodeGen/NodeableCodegen.h>
|
||||
|
||||
#include <Source/Nodes/Nodeables/SharedDataSlotExample.generated.h>
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
namespace Nodeables
|
||||
{
|
||||
class InputMethodSharedDataSlotExample
|
||||
: public ScriptCanvas::Nodeable
|
||||
{
|
||||
SCRIPTCANVAS_NODE(InputMethodSharedDataSlotExample);
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
class BranchMethodSharedDataSlotExample
|
||||
: public ScriptCanvas::Nodeable
|
||||
{
|
||||
SCRIPTCANVAS_NODE(BranchMethodSharedDataSlotExample);
|
||||
public:
|
||||
|
||||
void StringMagicbox(int);
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScriptCanvas Include="Source/Nodes/Nodeables/ValuePointerReferenceExample.h" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Class Name="ReturnTypeExample"
|
||||
QualifiedName="ScriptCanvasTesting::Nodeables::ReturnTypeExample"
|
||||
PreferredClassName="Return Type Example"
|
||||
Base="ScriptCanvas::Nodeable"
|
||||
Icon="Editor/Icons/ScriptCanvas/Placeholder.png"
|
||||
Category="Tests"
|
||||
GeneratePropertyFriend="True"
|
||||
Namespace="None"
|
||||
Description="Example of returning by value, pointer and reference.">
|
||||
<Input Name="Return By Value" >
|
||||
<Return Name="Value" Type="AZStd::vector<ScriptCanvas::Data::NumberType>" />
|
||||
</Input>
|
||||
<Input Name="Return By Pointer" >
|
||||
<Return Name="Pointer" Type="AZStd::vector<ScriptCanvas::Data::NumberType>*" />
|
||||
</Input>
|
||||
<Input Name="Return By Reference" >
|
||||
<Return Name="Reference" Type="AZStd::vector<ScriptCanvas::Data::NumberType>&" />
|
||||
</Input>
|
||||
</Class>
|
||||
<Class Name="BranchInputTypeExample"
|
||||
QualifiedName="ScriptCanvasTesting::Nodeables::BranchInputTypeExample"
|
||||
PreferredClassName="Branch Input Type Example"
|
||||
Base="ScriptCanvas::Nodeable"
|
||||
Icon="Editor/Icons/ScriptCanvas/Placeholder.png"
|
||||
Category="Tests"
|
||||
GeneratePropertyFriend="True"
|
||||
Namespace="None"
|
||||
Description="Example of branch passing as input by value, pointer and reference.">
|
||||
<Input Name="Get Internal Vector" Description="">
|
||||
<Return Name="Result" Type="AZStd::vector<ScriptCanvas::Data::NumberType>" />
|
||||
</Input>
|
||||
<Input Name="Branches On Input Type" Description="" DisplayGroup="Branches On Input Type">
|
||||
<Parameter Name="Input Type" Type="AZStd::string" Input="True"/>
|
||||
<Branch Name="By Value" Description="" DisplayGroup="Branches On Input Type">
|
||||
<Return Name="Value Input" Type="AZStd::vector<ScriptCanvas::Data::NumberType>&" DisplayGroup="Branches On Input Type"/>
|
||||
</Branch>
|
||||
<Branch Name="By Pointer" Description="" DisplayGroup="Branches On Input Type">
|
||||
<Return Name="Pointer Input" Type="AZStd::vector<ScriptCanvas::Data::NumberType>*" DisplayGroup="Branches On Input Type"/>
|
||||
</Branch>
|
||||
</Input>
|
||||
</Class>
|
||||
<Class Name="InputTypeExample"
|
||||
QualifiedName="ScriptCanvasTesting::Nodeables::InputTypeExample"
|
||||
PreferredClassName="Input Type Example"
|
||||
Base="ScriptCanvas::Nodeable"
|
||||
Icon="Editor/Icons/ScriptCanvas/Placeholder.png"
|
||||
Category="Tests"
|
||||
GeneratePropertyFriend="True"
|
||||
Namespace="None"
|
||||
Description="Example of passing as input by value, pointer and reference.">
|
||||
<Input Name="Clear By Value" Description="">
|
||||
<Parameter Name="Value Input" Type="AZStd::vector<ScriptCanvas::Data::NumberType>" Input="True"/>
|
||||
</Input>
|
||||
<Input Name="Clear By Pointer" Description="">
|
||||
<Parameter Name="Pointer Input" Type="AZStd::vector<ScriptCanvas::Data::NumberType>*" Input="True"/>
|
||||
</Input>
|
||||
<Input Name="Clear By Reference" Description="">
|
||||
<Parameter Name="Reference Input" Type="AZStd::vector<ScriptCanvas::Data::NumberType>&" Input="True"/>
|
||||
</Input>
|
||||
</Class>
|
||||
</ScriptCanvas>
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ValuePointerReferenceExample.h"
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
namespace Nodeables
|
||||
{
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType> ReturnTypeExample::ReturnByValue()
|
||||
{
|
||||
return m_internalVector;
|
||||
}
|
||||
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType>* ReturnTypeExample::ReturnByPointer()
|
||||
{
|
||||
return &m_internalVector;
|
||||
}
|
||||
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType>& ReturnTypeExample::ReturnByReference()
|
||||
{
|
||||
return m_internalVector;
|
||||
}
|
||||
|
||||
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType> BranchInputTypeExample::GetInternalVector()
|
||||
{
|
||||
return m_internalVector;
|
||||
}
|
||||
|
||||
void BranchInputTypeExample::BranchesOnInputType(AZStd::string inputType)
|
||||
{
|
||||
if (inputType == "Value")
|
||||
{
|
||||
CallByValue(m_internalVector);
|
||||
}
|
||||
else if (inputType == "Pointer")
|
||||
{
|
||||
CallByPointer(&m_internalVector);
|
||||
}
|
||||
}
|
||||
|
||||
void InputTypeExample::ClearByValue(AZStd::vector<ScriptCanvas::Data::NumberType> input)
|
||||
{
|
||||
input.clear();
|
||||
}
|
||||
|
||||
void InputTypeExample::ClearByPointer(AZStd::vector<ScriptCanvas::Data::NumberType>* input)
|
||||
{
|
||||
if (input)
|
||||
{
|
||||
input->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void InputTypeExample::ClearByReference(AZStd::vector<ScriptCanvas::Data::NumberType>& input)
|
||||
{
|
||||
input.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ScriptCanvas/Core/Nodeable.h>
|
||||
#include <ScriptCanvas/Core/NodeableNode.h>
|
||||
#include <ScriptCanvas/CodeGen/NodeableCodegen.h>
|
||||
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
#include <Source/Nodes/Nodeables/ValuePointerReferenceExample.generated.h>
|
||||
|
||||
namespace ScriptCanvasTesting
|
||||
{
|
||||
namespace Nodeables
|
||||
{
|
||||
class ReturnTypeExample
|
||||
: public ScriptCanvas::Nodeable
|
||||
{
|
||||
SCRIPTCANVAS_NODE(ReturnTypeExample);
|
||||
|
||||
private:
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType> m_internalVector{ 1.0, 2.0, 3.0 };
|
||||
};
|
||||
|
||||
class BranchInputTypeExample
|
||||
: public ScriptCanvas::Nodeable
|
||||
{
|
||||
SCRIPTCANVAS_NODE(BranchInputTypeExample);
|
||||
|
||||
private:
|
||||
AZStd::vector<ScriptCanvas::Data::NumberType> m_internalVector{ 1.0, 2.0, 3.0 };
|
||||
};
|
||||
|
||||
|
||||
class InputTypeExample
|
||||
: public ScriptCanvas::Nodeable
|
||||
{
|
||||
SCRIPTCANVAS_NODE(InputTypeExample);
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user