BJPFRYFI5KVAI42IEJVGNED7VUD3NORVB2NUWCMRCQVUNRJZOHHAC
fileFormatVersion: 2
guid: 259dc52e6d449ec46834c180bce42a18
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 844f2211c024f444f876e89a2321a495
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
[StepType(StepTypeAttribute.SetterStep)]
public class PawnResourceSet : OutputStep<bool>
{
[UnityEngine.SerializeField]
SinglePort<IEnumerable<double>> _in = new();
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]
public CareBoo.Serially.SerializableType? Resource;
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() {
var resourceName = Resource == null || Resource.Type == null ? "*" : Resource.Type.Name;
var statName = "Current";
return $"Pawn.Set.{resourceName}.{statName}";
}
public override bool IsValid {
get {
return Resource != null && Resource.Type != null;
}
}
public override bool Run(EffectInput blackBoard) {
if (!IsValid || Resource == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return false;
}
var getSpecificMethod = typeof(PawnResourceSet).GetMethod(nameof(SetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).
MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0]);
var value = getSpecificMethod.Invoke(this, new object[] { blackBoard });
return (bool)value;
}
bool SetSpecific<TResource, TUnitType>(EffectInput Data)
where TResource : Resources.Resource<TUnitType>
where TUnitType : Resources.IUnitType {
var success = false;
if (_in.Node != null) {
var result = _in.Node.Run(Data);
UnityEngine.Debug.Log($"{nameof(PawnResourceSet)} result {string.Join(",", result)}");
var set = result.Zip(Data.Affected.Select(transform => transform.GetComponent<TResource>()), (value, resource) => (value, resource));
foreach (var (value, resource) in set) {
Data.StatAccessor.AddCurrentModifier(resource, (Resources.Unit<TUnitType>)value);
}
success = true;
}
return success;
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Resource = Resource;
// effectStepNodeData.Register = Register;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
Resource = effectStepNodeData.Resource;
// Register = effectStepNodeData.Register;
return true;
}
}
}
fileFormatVersion: 2
guid: 95498ab7ed723494fb6b3c000a0f1c35
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Reflection;
using TagFighter.Effects.ResourceLocationAccessors.ContextRegisters;
[StepType(StepTypeAttribute.SetterStep)]
public class ContextResourceSet : OutputStep<bool>
{
[UnityEngine.SerializeField]
SinglePort<double> _in = new();
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]
public CareBoo.Serially.SerializableType? Resource;
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(ContextRegister<>))]
public CareBoo.Serially.SerializableType? Register;
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() {
var resourceName = Resource == null || Resource.Type == null ? "*" : Resource.Type.Name;
var registerName = Register == null || Register.Type == null ? "*" : Register.Type.Name;
return $"Context.Set.{resourceName}.{registerName}";
}
public override bool IsValid {
get {
return Register != null && Register.Type != null && Resource != null && Resource.Type != null;
}
}
public override bool Run(EffectInput Data) {
if (!IsValid || Resource == null || Register == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return false;
}
var getSpecificMethod = typeof(ContextResourceSet).GetMethod(nameof(SetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).
MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0], Register.Type);
var value = getSpecificMethod.Invoke(this, new object[] { Data });
return (bool)value;
}
bool SetSpecific<TResource, TUnitType, TContextRegister>(EffectInput blackBoard)
where TResource : Resources.Resource<TUnitType>
where TUnitType : Resources.IUnitType
where TContextRegister : IContextRegister {
var result = (_in.Node != null) ? _in.Node.Run(blackBoard) : default;
var success = false;
if (blackBoard != null) {
blackBoard.Context.SetResource<TResource, TUnitType, TContextRegister>((Resources.Unit<TUnitType>)result);
success = true;
}
return success;
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Resource = Resource;
effectStepNodeData.Register = Register;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
Resource = effectStepNodeData.Resource;
Register = effectStepNodeData.Register;
return true;
}
}
}
fileFormatVersion: 2
guid: 81d788b04f027ce4080f0b8736d97a71
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
[StepType(StepTypeAttribute.SetterStep)]
public class ContextAreaSet : OutputStep<bool>
{
[UnityEngine.SerializeField]
SinglePort<IAreaOfEffect> _in = new();
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() => "Context.AOE.Set";
public override bool IsValid => true;
public override bool Run(EffectInput blackBoard) {
var success = false;
if (_in.Node != null) {
blackBoard.Context.AreaOfEffect = _in.Node.Run(blackBoard);
success = true;
}
return success;
}
}
}
fileFormatVersion: 2
guid: aa92706ca74ef50449c7f821306aebb4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bfce83ffec5b7b14a85ec10ce4e193ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
using CareBoo.Serially;
[StepType(StepTypeAttribute.OperatorStep)]
public class Zip : OutputStep<IEnumerable<double>>
{
[UnityEngine.SerializeField]
MultiPort<IEnumerable<double>> _in = new();
[UnityEngine.SerializeReference, ShowSerializeReference]
public IResourceOperator? Operator;
[UnityEngine.SerializeField]
List<double> _const = new();
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public static IEnumerable<double> GetDefault(EffectInput blackBoard) {
double defaultVal = 0;
return blackBoard.Affected.Select(transform => defaultVal);
}
public override IEnumerable<double> Run(EffectInput blackBoard) {
if (!IsValid || Operator == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return GetDefault(blackBoard);
}
return _in.Nodes.Select(getter => getter.Run(blackBoard)).Concat(_const.Select(value => blackBoard.Affected.Select(transform => value)))
.DefaultIfEmpty(GetDefault(blackBoard))
.Aggregate((current, next) =>
current.Zip(next, (first, second) =>
Operator.Operate(first, second)));
}
public override string ToString() {
var operatorName = Operator == null ? "*" : Operator.GetType().Name;
var constName = _const.Count == 0 ? "" : $"({string.Join(",", _const.Select(val => $"{val}[]"))})";
return $"Zip.{operatorName}{constName}";
}
public override bool IsValid => Operator != null;
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Const = _const;
effectStepNodeData.Operator = Operator;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
_const = effectStepNodeData.Const ?? new();
Operator = effectStepNodeData.Operator;
return true;
}
}
}
fileFormatVersion: 2
guid: bb9a9a2cce40a384084a18925a111186
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
[StepType(StepTypeAttribute.OperatorStep)]
public class Repeat : OutputStep<IEnumerable<double>>
{
[UnityEngine.SerializeField]
SinglePort<double> _in = new();
public override IEnumerable<double> Run(EffectInput blackBoard) {
var value = _in.Node != null ? _in.Node.Run(blackBoard) : default;
return blackBoard.Affected.Select(transform => value);
}
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() => "Repeat";
public override bool IsValid => true;
}
}
fileFormatVersion: 2
guid: 93ba90a75f8f1fe4189ea1ed3890ae3e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
[StepType(StepTypeAttribute.OperatorStep)]
public class Operate : OutputStep<double>
{
[UnityEngine.SerializeField]
MultiPort<double> _in = new();
[UnityEngine.SerializeReference, CareBoo.Serially.ShowSerializeReference]
public IResourceOperator? Operator;
[UnityEngine.SerializeField]
List<double> _const = new();
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() {
var operatorName = Operator == null ? "*" : Operator.GetType().Name;
var constName = _const.Count == 0 ? "" : $"({string.Join(",", _const)})";
return $"{operatorName}{constName}";
}
public override bool IsValid => Operator != null;
public override double Run(EffectInput blackBoard) {
if (!IsValid || Operator == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return default;
}
var result = Operator.OperateEnum(_in.Nodes.Select(getter => getter.Run(blackBoard)).Concat(_const));
return result;
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Const = _const;
effectStepNodeData.Operator = Operator;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
_const = effectStepNodeData.Const ?? new();
Operator = effectStepNodeData.Operator;
return true;
}
}
}
fileFormatVersion: 2
guid: ba8070acc07ec7f448050fe3c5cd4278
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
[StepType(StepTypeAttribute.OperatorStep)]
public class Fold : OutputStep<double>
{
[UnityEngine.SerializeField]
SinglePort<IEnumerable<double>> _in = new();
[UnityEngine.SerializeReference, CareBoo.Serially.ShowSerializeReference]
public IResourceOperator? Operator;
public double GetDefault() {
const double DefaultVal = 0;
return DefaultVal;
}
public override double Run(EffectInput blackBoard) {
if (!IsValid || Operator == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return GetDefault();
}
if (_in.Node == null) {
return GetDefault();
}
return _in.Node.Run(blackBoard).DefaultIfEmpty(GetDefault()).Aggregate((current, next) => Operator.Operate(current, next));
}
public override IEnumerable<IPort> Inputs {
get {
yield return _in;
}
}
public override string ToString() {
var operatorName = Operator == null ? "*" : Operator.GetType().Name;
return $"Fold.{operatorName}";
}
public override bool IsValid => Operator != null;
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Operator = Operator;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
Operator = effectStepNodeData.Operator;
return true;
}
}
}
fileFormatVersion: 2
guid: 9a2104784935c934e80ee24cba8dd3cf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9aba2983d5b304644a37facc1967f5de
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
[StepType(StepTypeAttribute.GetterStep)]
public class PawnResourceGet : OutputStep<IEnumerable<double>>
{
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]
public CareBoo.Serially.SerializableType? Resource;
public override IEnumerable<double> Run(EffectInput blackBoard) {
if (!IsValid || Resource == null) {
UnityEngine.Debug.Log($"{Guid} Inner types are null");
return blackBoard.Affected.Select(transform => 0d);
}
var getSpecificMethod = typeof(PawnResourceGet).GetMethod(nameof(GetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).
MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0]);
var value = getSpecificMethod.Invoke(this, new object[] { blackBoard });
return (IEnumerable<double>)value;
}
IEnumerable<double> GetSpecific<TResource, TUnitType>(EffectInput blackBoard)
where TResource : Resources.Resource<TUnitType>
where TUnitType : Resources.IUnitType {
return blackBoard.Affected.Select(transform => (double)transform.GetComponent<TResource>().GetCurrent().AsPrimitive());
}
public override IEnumerable<IPort> Inputs => Enumerable.Empty<IPort>();
public override string ToString() {
var resourceName = Resource == null || Resource.Type == null ? "*" : Resource.Type.Name;
var statName = "Current";
return $"Pawn.Get.{resourceName}.{statName}";
}
public override bool IsValid {
get {
return Resource != null && Resource.Type != null;
}
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Resource = Resource;
// effectStepNodeData.Register = Register;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
Resource = effectStepNodeData.Resource;
// Register = effectStepNodeData.Register;
return true;
}
}
}
fileFormatVersion: 2
guid: f4cad4d5d3585fd4b81d7232454ed130
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
[StepType(StepTypeAttribute.GetterStep)]
public class PathAreaGet : OutputStep<IAreaOfEffect>
{
[UnityEngine.SerializeField]
SinglePort<double> _width = new() {
DisplayName = "Width"
};
[UnityEngine.SerializeField]
SinglePort<double> _length = new() {
DisplayName = "Length"
};
public override IEnumerable<IPort> Inputs {
get {
yield return _width;
yield return _length;
}
}
public override string ToString() => "Circle AOE";
public override IAreaOfEffect Run(EffectInput blackBoard) => new PathArea() {
Width = (float)(_width.Node != null ? _width.Node.Run(blackBoard) : default),
Length = (float)(_length.Node != null ? _length.Node.Run(blackBoard) : default),
};
public override bool IsValid => true;
}
}
fileFormatVersion: 2
guid: c5c37fc06b3d0ad45b6305eb93d68542
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
using TagFighter.Effects.ResourceLocationAccessors.ContextRegisters;
[StepType(StepTypeAttribute.GetterStep)]
public class ContextResourceGet : OutputStep<double>
{
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(Resources.Resource<>))]
public CareBoo.Serially.SerializableType? Resource;
[CareBoo.Serially.TypeFilter(derivedFrom: typeof(ContextRegister<>))]
public CareBoo.Serially.SerializableType? Register;
public override double Run(EffectInput blackBoard) {
if (!IsValid || Register == null || Resource == null) {
UnityEngine.Debug.LogError($"{Guid} Inner types are null");
return 0;
}
var getSpecificMethod = typeof(ContextResourceGet).GetMethod(nameof(GetSpecific), BindingFlags.NonPublic | BindingFlags.Instance).
MakeGenericMethod(Resource.Type, Resource.Type.BaseType.GetGenericArguments()[0], Register.Type);
var value = getSpecificMethod.Invoke(this, new object[] { blackBoard });
return (int)value;
}
public double Test(EffectInput[] Data) {
return 0;
}
int GetSpecific<TResource, TUnitType, TContextRegister>(EffectInput blackBoard)
where TResource : Resources.Resource<TUnitType>
where TUnitType : Resources.IUnitType
where TContextRegister : IContextRegister {
return blackBoard != null ? blackBoard.Context.GetResource<TResource, TUnitType, TContextRegister>().AsPrimitive() : 0;
}
public override IEnumerable<IPort> Inputs => Enumerable.Empty<IPort>();
public override string ToString() {
var resourceName = Resource == null || Resource.Type == null ? "*" : Resource.Type.Name;
var registerName = Register == null || Register.Type == null ? "*" : Register.Type.Name;
return $"Context.Get.{resourceName}.{registerName}";
}
public override bool IsValid {
get {
return Register != null && Register.Type != null && Resource != null && Resource.Type != null;
}
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Resource = Resource;
effectStepNodeData.Register = Register;
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
Resource = effectStepNodeData.Resource;
Register = effectStepNodeData.Register;
return true;
}
}
}
fileFormatVersion: 2
guid: c419ef0e55c3e694cb24080375e68c2e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
using System.Linq;
[StepType(StepTypeAttribute.GetterStep)]
public class ConstValue : OutputStep<double>
{
[UnityEngine.SerializeField]
double _value;
public override double Run(EffectInput blackBoard) {
return _value;
}
public override IEnumerable<IPort> Inputs => Enumerable.Empty<IPort>();
public override string ToString() {
return $"Const {_value}";
}
public override EffectStepNodeData ToData() {
var effectStepNodeData = base.ToData();
effectStepNodeData.Const = new() { _value };
return effectStepNodeData;
}
public override bool FromData(EffectStepNodeData effectStepNodeData, Dictionary<string, EffectStepNode> guidToNode) {
base.FromData(effectStepNodeData, guidToNode);
_value = effectStepNodeData.Const != null ? effectStepNodeData.Const.FirstOrDefault() : default;
return true;
}
public override bool IsValid => true;
}
}
fileFormatVersion: 2
guid: e3d165e54b32e6d4cbcc75c5b0cf7a68
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
[StepType(StepTypeAttribute.GetterStep)]
public class ConeAreaGet : OutputStep<IAreaOfEffect>
{
[UnityEngine.SerializeField]
SinglePort<double> _radius = new() {
DisplayName = "Radius"
};
[UnityEngine.SerializeField]
SinglePort<double> _angle = new() {
DisplayName = "Angle"
};
public override IEnumerable<IPort> Inputs {
get {
yield return _radius;
yield return _angle;
}
}
public override string ToString() => "Cone AOE";
public override bool IsValid => true;
public override IAreaOfEffect Run(EffectInput blackBoard) {
return new ConeArea() {
Radius = (float)(_radius.Node != null ? _radius.Node.Run(blackBoard) : default),
Angle = (float)(_angle.Node != null ? _angle.Node.Run(blackBoard) : default),
};
}
}
}
fileFormatVersion: 2
guid: 05c74f9724c88004184e3074359893c6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
#nullable enable
namespace TagFighter.Effects.Steps
{
using System.Collections.Generic;
[StepType(StepTypeAttribute.GetterStep)]
public class CircleAreaGet : OutputStep<IAreaOfEffect>
{
[UnityEngine.SerializeField]
SinglePort<double> _radius = new() {
DisplayName = "Radius"
};
public override IEnumerable<IPort> Inputs {
get {
yield return _radius;
}
}
public override string ToString() => "Circle AOE";
public override IAreaOfEffect Run(EffectInput blackBoard) => new CircleArea() {
Radius = (float)(_radius.Node != null ? _radius.Node.Run(blackBoard) : default),
};
public override bool IsValid => true;
}
}