The Great ScriptCanvas Purge, Part IV
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -33,25 +33,6 @@ namespace TestNodes
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
|
||||
void TestResult::OnInputSignal(const ScriptCanvas::SlotId&)
|
||||
{
|
||||
auto valueDatum = FindDatum(GetSlotId("Value"));
|
||||
if (!valueDatum)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
valueDatum->ToString(m_string);
|
||||
|
||||
// technically, I should remove this, make it an object that holds a string, with an untyped slot, and this could be a local value
|
||||
if (!m_string.empty())
|
||||
{
|
||||
AZ_TracePrintf("Script Canvas", "%s\n", m_string.c_str());
|
||||
}
|
||||
|
||||
SignalOutput(GetSlotId(ScriptCanvas::CommonSlots::GeneralOutSlot::GetName()));
|
||||
}
|
||||
|
||||
void TestResult::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
@@ -105,11 +86,6 @@ namespace TestNodes
|
||||
AddSlot(ScriptCanvas::DataSlotConfiguration(Data::Type::Number(), "Get Number", ScriptCanvas::ConnectionType::Output));
|
||||
}
|
||||
|
||||
void ContractNode::OnInputSignal(const ScriptCanvas::SlotId&)
|
||||
{
|
||||
SignalOutput(GetSlotId(ScriptCanvas::CommonSlots::GeneralOutSlot::GetName()));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
void InfiniteLoopNode::Reflect(AZ::ReflectContext* reflection)
|
||||
{
|
||||
@@ -121,11 +97,6 @@ namespace TestNodes
|
||||
}
|
||||
}
|
||||
|
||||
void InfiniteLoopNode::OnInputSignal(const ScriptCanvas::SlotId&)
|
||||
{
|
||||
SignalOutput(GetSlotId("Before Infinity"));
|
||||
}
|
||||
|
||||
void InfiniteLoopNode::OnInit()
|
||||
{
|
||||
AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot());
|
||||
@@ -159,13 +130,6 @@ namespace TestNodes
|
||||
AddSlot(slotConfiguration);
|
||||
}
|
||||
|
||||
void UnitTestErrorNode::OnInputSignal(const ScriptCanvas::SlotId&)
|
||||
{
|
||||
SCRIPTCANVAS_REPORT_ERROR((*this), "Unit test error!");
|
||||
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AddNodeWithRemoveSlot::Reflect(AZ::ReflectContext* reflection)
|
||||
@@ -205,30 +169,6 @@ namespace TestNodes
|
||||
return Node::RemoveSlot(slotId, true, emitWarning);
|
||||
}
|
||||
|
||||
void AddNodeWithRemoveSlot::OnInputSignal(const ScriptCanvas::SlotId& slotId)
|
||||
{
|
||||
if (slotId == GetSlotId("In"))
|
||||
{
|
||||
ScriptCanvas::Data::NumberType result{};
|
||||
for (const ScriptCanvas::SlotId& dynamicSlotId : m_dynamicSlotIds)
|
||||
{
|
||||
if (auto numberInput = FindDatum(dynamicSlotId))
|
||||
{
|
||||
if (auto argValue = numberInput->GetAs<ScriptCanvas::Data::NumberType>())
|
||||
{
|
||||
result += *argValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto resultType = GetSlotDataType(m_resultSlotId);
|
||||
EXPECT_TRUE(resultType.IsValid());
|
||||
ScriptCanvas::Datum output(result);;
|
||||
PushOutput(output, *GetSlot(m_resultSlotId));
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
}
|
||||
|
||||
void AddNodeWithRemoveSlot::OnInit()
|
||||
{
|
||||
Node::AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot());
|
||||
@@ -290,28 +230,6 @@ namespace TestNodes
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void StringView::OnInputSignal(const ScriptCanvas::SlotId&)
|
||||
{
|
||||
auto viewDatum = FindDatum(GetSlotId("View"));
|
||||
|
||||
if (!viewDatum)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ScriptCanvas::Data::StringType result;
|
||||
viewDatum->ToString(result);
|
||||
|
||||
ScriptCanvas::Datum output(result);
|
||||
auto resultSlot = GetSlot(m_resultSlotId);
|
||||
if (resultSlot)
|
||||
{
|
||||
PushOutput(output, *resultSlot);
|
||||
}
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
|
||||
void StringView::Reflect(AZ::ReflectContext* context)
|
||||
{
|
||||
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
|
||||
@@ -354,36 +272,6 @@ namespace TestNodes
|
||||
return addedSlotId;
|
||||
}
|
||||
|
||||
|
||||
void InsertSlotConcatNode::OnInputSignal(const ScriptCanvas::SlotId& slotId)
|
||||
{
|
||||
if (slotId == GetSlotId(ScriptCanvas::CommonSlots::GeneralInSlot::GetName()))
|
||||
{
|
||||
ScriptCanvas::Data::StringType result{};
|
||||
|
||||
for (const ScriptCanvas::Slot* concatSlot : GetAllSlotsByDescriptor(ScriptCanvas::SlotDescriptors::DataIn()))
|
||||
{
|
||||
if (auto inputDatum = FindDatum(concatSlot->GetId()))
|
||||
{
|
||||
ScriptCanvas::Data::StringType stringArg;
|
||||
if (inputDatum->ToString(stringArg))
|
||||
{
|
||||
result += stringArg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto resultSlotId = GetSlotId("Result");
|
||||
auto resultType = GetSlotDataType(resultSlotId);
|
||||
EXPECT_TRUE(resultType.IsValid());
|
||||
if (auto resultSlot = GetSlot(resultSlotId))
|
||||
{
|
||||
PushOutput(ScriptCanvas::Datum(result), *resultSlot);
|
||||
}
|
||||
SignalOutput(GetSlotId("Out"));
|
||||
}
|
||||
}
|
||||
|
||||
void InsertSlotConcatNode::OnInit()
|
||||
{
|
||||
Node::AddSlot(ScriptCanvas::CommonSlots::GeneralInSlot());
|
||||
|
||||
@@ -32,7 +32,6 @@ namespace TestNodes
|
||||
protected:
|
||||
|
||||
void OnInit() override;
|
||||
void OnInputSignal(const ScriptCanvas::SlotId&) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -49,9 +48,6 @@ namespace TestNodes
|
||||
|
||||
void OnInit() override;
|
||||
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const ScriptCanvas::SlotId&) override;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -64,9 +60,6 @@ namespace TestNodes
|
||||
static void Reflect(AZ::ReflectContext* reflection);
|
||||
|
||||
protected:
|
||||
|
||||
void OnInputSignal(const ScriptCanvas::SlotId&) override;
|
||||
|
||||
void OnInit() override;
|
||||
|
||||
};
|
||||
@@ -84,8 +77,6 @@ namespace TestNodes
|
||||
|
||||
void OnInit() override;
|
||||
|
||||
void OnInputSignal(const ScriptCanvas::SlotId&) override;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -101,8 +92,6 @@ namespace TestNodes
|
||||
bool RemoveSlot(const ScriptCanvas::SlotId& slotId, bool emitWarning = true);
|
||||
|
||||
protected:
|
||||
void OnInputSignal(const ScriptCanvas::SlotId& slotId) override;
|
||||
|
||||
void OnInit() override;
|
||||
|
||||
AZStd::vector<ScriptCanvas::SlotId> m_dynamicSlotIds;
|
||||
@@ -120,8 +109,6 @@ namespace TestNodes
|
||||
|
||||
void OnInit() override;
|
||||
|
||||
void OnInputSignal(const ScriptCanvas::SlotId&) override;
|
||||
|
||||
public:
|
||||
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
@@ -141,9 +128,7 @@ namespace TestNodes
|
||||
ScriptCanvas::SlotId InsertSlot(AZ::s64 index, AZStd::string_view slotName);
|
||||
|
||||
protected:
|
||||
void OnInputSignal(const ScriptCanvas::SlotId& slotId) override;
|
||||
|
||||
void OnInit() override;
|
||||
void OnInit() override;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -69,23 +69,6 @@ namespace ScriptCanvasTests
|
||||
return GetTestNode<t_NodeType>(scriptCanvasId, entityOut);
|
||||
}
|
||||
|
||||
ScriptCanvas::Node* CreateDataNodeByType(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const ScriptCanvas::Data::Type& type, AZ::EntityId& nodeIDout);
|
||||
|
||||
template<typename t_Value>
|
||||
ScriptCanvas::Node* CreateDataNode(const ScriptCanvas::ScriptCanvasId& scriptCanvasId, const t_Value& value, AZ::EntityId& nodeIDout)
|
||||
{
|
||||
using namespace ScriptCanvas;
|
||||
const Data::Type operandType = Data::FromAZType(azrtti_typeid<t_Value>());
|
||||
Node* node = CreateDataNodeByType(scriptCanvasId, operandType, nodeIDout);
|
||||
|
||||
EXPECT_NE(node, nullptr);
|
||||
if (node)
|
||||
{
|
||||
node->SetInput_UNIT_TEST("Set", value);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
template<typename t_Value>
|
||||
ScriptCanvas::VariableId CreateVariable(ScriptCanvas::ScriptCanvasId scriptCanvasId, const t_Value& value, AZStd::string_view variableName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user