B:BD[
3.5096] → [
3.5097:5147]
B:BD[
3.5147] → [
4.10659:10684]
∅:D[
4.10684] → [
3.5147:5196]
B:BD[
3.5147] → [
3.5147:5196]
B:BD[
3.5198] → [
3.5198:5200]
B:BD[
3.5200] → [
5.4511:4567]
∅:D[
5.4567] → [
3.5230:5233]
B:BD[
3.5230] → [
3.5230:5233]
B:BD[
3.5233] → [
5.4568:4600]
∅:D[
5.4600] → [
3.5306:5313]
∅:D[
4.10708] → [
3.5306:5313]
B:BD[
3.5306] → [
3.5306:5313]
B:BD[
3.5313] → [
4.10709:11377]
∅:D[
4.11377] → [
6.3879:3890]
B:BD[
6.3879] → [
6.3879:3890]
∅:D[
6.3890] → [
3.5548:5550]
B:BD[
3.5548] → [
3.5548:5550]
B:BD[
3.5550] → [
4.11378:12090]
∅:D[
4.12090] → [
6.4180:4191]
B:BD[
6.4180] → [
6.4180:4191]
B:BD[
6.4191] → [
5.4601:4608]
∅:D[
6.4191] → [
3.5805:5807]
∅:D[
5.4608] → [
3.5805:5807]
B:BD[
3.5805] → [
3.5805:5807]
B:BD[
3.5807] → [
5.4609:4745]
∅:D[
5.4745] → [
4.12114:12125]
B:BD[
4.12114] → [
4.12114:12125]
B:BD[
4.12125] → [
5.4746:4804]
B:BD[
5.4804] → [
7.19051:19098]
∅:D[
7.19098] → [
8.16001:16086]
B:BD[
5.4844] → [
8.16001:16086]
∅:D[
8.16086] → [
5.4967:5061]
B:BD[
5.4967] → [
5.4967:5061]
B:BD[
5.5061] → [
8.16087:16157]
∅:D[
5.5126] → [
4.12728:12743]
∅:D[
8.16157] → [
4.12728:12743]
B:BD[
4.12728] → [
4.12728:12743]
B:BD[
4.12743] → [
5.5127:5212]
∅:D[
5.5212] → [
6.4417:4428]
∅:D[
4.12743] → [
6.4417:4428]
B:BD[
6.4417] → [
6.4417:4428]
B:BD[
6.4428] → [
5.5213:5220]
∅:D[
6.4428] → [
3.6192:6194]
∅:D[
5.5220] → [
3.6192:6194]
B:BD[
3.6192] → [
3.6192:6194]
B:BD[
3.6194] → [
5.5221:5359]
∅:D[
5.5359] → [
4.12767:12778]
B:BD[
4.12767] → [
4.12767:12778]
B:BD[
4.12778] → [
5.5360:5418]
B:BD[
5.5418] → [
7.19099:19146]
∅:D[
6.4727] → [
3.6447:6449]
∅:D[
5.5458] → [
3.6447:6449]
∅:D[
4.12976] → [
3.6447:6449]
∅:D[
7.19146] → [
3.6447:6449]
B:BD[
3.6447] → [
3.6447:6449]
B:BD[
3.6449] → [
5.5459:5562]
∅:D[
5.5562] → [
3.6519:6521]
∅:D[
4.13088] → [
3.6519:6521]
B:BD[
3.6519] → [
3.6519:6521]
B:BD[
3.6521] → [
8.16158:16256]
∅:D[
8.16256] → [
5.5699:5793]
B:BD[
5.5699] → [
5.5699:5793]
B:BD[
5.5793] → [
8.16257:16347]
∅:D[
8.16347] → [
5.5878:5893]
B:BD[
5.5878] → [
5.5878:5893]
∅:D[
6.4966] → [
3.6836:6838]
∅:D[
5.5893] → [
3.6836:6838]
∅:D[
4.13439] → [
3.6836:6838]
B:BD[
3.6836] → [
3.6836:6838]
B:BD[
3.6838] → [
5.5894:5977]
∅:D[
5.5977] → [
6.5256:5267]
∅:D[
4.13542] → [
6.5256:5267]
B:BD[
6.5256] → [
6.5256:5267]
B:BD[
3.7160] → [
3.7160:7168]
using System;
using System.Collections.Generic;
using CareBoo.Serially;
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects.ResourceLocationAccessors
{
namespace ContextRegisters
{
[Serializable] public sealed class Current : ContextRegister<Current> { }
[Serializable] public sealed class Added : ContextRegister<Added> { }
[Serializable] public sealed class Removed : ContextRegister<Removed> { }
public interface IContextRegister
{
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectContext context)
where TResource : Resource<TUnit>
where TUnit : IUnitType;
public void Set<TResource, TUnit>(EffectContext context, Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnitType;
}
public class ContextRegister<TRegister> : IContextRegister
{
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectContext context)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
yield return context.GetResource<TResource, TUnit, TRegister>();
}
public void Set<TResource, TUnit>(EffectContext context, Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
context.SetResource<TResource, TUnit, TRegister>(value);
}
public override string ToString() => typeof(TRegister).Name;
}
}
namespace Get
{
using ContextRegisters;
[Serializable]
public class Context : IResourceLocationGet
{
[SerializeReference, ShowSerializeReference]
public IContextRegister Register;
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectInput data)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
return Register.Get<TResource, TUnit>(data.Context);
}
public override string ToString() => $"{nameof(Context)}.{Register}";
}
}
namespace Set
{
using ContextRegisters;
[Serializable]
public class Context : IResourceLocationSet
{
[SerializeReference, ShowSerializeReference]
public IContextRegister Register;
[SerializeReference, ShowSerializeReference]
public IResourceOperator SetAs;
public void Set<TResource, TUnit>(EffectInput data, IEnumerable<Unit<TUnit>> values)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
Register.Set<TResource, TUnit>(data.Context, SetAs.OperateEnum(values));
}
public override string ToString() => $"{nameof(Context)}.{Register}";
}
}
}
using System;
using System.Collections.Generic;
using CareBoo.Serially;
using TagFighter.Resources;
using UnityEngine;
namespace TagFighter.Effects.ResourceLocationAccessors
{
namespace ContextRegisters
{
public interface IRegisterType { }
[Serializable] public sealed class Current : IRegisterType { }
[Serializable] public sealed class Added : IRegisterType { }
[Serializable] public sealed class Removed : IRegisterType { }
public interface IContextRegister
{
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectContext context)
where TResource : Resource<TUnit>
where TUnit : IUnitType;
public void Set<TResource, TUnit>(EffectContext context, Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnitType;
}
public class ContextRegister<TRegisterType> : IContextRegister where TRegisterType : IRegisterType
{
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectContext context)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
yield return context.GetResource<TResource, TUnit, TRegisterType>();
}
public void Set<TResource, TUnit>(EffectContext context, Unit<TUnit> value)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
context.SetResource<TResource, TUnit, TRegisterType>(value);
}
public override string ToString() => typeof(TRegisterType).Name;
}
}
namespace Get
{
using ContextRegisters;
[Serializable]
public class Context : IResourceLocationGet
{
[SerializeReference, ShowSerializeReference]
public IContextRegister Register;
public IEnumerable<Unit<TUnit>> Get<TResource, TUnit>(EffectInput data)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
return Register.Get<TResource, TUnit>(data.Context);
}
public override string ToString() => $"{nameof(Context)}.{Register}";
}
}
namespace Set
{
using ContextRegisters;
[Serializable]
public class Context : IResourceLocationSet
{
[SerializeReference, ShowSerializeReference]
public IContextRegister Register;
[SerializeReference, ShowSerializeReference]
public IResourceOperator SetAs;
public void Set<TResource, TUnit>(EffectInput data, IEnumerable<Unit<TUnit>> values)
where TResource : Resource<TUnit>
where TUnit : IUnitType {
Register.Set<TResource, TUnit>(data.Context, SetAs.OperateEnum(values));
}
public override string ToString() => $"{nameof(Context)}.{Register}";
}
}
}