#if GRAPH_DESIGNER
/// ---------------------------------------------
/// Behavior Designer
/// Copyright (c) Opsive. All Rights Reserved.
/// https://www.opsive.com
/// ---------------------------------------------
namespace Opsive.BehaviorDesigner.Runtime
{
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.GraphDesigner.Runtime;
using Opsive.Shared.Utility;
using System;
///
/// Template for creating a custom action node.
///
[Category("GameObjects")]
[DisplayName("Action")]
[Description("Create a new action node.")]
public class GameObjectActionNode : INodeTemplate
{
public Type BaseType => typeof(IAction);
public bool IsLogicNode => true;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
///
/// A custom action node.
///
public class {name} : ActionNode
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
///
/// Template for creating a custom action task.
///
[Category("GameObjects")]
[DisplayName("Stacked Action")]
[Description("Create a new stacked action node.")]
public class GameObjectAction : INodeTemplate
{
public Type BaseType => typeof(IAction);
public bool IsLogicNode => false;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
///
/// A custom action task.
///
public class {name} : Action
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
///
/// Template for creating a custom composite node.
///
[Category("GameObjects")]
[DisplayName("Composite")]
[Description("Create a new composite node.")]
public class GameObjectCompositeNode : IParentNodeTemplate
{
public Type BaseType => typeof(IComposite);
public bool IsLogicNode => true;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Composites;
///
/// A custom composite task.
///
public class {name} : CompositeNode
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
///
/// Template for creating a custom conditional node.
///
[Category("GameObjects")]
[DisplayName("Conditional")]
[Description("Create a new conditional node.")]
public class GameObjectConditionalNode : INodeTemplate
{
public Type BaseType => typeof(IConditional);
public bool IsLogicNode => true;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Conditionals;
///
/// A custom conditional node.
///
public class {name} : ConditionalNode
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
///
/// Template for creating a custom conditional task.
///
[Category("GameObjects")]
[DisplayName("Stacked Conditional")]
[Description("Create a new stacked conditional node.")]
public class GameObjectConditional : INodeTemplate
{
public Type BaseType => typeof(IConditional);
public bool IsLogicNode => false;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Conditionals;
///
/// A custom conditional task.
///
public class {name} : Conditional
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
///
/// Template for creating a custom decorator node.
///
[Category("GameObjects")]
[DisplayName("Decorator")]
[Description("Create a new decorator node.")]
public class GameObjectDecoratorNode : IParentNodeTemplate
{
public Type BaseType => typeof(IDecorator);
public bool IsLogicNode => true;
///
/// Returns the script that should be used for the template file.
///
/// The name of the node.
/// The node script.
public string GetScript(string name)
{
return $@"using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Decorators;
///
/// A custom decorator task.
///
public class {name} : DecoratorNode
{{
///
/// Executes the task.
///
/// The execution status of the task.
public override TaskStatus OnUpdate()
{{
return TaskStatus.Success;
}}
}}";
}
}
}
#endif