MXJSRSMICXTOT4Z7VTPQPDBUB55KOYRE7DEUH2LNFK6N45TEA6BQC
fileFormatVersion: 2
guid: 91d5cfecee77dab4787e05ac7a8f0c9d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
public interface ITimeContext
{
int CurrentIdx { get; set; }
float CurrentTime { get; set; }
float LastTime { get; set; }
}
public class TimeContext : ITimeContext
{
public int CurrentIdx { get; set; }
public float CurrentTime { get; set; }
public float LastTime { get; set; }
}
public interface ITimeContextContainer
{
ITimeContext GetTimeContext<T>();
}
public class TimeContextContainer : ITimeContextContainer
{
Dictionary<Type, ITimeContext> _store = new();
public TimeContextContainer(params Type[] types) {
foreach (var t in types) {
_store[t] = new TimeContext();
}
}
public ITimeContext GetTimeContext<T>() {
return _store[typeof(T)];
}
}
fileFormatVersion: 2
guid: d8460d20d4b758840bd820d17f09eb4f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
public class SequenceRunContext : ISequenceRunContextContainer
{
public float CurrentTime { get; set; }
public float LastRunTime { get; set; }
public int CurrentIdx { get; set; }
public SequenceRunContext GetRunContext(string sequenceType) { return this; }
}
public class SequenceRunContextContainer : ISequenceRunContextContainer
{
SequenceRunContext _matrialContext = new();
SequenceRunContext _runeWeaveContext = new();
public SequenceRunContext GetRunContext(string sequenceType) {
return sequenceType switch {
nameof(MartialSequence) => _matrialContext,
nameof(RuneBindingSequence) => _runeWeaveContext,
_ => throw new KeyNotFoundException(),
};
}
}
public interface ISequenceRunContextContainer
{
SequenceRunContext GetRunContext(string sequenceType);
}