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D6G7VTJJS7U2R7XQC
ROTMK5LNNK7T5YXVOMUODVMCQWIHPZYOME4WDIAMZJ4VXD7SOEBAC
CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC
7BZ73FLUK5ANK44V7EMAROTHHVE2IGJ65GTA26DRWY65566HMNPAC
HXTSBPAP75A7EC4RKWYQMVPPHPNZFPHUORBZWDHGEB6MPAGI7G7AC
var isAdvanced = _runeWeaving.RuneWeaving.Advance(_context, Time.deltaTime);
stateToReturn = new State(isAdvanced, CompletionStatus(), false, _runeWeaving.RuneWeaving.GetCurrentMove());
var isAdvanced = _runeWeaving.RuneWeaving.Advance(_timeContextContainer, _context, Time.deltaTime);
stateToReturn = new State(isAdvanced, CompletionStatus(), false, _runeWeaving.RuneWeaving.GetCurrentMove(_timeContextContainer));
stateToReturn = new State(false, CompletionStatus(), stateToReturn.IsMoving, _runeWeaving.RuneWeaving.GetCurrentMove());
stateToReturn = new State(false, CompletionStatus(), stateToReturn.IsMoving, _runeWeaving.RuneWeaving.GetCurrentMove(_timeContextContainer));
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);
}
public RuneWeavingContainer(RuneWeavingContainer toCopy, Transform caster, Transform target) {
RuneWeaving = new RuneWeaving(toCopy.RuneWeaving.MartialSequence.GetSequence(), toCopy.RuneWeaving.RuneBindingSequence.GetSequence(), caster, target);
public RuneWeavingContainer(RuneWeavingContainer toCopy) {
RuneWeaving = new RuneWeaving(toCopy.RuneWeaving.MartialSequence.GetSequence(), toCopy.RuneWeaving.RuneBindingSequence.GetSequence());
public bool Advance(EffectContext context, float deltaTime) {
var isAdvanced = MartialSequence.Advance(context, deltaTime);
RuneBindingSequence.Advance(context, deltaTime);
public bool Advance(ITimeContextContainer timeContextContainer, EffectContext effectContext, float deltaTime) {
var isAdvanced = MartialSequence.Advance(timeContextContainer, effectContext, deltaTime);
RuneBindingSequence.Advance(timeContextContainer, effectContext, deltaTime);
public CombatMove GetCurrentMove() {
return MartialSequence.GetCurrentMove();
public CombatMove GetCurrentMove(ITimeContextContainer timeContextContainer) {
return MartialSequence.GetCurrentMove(timeContextContainer);
public float CompletionStatus() {
return MartialSequence.CompletionStatus();
public float CompletionStatus(ITimeContextContainer timeContextContainer) {
return MartialSequence.CompletionStatus(timeContextContainer);
}
public ITimeContextContainer CreateTimeContexts() {
return new TimeContextContainer(typeof(RuneBindingSequence), typeof(MartialSequence));
float _currentTime;
float _lastRuneTime;
int _currentRuneIdx;
public RuneBindingSequence(IEnumerable<RuneRef> runeSequence, Transform caster, Transform target) {
public RuneBindingSequence(IEnumerable<RuneRef> runeSequence) {
public bool Advance(EffectContext context, float deltaTime) {
if (_currentRuneIdx >= _runeRefs.Count) {
public bool Advance(ITimeContextContainer timeContextContainer, EffectContext effectContext, float deltaTime) {
var timeContext = timeContextContainer.GetTimeContext<RuneBindingSequence>();
if (timeContext.CurrentIdx >= _runeRefs.Count) {
_currentTime += deltaTime;
while ((_currentRuneIdx < _runeRefs.Count) && (_currentTime - _lastRuneTime >= _runeRefs[_currentRuneIdx].Rune.Speed)) {
Debug.Log($"Finished executing {_runeRefs[_currentRuneIdx].name} - {_currentRuneIdx + 1}/{_runeRefs.Count} at {_currentTime} ");
_runeRefs[_currentRuneIdx].Rune.Cast(context);
_lastRuneTime += _runeRefs[_currentRuneIdx].Rune.Speed;
_currentRuneIdx++;
timeContext.CurrentTime += deltaTime;
while ((timeContext.CurrentIdx < _runeRefs.Count) && (timeContext.CurrentTime - timeContext.LastTime >= _runeRefs[timeContext.CurrentIdx].Rune.Speed)) {
Debug.Log($"Finished executing {_runeRefs[timeContext.CurrentIdx].name} - {timeContext.CurrentIdx + 1}/{_runeRefs.Count} at {timeContext.CurrentTime} ");
_runeRefs[timeContext.CurrentIdx].Rune.Cast(effectContext);
timeContext.LastTime += _runeRefs[timeContext.CurrentIdx].Rune.Speed;
timeContext.CurrentIdx++;
public float CompletionStatus() {
return _currentTime / _runeRefs.Sum((runeRef) => runeRef.Rune.Speed);
public float CompletionStatus(ITimeContextContainer timeContextContainer) {
var timeContext = timeContextContainer.GetTimeContext<RuneBindingSequence>();
return timeContext.CurrentTime / _runeRefs.Sum((runeRef) => runeRef.Rune.Speed);
public bool Advance(EffectContext context, float deltaTime) {
if (_currentMoveIdx >= _combatMoveRefs.Count) {
Debug.Log($"Executed Martial Sequence {_currentMoveIdx}/{_combatMoveRefs.Count} moves in {_currentTime} seconds");
if (timeContext.CurrentIdx >= _combatMoveRefs.Count) {
Debug.Log($"Executed Martial Sequence {timeContext.CurrentIdx}/{_combatMoveRefs.Count} moves in {timeContext.CurrentTime} seconds");
while ((_currentMoveIdx < _combatMoveRefs.Count) && (_currentTime - _lastMoveTime >= _combatMoveRefs[_currentMoveIdx].CombatMove.Speed)) {
Debug.Log($"Finished executing Martial move {_combatMoveRefs[_currentMoveIdx].CombatMove.MoveName} {_currentMoveIdx + 1}/{_combatMoveRefs.Count} at {_currentTime}");
while ((timeContext.CurrentIdx < _combatMoveRefs.Count) && (timeContext.CurrentTime - timeContext.LastTime >= _combatMoveRefs[timeContext.CurrentIdx].CombatMove.Speed)) {
Debug.Log($"Finished executing Martial move {_combatMoveRefs[timeContext.CurrentIdx].CombatMove.MoveName} {timeContext.CurrentIdx + 1}/{_combatMoveRefs.Count} at {timeContext.CurrentTime}");
_lastMoveTime += _combatMoveRefs[_currentMoveIdx].CombatMove.Speed;
_currentMoveIdx++;
timeContext.LastTime += _combatMoveRefs[timeContext.CurrentIdx].CombatMove.Speed;
timeContext.CurrentIdx++;
public float CompletionStatus() {
return _currentTime / _combatMoveRefs.Sum((move) => move.CombatMove.Speed);
public float CompletionStatus(ITimeContextContainer timeContextContainer) {
if (timeContextContainer == null) {
return 0;
}
var timeContext = timeContextContainer.GetTimeContext<MartialSequence>();
return timeContext.CurrentTime / _combatMoveRefs.Sum((move) => move.CombatMove.Speed);
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);
}