You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
776 B
C#
28 lines
776 B
C#
1 year ago
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Unity.VisualScripting
|
||
|
{
|
||
|
public abstract class StateTransitionAnalyser<TStateTransition> : Analyser<TStateTransition, StateTransitionAnalysis>
|
||
|
where TStateTransition : IStateTransition
|
||
|
{
|
||
|
protected StateTransitionAnalyser(GraphReference reference, TStateTransition target) : base(reference, target) { }
|
||
|
|
||
|
public TStateTransition transition => target;
|
||
|
|
||
|
[Assigns]
|
||
|
protected virtual bool IsTraversed()
|
||
|
{
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
[Assigns]
|
||
|
protected virtual IEnumerable<Warning> Warnings()
|
||
|
{
|
||
|
if (!IsTraversed())
|
||
|
{
|
||
|
yield return Warning.Info("Transition is never traversed.");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|