Move some classes to Cryville.Common.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Logging;
|
||||
using Cryville.Crtr.Extension;
|
||||
using Mono.Cecil;
|
||||
using System;
|
||||
|
@@ -8,7 +8,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr.Browsing {
|
||||
internal class LegacyResourceManager : IResourceManager<ChartDetail> {
|
||||
|
@@ -67,12 +67,12 @@ namespace Cryville.Crtr {
|
||||
[JsonIgnore]
|
||||
public IntKeyedDictionary<PropSrc> PropSrcs { get; private set; }
|
||||
protected void SubmitPropSrc(string name, PropSrc property) {
|
||||
PropSrcs.Add(IdentifierManager.SharedInstance.Request(name), property);
|
||||
PropSrcs.Add(IdentifierManager.Shared.Request(name), property);
|
||||
}
|
||||
[JsonIgnore]
|
||||
public IntKeyedDictionary<PropOp> PropOps { get; private set; }
|
||||
protected void SubmitPropOp(string name, PropOp property) {
|
||||
PropOps.Add(IdentifierManager.SharedInstance.Request(name), property);
|
||||
PropOps.Add(IdentifierManager.Shared.Request(name), property);
|
||||
}
|
||||
|
||||
protected ChartEvent() {
|
||||
|
@@ -17,8 +17,8 @@ using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Scripting;
|
||||
using Coroutine = Cryville.Common.Coroutine;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
using Stopwatch = System.Diagnostics.Stopwatch;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
public class ChartPlayer : MonoBehaviour {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Cryville.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr.Components {
|
||||
public class SkinAnimation : SkinComponent {
|
||||
|
@@ -15,7 +15,7 @@ namespace Cryville.Crtr.Components {
|
||||
/// <param name="name">The name of the property.</param>
|
||||
/// <param name="property">The property.</param>
|
||||
protected void SubmitProperty(string name, PdtOperator property, int udl = 1) {
|
||||
Properties.Add(IdentifierManager.SharedInstance.Request(name), new SkinProperty(property, udl));
|
||||
Properties.Add(IdentifierManager.Shared.Request(name), new SkinProperty(property, udl));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr.Components {
|
||||
public class SpriteInfo {
|
||||
|
@@ -3,7 +3,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr.Config {
|
||||
public class ConfigPanelMaster : MonoBehaviour {
|
||||
|
@@ -5,7 +5,7 @@ using System.Threading;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
public class Console : MonoBehaviour {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Discord;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
internal class DiscordController : MonoBehaviour {
|
||||
|
@@ -43,7 +43,7 @@ namespace Cryville.Crtr {
|
||||
EffectState _currentState;
|
||||
ChartEvent _ctxev;
|
||||
ContainerState _ctxstate;
|
||||
internal static readonly int _VAR_EFFECT_INDEX = IdentifierManager.SharedInstance.Request("effect_index");
|
||||
internal static readonly int _VAR_EFFECT_INDEX = IdentifierManager.Shared.Request("effect_index");
|
||||
readonly PropSrc _indexSrc;
|
||||
double _startTime;
|
||||
float _duration;
|
||||
|
@@ -65,8 +65,8 @@ namespace Cryville.Crtr.Event {
|
||||
get { return cs.Container; }
|
||||
}
|
||||
|
||||
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
|
||||
static readonly int _var_invisible_bounds = IdentifierManager.SharedInstance.Request("invisible_bounds");
|
||||
static readonly int _var_current_time = IdentifierManager.Shared.Request("current_time");
|
||||
static readonly int _var_invisible_bounds = IdentifierManager.Shared.Request("invisible_bounds");
|
||||
public readonly IntKeyedDictionary<PropSrc> PropSrcs = new IntKeyedDictionary<PropSrc>();
|
||||
SkinContainer skinContainer;
|
||||
protected Judge judge;
|
||||
@@ -81,13 +81,13 @@ namespace Cryville.Crtr.Event {
|
||||
Anchor a_cur;
|
||||
Anchor a_head;
|
||||
Anchor a_tail;
|
||||
static readonly int _a_cur = IdentifierManager.SharedInstance.Request("cur");
|
||||
static readonly int _a_head = IdentifierManager.SharedInstance.Request("head");
|
||||
static readonly int _a_tail = IdentifierManager.SharedInstance.Request("tail");
|
||||
static readonly int _a_cur = IdentifierManager.Shared.Request("cur");
|
||||
static readonly int _a_head = IdentifierManager.Shared.Request("head");
|
||||
static readonly int _a_tail = IdentifierManager.Shared.Request("tail");
|
||||
double atime_head;
|
||||
double atime_tail;
|
||||
public Anchor RegisterAnchor(int name, bool dyn = false, int propSrcCount = 0) {
|
||||
var strname = IdentifierManager.SharedInstance.Retrieve(name);
|
||||
var strname = IdentifierManager.Shared.Retrieve(name);
|
||||
var go = new GameObject("." + strname).transform;
|
||||
go.SetParent(RootTransform, false);
|
||||
var result = new Anchor(name, go, propSrcCount);
|
||||
@@ -273,7 +273,7 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
public void PushAnchorEvent(double time, int name) {
|
||||
if (!DynamicAnchors.ContainsKey(name))
|
||||
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||
throw new ArgumentException(string.Format("Specified anchor \"{0}\" not found", IdentifierManager.Shared.Retrieve(name)));
|
||||
if (name == _a_head) atime_head = time;
|
||||
else if (name == _a_tail) atime_tail = time;
|
||||
DynamicAnchorSetTime[name] = time;
|
||||
|
@@ -256,7 +256,7 @@ namespace Cryville.Crtr.Event {
|
||||
return (T)GetComputedValue(key);
|
||||
}
|
||||
|
||||
static readonly int n_pt = IdentifierManager.SharedInstance.Request("pt");
|
||||
static readonly int n_pt = IdentifierManager.Shared.Request("pt");
|
||||
public Vector2 ScreenPoint {
|
||||
get {
|
||||
var mv = GetComputedValue<Vec2>(n_pt);
|
||||
@@ -264,7 +264,7 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int n_dir = IdentifierManager.SharedInstance.Request("dir");
|
||||
static readonly int n_dir = IdentifierManager.Shared.Request("dir");
|
||||
public Vector3 Direction {
|
||||
get {
|
||||
Vec3 r = GetComputedValue<Vec3>(n_dir);
|
||||
@@ -272,7 +272,7 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int n_normal = IdentifierManager.SharedInstance.Request("normal");
|
||||
static readonly int n_normal = IdentifierManager.Shared.Request("normal");
|
||||
public Vector3 Normal {
|
||||
get {
|
||||
Vec3 r = GetComputedValue<Vec3>(n_normal);
|
||||
@@ -286,22 +286,22 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int n_sv = IdentifierManager.SharedInstance.Request("sv");
|
||||
static readonly int n_svm = IdentifierManager.SharedInstance.Request("svm");
|
||||
static readonly int n_sv = IdentifierManager.Shared.Request("sv");
|
||||
static readonly int n_svm = IdentifierManager.Shared.Request("svm");
|
||||
public float ScrollVelocity {
|
||||
get {
|
||||
return GetComputedValue<Vec1>(n_sv).Value * GetComputedValue<Vec1m>(n_svm).Value;
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int n_dist = IdentifierManager.SharedInstance.Request("dist");
|
||||
static readonly int n_dist = IdentifierManager.Shared.Request("dist");
|
||||
public float Distance {
|
||||
get {
|
||||
return GetComputedValue<Vec1>(n_dist).Value;
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int n_track = IdentifierManager.SharedInstance.Request("track");
|
||||
static readonly int n_track = IdentifierManager.Shared.Request("track");
|
||||
public float Track {
|
||||
get {
|
||||
return GetComputedValue<Vec1>(n_track).Value;
|
||||
|
@@ -30,7 +30,7 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
readonly IntKeyedDictionary<ObjectPool<MotionCache>> m_buckets;
|
||||
protected override IReadOnlyDictionary<int, ObjectPool<MotionCache>> Buckets { get { return m_buckets; } }
|
||||
protected override IDictionary<int, ObjectPool<MotionCache>> Buckets { get { return m_buckets; } }
|
||||
public MotionCachePool() {
|
||||
m_buckets = new IntKeyedDictionary<ObjectPool<MotionCache>>(ChartPlayer.motionRegistry.Count);
|
||||
foreach (var reg in ChartPlayer.motionRegistry)
|
||||
|
@@ -20,7 +20,7 @@ namespace Cryville.Crtr.Event {
|
||||
}
|
||||
}
|
||||
readonly IntKeyedDictionary<ObjectPool<RealtimeMotionValue>> m_buckets;
|
||||
protected override IReadOnlyDictionary<int, ObjectPool<RealtimeMotionValue>> Buckets { get { return m_buckets; } }
|
||||
protected override IDictionary<int, ObjectPool<RealtimeMotionValue>> Buckets { get { return m_buckets; } }
|
||||
public RMVPool() {
|
||||
m_buckets = new IntKeyedDictionary<ObjectPool<RealtimeMotionValue>>(ChartPlayer.motionRegistry.Count);
|
||||
foreach (var reg in ChartPlayer.motionRegistry)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Cryville.Audio;
|
||||
using Cryville.Audio.Source;
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Font;
|
||||
using Cryville.Common.Logging;
|
||||
using Cryville.Common.Unity;
|
||||
using Cryville.Common.Unity.Input;
|
||||
using Cryville.Common.Unity.UI;
|
||||
@@ -11,7 +11,7 @@ using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using Logger = Cryville.Common.Logger;
|
||||
using Logger = Cryville.Common.Logging.Logger;
|
||||
|
||||
namespace Cryville.Crtr {
|
||||
public static class Game {
|
||||
|
@@ -1,5 +1,7 @@
|
||||
using Cryville.Common;
|
||||
using Cryville.Common.Logging;
|
||||
using Cryville.Common.Pdt;
|
||||
using Cryville.Common.Reflection;
|
||||
using Cryville.Common.Unity.Input;
|
||||
using Cryville.Crtr.Config;
|
||||
using System;
|
||||
@@ -53,7 +55,7 @@ namespace Cryville.Crtr {
|
||||
config.Clear();
|
||||
foreach (var p in _tproxies) {
|
||||
config.Add((string)p.Key.Name, new RulesetConfig.InputEntry {
|
||||
handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
||||
handler = TypeNameHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()),
|
||||
type = p.Value.Source.Value.Type
|
||||
});
|
||||
}
|
||||
@@ -89,7 +91,7 @@ namespace Cryville.Crtr {
|
||||
bool IsCompleted(Identifier name) {
|
||||
return name.Key == _var_pause || _use[name] != 0 || _tproxies.ContainsKey(name);
|
||||
}
|
||||
static readonly int _var_pause = IdentifierManager.SharedInstance.Request("pause");
|
||||
static readonly int _var_pause = IdentifierManager.Shared.Request("pause");
|
||||
void IncrementUseRecursive(Identifier name) {
|
||||
BroadcastProxyChanged(name);
|
||||
var passes = _ruleset.inputs[name].pass;
|
||||
@@ -172,7 +174,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
|
||||
static readonly int _var_value = IdentifierManager.SharedInstance.Request("value");
|
||||
static readonly int _var_value = IdentifierManager.Shared.Request("value");
|
||||
const int MAX_DEPTH = 15;
|
||||
const int MAX_DIMENSION = 3;
|
||||
readonly InputVectorSrc[] _vecsrcs = new InputVectorSrc[MAX_DEPTH + 1];
|
||||
@@ -247,8 +249,8 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
}
|
||||
static readonly int _var_fv = IdentifierManager.SharedInstance.Request("fv");
|
||||
static readonly int _var_tv = IdentifierManager.SharedInstance.Request("tv");
|
||||
static readonly int _var_fv = IdentifierManager.Shared.Request("input_vec_from");
|
||||
static readonly int _var_tv = IdentifierManager.Shared.Request("input_vec_to");
|
||||
unsafe void OnInput(InputIdentifier id, Identifier target, float ft, float tt, bool nullflag, int depth = 0) {
|
||||
if (depth >= MAX_DEPTH) throw new InputProxyException("Input propagation limit reached\nThe ruleset has invalid input definitions");
|
||||
var def = _ruleset.inputs[target];
|
||||
|
@@ -19,7 +19,7 @@ namespace Cryville.Crtr {
|
||||
= new Dictionary<Identifier, List<JudgeEvent>>();
|
||||
readonly Dictionary<Identifier, List<JudgeEvent>> activeEvs
|
||||
= new Dictionary<Identifier, List<JudgeEvent>>();
|
||||
static readonly int _var_pause = IdentifierManager.SharedInstance.Request("pause");
|
||||
static readonly int _var_pause = IdentifierManager.Shared.Request("pause");
|
||||
readonly JudgeDefinition _judgePause;
|
||||
public struct JudgeEvent {
|
||||
public double StartTime { get; set; }
|
||||
@@ -91,15 +91,15 @@ namespace Cryville.Crtr {
|
||||
void InitJudges() {
|
||||
foreach (var i in _rs.judges) {
|
||||
var id = i.Key;
|
||||
judgeMap.Add(id.Key, IdentifierManager.SharedInstance.Request("judge_" + id.Name));
|
||||
judgeMap.Add(id.Key, IdentifierManager.Shared.Request("judge_" + id.Name));
|
||||
}
|
||||
}
|
||||
static bool _flag;
|
||||
static readonly PropOp.Boolean _flagop = new PropOp.Boolean(v => _flag = v);
|
||||
static readonly int _var_fn = IdentifierManager.SharedInstance.Request("fn");
|
||||
static readonly int _var_tn = IdentifierManager.SharedInstance.Request("tn");
|
||||
static readonly int _var_ft = IdentifierManager.SharedInstance.Request("ft");
|
||||
static readonly int _var_tt = IdentifierManager.SharedInstance.Request("tt");
|
||||
static readonly int _var_fn = IdentifierManager.Shared.Request("judge_clip_from");
|
||||
static readonly int _var_tn = IdentifierManager.Shared.Request("judge_clip_to");
|
||||
static readonly int _var_ft = IdentifierManager.Shared.Request("input_time_from");
|
||||
static readonly int _var_tt = IdentifierManager.Shared.Request("input_time_to");
|
||||
float _numbuf1, _numbuf2, _numbuf3, _numbuf4;
|
||||
readonly PropSrc _numsrc1, _numsrc2, _numsrc3, _numsrc4;
|
||||
unsafe void LoadNum(byte[] buffer, float value) {
|
||||
@@ -236,7 +236,7 @@ namespace Cryville.Crtr {
|
||||
void InitScores() {
|
||||
foreach (var s in _rs.scores) {
|
||||
var key = s.Key.Key;
|
||||
var strkey = IdentifierManager.SharedInstance.Request("_score_" + (string)s.Key.Name);
|
||||
var strkey = IdentifierManager.Shared.Request("_score_" + (string)s.Key.Name);
|
||||
scoreStringKeys.Add(key, strkey);
|
||||
scoreStringKeysRev.Add(strkey, key);
|
||||
scoreSrcs.Add(key, new PropSrc.Float(() => scores[key]));
|
||||
@@ -262,7 +262,7 @@ namespace Cryville.Crtr {
|
||||
scoreFullBuf.Clear();
|
||||
foreach (var s in scores) {
|
||||
var id = s.Key;
|
||||
scoreFullBuf.AppendFormat(flag ? "\n{0}: " : "{0}: ", (string)IdentifierManager.SharedInstance.Retrieve(id));
|
||||
scoreFullBuf.AppendFormat(flag ? "\n{0}: " : "{0}: ", (string)IdentifierManager.Shared.Retrieve(id));
|
||||
scoreFullBuf.AppendFormat(scoreFormatCache[id], scores[id]);
|
||||
flag = true;
|
||||
}
|
||||
|
@@ -162,7 +162,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
readonly Dictionary<Type, ObjectPool<MotionNode>> m_buckets;
|
||||
protected override IReadOnlyDictionary<Type, ObjectPool<MotionNode>> Buckets { get { return m_buckets; } }
|
||||
protected override IDictionary<Type, ObjectPool<MotionNode>> Buckets { get { return m_buckets; } }
|
||||
public MotionNodePool() {
|
||||
m_buckets = new Dictionary<Type, ObjectPool<MotionNode>>();
|
||||
foreach (var reg in ChartPlayer.motionRegistry) {
|
||||
|
@@ -19,9 +19,9 @@ namespace Cryville.Crtr {
|
||||
SectionalGameObject[] sgos;
|
||||
readonly Dictionary<Chart.Judge, JudgeState> judges = new Dictionary<Chart.Judge, JudgeState>();
|
||||
class JudgeState {
|
||||
static readonly int _var_judge_result = IdentifierManager.SharedInstance.Request("judge_result");
|
||||
static readonly int _var_judge_time_absolute = IdentifierManager.SharedInstance.Request("judge_time_absolute");
|
||||
static readonly int _var_judge_time_relative = IdentifierManager.SharedInstance.Request("judge_time_relative");
|
||||
static readonly int _var_judge_result = IdentifierManager.Shared.Request("judge_result");
|
||||
static readonly int _var_judge_time_absolute = IdentifierManager.Shared.Request("judge_time_absolute");
|
||||
static readonly int _var_judge_time_relative = IdentifierManager.Shared.Request("judge_time_relative");
|
||||
public Anchor StaticAnchor { get; private set; }
|
||||
public float AbsoluteTime { get; private set; }
|
||||
PropSrc _jtabsPropSrc;
|
||||
|
@@ -17,13 +17,13 @@ namespace Cryville.Crtr {
|
||||
readonly byte[] _numbuf = new byte[4];
|
||||
readonly PropSrc _vecsrc;
|
||||
Vector _vec;
|
||||
static readonly int _var_w = IdentifierManager.SharedInstance.Request("w");
|
||||
static readonly int _var_h = IdentifierManager.SharedInstance.Request("h");
|
||||
static readonly int _var_inf = IdentifierManager.SharedInstance.Request("inf");
|
||||
static readonly int _var_true = IdentifierManager.SharedInstance.Request("true");
|
||||
static readonly int _var_false = IdentifierManager.SharedInstance.Request("false");
|
||||
static readonly int _var_null = IdentifierManager.SharedInstance.Request("null");
|
||||
static readonly int _var_current_time = IdentifierManager.SharedInstance.Request("current_time");
|
||||
static readonly int _var_w = IdentifierManager.Shared.Request("w");
|
||||
static readonly int _var_h = IdentifierManager.Shared.Request("h");
|
||||
static readonly int _var_inf = IdentifierManager.Shared.Request("inf");
|
||||
static readonly int _var_true = IdentifierManager.Shared.Request("true");
|
||||
static readonly int _var_false = IdentifierManager.Shared.Request("false");
|
||||
static readonly int _var_null = IdentifierManager.Shared.Request("null");
|
||||
static readonly int _var_current_time = IdentifierManager.Shared.Request("current_time");
|
||||
protected override void GetVariable(int name, bool forced, out int type, out byte[] value) {
|
||||
if (name == _var_w) { LoadNum(ChartPlayer.hitRect.width); type = PdtInternalType.Number; value = _numbuf; }
|
||||
else if (name == _var_h) { LoadNum(ChartPlayer.hitRect.height); type = PdtInternalType.Number; value = _numbuf; }
|
||||
@@ -75,8 +75,8 @@ namespace Cryville.Crtr {
|
||||
unsafe void LoadNum(float value) {
|
||||
fixed (byte* ptr = _numbuf) *(float*)ptr = value;
|
||||
}
|
||||
static readonly int _op_sep = IdentifierManager.SharedInstance.Request(",");
|
||||
static readonly int _func_int_map = IdentifierManager.SharedInstance.Request("int_map");
|
||||
static readonly int _op_sep = IdentifierManager.Shared.Request(",");
|
||||
static readonly int _func_int_map = IdentifierManager.Shared.Request("int_map");
|
||||
protected override PdtOperator GetOperator(PdtOperatorSignature sig) {
|
||||
PdtOperator result;
|
||||
if (_shortops.TryGetValue(sig, out result)) {
|
||||
@@ -98,12 +98,12 @@ namespace Cryville.Crtr {
|
||||
else throw new KeyNotFoundException(string.Format("Undefined operator {0}", sig));
|
||||
}
|
||||
|
||||
static readonly int _colop_and = IdentifierManager.SharedInstance.Request("&");
|
||||
static readonly int _colop_or = IdentifierManager.SharedInstance.Request("|");
|
||||
static readonly int _colop_and = IdentifierManager.Shared.Request("&");
|
||||
static readonly int _colop_or = IdentifierManager.Shared.Request("|");
|
||||
protected override bool Collapse(int name, PdtVariableMemory param) {
|
||||
if (name == _colop_and) return param.Type == PdtInternalType.Number && param.AsNumber() <= 0;
|
||||
else if (name == _colop_or) return param.Type != PdtInternalType.Number || param.AsNumber() > 0;
|
||||
else throw new KeyNotFoundException(string.Format("Undefined collapse operator {0}", IdentifierManager.SharedInstance.Retrieve(name)));
|
||||
else throw new KeyNotFoundException(string.Format("Undefined collapse operator {0}", IdentifierManager.Shared.Retrieve(name)));
|
||||
}
|
||||
|
||||
public ChartEvent ContextEvent { get; set; }
|
||||
@@ -173,25 +173,25 @@ namespace Cryville.Crtr {
|
||||
_shortops.Add(new PdtOperatorSignature("interval", 3), new func_interval());
|
||||
_shortops.Add(new PdtOperatorSignature("is", 2), new func_is());
|
||||
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("screen_edge"), new func_screen_edge(() => ContextTransform));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("int"), new func_int(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("clamp"), new func_clamp(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("min"), new func_min(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("max"), new func_max(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("abs"), new func_abs(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("anim"), new func_anim(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("cubic_bezier"), new func_cubic_bezier(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("ease"), new func_cubic_bezier_fixed(0.25f, 0.1f, 0.25f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("ease_in"), new func_cubic_bezier_fixed(0.42f, 0f, 1f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("ease_out"), new func_cubic_bezier_fixed(0f, 0f, 0.58f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("ease_in_out"), new func_cubic_bezier_fixed(0.42f, 0f, 0.58f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("screen_edge"), new func_screen_edge(() => ContextTransform));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("int"), new func_int(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("clamp"), new func_clamp(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("min"), new func_min(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("max"), new func_max(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("abs"), new func_abs(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("anim"), new func_anim(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("cubic_bezier"), new func_cubic_bezier(() => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("ease"), new func_cubic_bezier_fixed(0.25f, 0.1f, 0.25f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("ease_in"), new func_cubic_bezier_fixed(0.42f, 0f, 1f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("ease_out"), new func_cubic_bezier_fixed(0f, 0f, 0.58f, 1f, () => ContextSelfValue));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("ease_in_out"), new func_cubic_bezier_fixed(0.42f, 0f, 0.58f, 1f, () => ContextSelfValue));
|
||||
|
||||
Func<int, PropSrc> cccb = k => ContextCascadeLookup(k);
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("attack_timing"), new func_attack_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("enter_timing"), new func_enter_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("release_timing"), new func_release_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("leave_timing"), new func_leave_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.SharedInstance.Request("contact_timing"), new func_contact_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("attack_timing"), new func_attack_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("enter_timing"), new func_enter_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("release_timing"), new func_release_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("leave_timing"), new func_leave_timing(cccb));
|
||||
_ctxops.Add(IdentifierManager.Shared.Request("contact_timing"), new func_contact_timing(cccb));
|
||||
}
|
||||
#region Operators
|
||||
#pragma warning disable IDE1006
|
||||
@@ -600,12 +600,12 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
#endregion
|
||||
#region Judge Functions
|
||||
static readonly int _var_fn = IdentifierManager.SharedInstance.Request("judge_clip_from");
|
||||
static readonly int _var_tn = IdentifierManager.SharedInstance.Request("judge_clip_to");
|
||||
static readonly int _var_ft = IdentifierManager.SharedInstance.Request("input_time_from");
|
||||
static readonly int _var_tt = IdentifierManager.SharedInstance.Request("input_time_to");
|
||||
static readonly int _var_fv = IdentifierManager.SharedInstance.Request("input_vec_from");
|
||||
static readonly int _var_tv = IdentifierManager.SharedInstance.Request("input_vec_to");
|
||||
static readonly int _var_fn = IdentifierManager.Shared.Request("judge_clip_from");
|
||||
static readonly int _var_tn = IdentifierManager.Shared.Request("judge_clip_to");
|
||||
static readonly int _var_ft = IdentifierManager.Shared.Request("input_time_from");
|
||||
static readonly int _var_tt = IdentifierManager.Shared.Request("input_time_to");
|
||||
static readonly int _var_fv = IdentifierManager.Shared.Request("input_vec_from");
|
||||
static readonly int _var_tv = IdentifierManager.Shared.Request("input_vec_to");
|
||||
abstract class JudgeFunction : PdtOperator {
|
||||
readonly Func<int, PropSrc> _ctxcb;
|
||||
protected JudgeFunction(int pc, Func<int, PropSrc> ctxcb) : base(pc) {
|
||||
|
@@ -109,7 +109,7 @@ namespace Cryville.Crtr {
|
||||
throw new ArgumentException("Type is not enum");
|
||||
var names = typeof(T).GetFields(BindingFlags.Public | BindingFlags.Static);
|
||||
for (int i = 0; i < names.Length; i++)
|
||||
_cache[IdentifierManager.SharedInstance.Request(names[i].Name)] = Convert.ToInt32(names[i].GetValue(null));
|
||||
_cache[IdentifierManager.Shared.Request(names[i].Name)] = Convert.ToInt32(names[i].GetValue(null));
|
||||
}
|
||||
public Enum(Action<T> cb, Func<int, T> caster) {
|
||||
_cb = cb;
|
||||
|
@@ -113,13 +113,13 @@ namespace Cryville.Crtr {
|
||||
public int Name { get; private set; }
|
||||
public PropertyKey(PropertyType type, string name) {
|
||||
Type = type;
|
||||
Name = IdentifierManager.SharedInstance.Request(name);
|
||||
Name = IdentifierManager.Shared.Request(name);
|
||||
}
|
||||
public override string ToString() {
|
||||
switch (Type) {
|
||||
case PropertyType.Property: return (string)IdentifierManager.SharedInstance.Retrieve(Name);
|
||||
case PropertyType.Variable: return string.Format("@var {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
default: return string.Format("<{0}> {1}", Type, IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
case PropertyType.Property: return (string)IdentifierManager.Shared.Retrieve(Name);
|
||||
case PropertyType.Variable: return string.Format("@var {0}", IdentifierManager.Shared.Retrieve(Name));
|
||||
default: return string.Format("<{0}> {1}", Type, IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,30 +12,30 @@ namespace Cryville.Crtr {
|
||||
public static SkinPropertyKey Construct(HashSet<string> a, IReadOnlyList<string> k, bool compKeyFlag) {
|
||||
if (a.Remove("has")) {
|
||||
if (k.Count != 1) throw new FormatException("Invalid anchor name");
|
||||
return new CreateAnchor(a, IdentifierManager.SharedInstance.Request(k[0]));
|
||||
return new CreateAnchor(a, IdentifierManager.Shared.Request(k[0]));
|
||||
}
|
||||
else if (a.Remove("at")) {
|
||||
if (k.Count != 1) throw new FormatException("Invalid anchor name");
|
||||
return new SetAnchor(a, IdentifierManager.SharedInstance.Request(k[0]));
|
||||
return new SetAnchor(a, IdentifierManager.Shared.Request(k[0]));
|
||||
}
|
||||
else if (a.Remove("emit")) {
|
||||
if (k.Count != 1) throw new FormatException("Invalid effect name");
|
||||
return new EmitEffect(a, IdentifierManager.SharedInstance.Request(k[0]));
|
||||
return new EmitEffect(a, IdentifierManager.Shared.Request(k[0]));
|
||||
}
|
||||
else if (a.Remove("emit_self")) {
|
||||
if (k.Count != 1) throw new FormatException("Invalid effect name");
|
||||
return new EmitEffect(a, IdentifierManager.SharedInstance.Request(k[0]), true);
|
||||
return new EmitEffect(a, IdentifierManager.Shared.Request(k[0]), true);
|
||||
}
|
||||
else if (a.Remove("var")) {
|
||||
if (k.Count != 1) throw new FormatException("Invalid variable name");
|
||||
return new SetVariable(a, IdentifierManager.SharedInstance.Request(k[0]));
|
||||
return new SetVariable(a, IdentifierManager.Shared.Request(k[0]));
|
||||
}
|
||||
switch (k.Count) {
|
||||
case 1:
|
||||
if (compKeyFlag) return new CreateComponent(a, GetComponentByName(k[0]));
|
||||
else return new SetProperty(a, typeof(TransformInterface), IdentifierManager.SharedInstance.Request(k[0]));
|
||||
else return new SetProperty(a, typeof(TransformInterface), IdentifierManager.Shared.Request(k[0]));
|
||||
case 2:
|
||||
return new SetProperty(a, GetComponentByName(k[0]), IdentifierManager.SharedInstance.Request(k[1]));
|
||||
return new SetProperty(a, GetComponentByName(k[0]), IdentifierManager.Shared.Request(k[1]));
|
||||
default:
|
||||
throw new FormatException("Unknown error");
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace Cryville.Crtr {
|
||||
Name = name;
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format("{0}.{1}", Component.Name, IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
return string.Format("{0}.{1}", Component.Name, IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return true; } }
|
||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars) {
|
||||
@@ -100,13 +100,13 @@ namespace Cryville.Crtr {
|
||||
var comp = (SkinComponent)obj.GetComponent(ctype);
|
||||
if (comp == null) throw new InvalidOperationException(string.Format(
|
||||
"Trying to set property \"{0}\" but the component is not found",
|
||||
IdentifierManager.SharedInstance.Retrieve(Name)
|
||||
IdentifierManager.Shared.Retrieve(Name)
|
||||
));
|
||||
SkinProperty result;
|
||||
if (!comp.Properties.TryGetValue(Name, out result))
|
||||
throw new InvalidOperationException(string.Format(
|
||||
"Property \"{0}\" not found on component",
|
||||
IdentifierManager.SharedInstance.Retrieve(Name)
|
||||
IdentifierManager.Shared.Retrieve(Name)
|
||||
));
|
||||
return result;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ namespace Cryville.Crtr {
|
||||
Name = name;
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format("@has {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
return string.Format("@has {0}", IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return false; } }
|
||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars) {
|
||||
@@ -134,7 +134,7 @@ namespace Cryville.Crtr {
|
||||
_timeOp = new PropOp.Float(v => _time = v);
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format("@at {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
return string.Format("@at {0}", IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return true; } }
|
||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars) {
|
||||
@@ -161,7 +161,7 @@ namespace Cryville.Crtr {
|
||||
_op = new PropOp.Float(v => _index = v);
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format(IsSelf ? "@emit_self {0}" : "@emit {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
return string.Format(IsSelf ? "@emit_self {0}" : "@emit {0}", IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return true; } }
|
||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars) {
|
||||
@@ -182,7 +182,7 @@ namespace Cryville.Crtr {
|
||||
Name = name;
|
||||
}
|
||||
public override string ToString() {
|
||||
return string.Format("@var {0}", IdentifierManager.SharedInstance.Retrieve(Name));
|
||||
return string.Format("@var {0}", IdentifierManager.Shared.Retrieve(Name));
|
||||
}
|
||||
public override bool IsValueRequired { get { return true; } }
|
||||
public override void ExecuteStatic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars) {
|
||||
@@ -195,7 +195,7 @@ namespace Cryville.Crtr {
|
||||
public override void ExecuteDynamic(ISkinnableGroup group, RuntimeSkinContext ctx, PdtExpression exp, IntKeyedDictionary<SkinVariable> vars, int dl) {
|
||||
SkinVariable v;
|
||||
if (!vars.TryGetValue(Name, out v))
|
||||
throw new InvalidOperationException(string.Format("Variable \"{0}\" not defined", IdentifierManager.SharedInstance.Retrieve(Name)));
|
||||
throw new InvalidOperationException(string.Format("Variable \"{0}\" not defined", IdentifierManager.Shared.Retrieve(Name)));
|
||||
if (!ChartPlayer.etor.Evaluate(v.Op, exp))
|
||||
throw new EvaluationFailureException();
|
||||
}
|
||||
|
@@ -81,9 +81,9 @@ namespace Cryville.Crtr {
|
||||
public class Anchor : SkinSelector {
|
||||
public int Name { get; private set; }
|
||||
public Anchor(string name) {
|
||||
Name = IdentifierManager.SharedInstance.Request(name);
|
||||
Name = IdentifierManager.Shared.Request(name);
|
||||
}
|
||||
public override string ToString() { return string.Format(".{0}", IdentifierManager.SharedInstance.Retrieve(Name)); }
|
||||
public override string ToString() { return string.Format(".{0}", IdentifierManager.Shared.Retrieve(Name)); }
|
||||
|
||||
public override IEnumerable<SkinContext> MatchStatic(ISkinnableGroup g, SkinContext c) {
|
||||
IReadOnlyCollection<CAnchor> anchors;
|
||||
@@ -96,9 +96,9 @@ namespace Cryville.Crtr {
|
||||
public class AtAnchor : SkinSelector {
|
||||
public int Name { get; private set; }
|
||||
public AtAnchor(string name) {
|
||||
Name = IdentifierManager.SharedInstance.Request(name);
|
||||
Name = IdentifierManager.Shared.Request(name);
|
||||
}
|
||||
public override string ToString() { return string.Format("..{0}", IdentifierManager.SharedInstance.Retrieve(Name)); }
|
||||
public override string ToString() { return string.Format("..{0}", IdentifierManager.Shared.Retrieve(Name)); }
|
||||
|
||||
public override SkinContext MatchDynamic(ISkinnableGroup g, SkinContext c) {
|
||||
return g.OpenedAnchorName == Name ? c : null;
|
||||
|
Reference in New Issue
Block a user