Code cleanup.
This commit is contained in:
@@ -182,7 +182,6 @@ namespace Cryville.Crtr {
|
|||||||
readonly Dictionary<InputSource, int> _activeCounts = new Dictionary<InputSource, int>();
|
readonly Dictionary<InputSource, int> _activeCounts = new Dictionary<InputSource, int>();
|
||||||
readonly Dictionary<InputIdentifier, float> _vect = new Dictionary<InputIdentifier, float>();
|
readonly Dictionary<InputIdentifier, float> _vect = new Dictionary<InputIdentifier, float>();
|
||||||
readonly Dictionary<ProxiedInputIdentifier, PropSrc> _vecs = new Dictionary<ProxiedInputIdentifier, PropSrc>();
|
readonly Dictionary<ProxiedInputIdentifier, PropSrc> _vecs = new Dictionary<ProxiedInputIdentifier, PropSrc>();
|
||||||
static readonly PropSrc.Arbitrary _nullsrc = new PropSrc.Arbitrary(PdtInternalType.Null, new byte[0]);
|
|
||||||
double? _lockTime = null;
|
double? _lockTime = null;
|
||||||
unsafe void OnInput(InputIdentifier id, InputVector vec) {
|
unsafe void OnInput(InputIdentifier id, InputVector vec) {
|
||||||
lock (_lock) {
|
lock (_lock) {
|
||||||
@@ -192,7 +191,7 @@ namespace Cryville.Crtr {
|
|||||||
float ft, tt = (float)(_lockTime != null ? _lockTime.Value : (vec.Time - _timeOrigins[id.Source.Handler]));
|
float ft, tt = (float)(_lockTime != null ? _lockTime.Value : (vec.Time - _timeOrigins[id.Source.Handler]));
|
||||||
if (!_vect.TryGetValue(id, out ft)) ft = tt;
|
if (!_vect.TryGetValue(id, out ft)) ft = tt;
|
||||||
if (vec.IsNull) {
|
if (vec.IsNull) {
|
||||||
_etor.ContextCascadeUpdate(_var_value, _nullsrc);
|
_etor.ContextCascadeUpdate(_var_value, PropSrc.Null);
|
||||||
OnInput(id, proxy.Target, ft, tt, true);
|
OnInput(id, proxy.Target, ft, tt, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -225,7 +224,7 @@ namespace Cryville.Crtr {
|
|||||||
else {
|
else {
|
||||||
var pid = new ProxiedInputIdentifier { Source = id, Target = target };
|
var pid = new ProxiedInputIdentifier { Source = id, Target = target };
|
||||||
PropSrc fv, tv = _etor.ContextCascadeLookup(_var_value);
|
PropSrc fv, tv = _etor.ContextCascadeLookup(_var_value);
|
||||||
if (!_vecs.TryGetValue(pid, out fv)) fv = _nullsrc;
|
if (!_vecs.TryGetValue(pid, out fv)) fv = PropSrc.Null;
|
||||||
if (fv.Type != PdtInternalType.Null || tv.Type != PdtInternalType.Null) {
|
if (fv.Type != PdtInternalType.Null || tv.Type != PdtInternalType.Null) {
|
||||||
if (fv.Type == PdtInternalType.Null) _activeCounts[id.Source]++;
|
if (fv.Type == PdtInternalType.Null) _activeCounts[id.Source]++;
|
||||||
_etor.ContextCascadeInsert();
|
_etor.ContextCascadeInsert();
|
||||||
|
@@ -54,6 +54,7 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static readonly PropSrc Null = new Arbitrary(PdtInternalType.Null, new byte[0]);
|
||||||
public class String : PropSrc {
|
public class String : PropSrc {
|
||||||
readonly Func<string> _cb;
|
readonly Func<string> _cb;
|
||||||
public String(Func<string> cb) : base(PdtInternalType.String) { _cb = cb; }
|
public String(Func<string> cb) : base(PdtInternalType.String) { _cb = cb; }
|
||||||
|
Reference in New Issue
Block a user