Code cleanup.
This commit is contained in:
@@ -19,9 +19,7 @@ namespace Cryville.Common.Network {
|
||||
set { throw new NotSupportedException(); }
|
||||
}
|
||||
|
||||
public override void Flush() {
|
||||
// Do nothing
|
||||
}
|
||||
public override void Flush() { }
|
||||
|
||||
public abstract byte[] ReadToEnd();
|
||||
|
||||
|
@@ -92,9 +92,7 @@ namespace Cryville.Common.Network {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void NotifyServerCertificate(TlsServerCertificate serverCertificate) {
|
||||
// Do nothing
|
||||
}
|
||||
public void NotifyServerCertificate(TlsServerCertificate serverCertificate) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -11,8 +11,7 @@ namespace Cryville.Common.Unity.Input {
|
||||
typeof(UnityMouseHandler),
|
||||
typeof(UnityTouchHandler),
|
||||
};
|
||||
// TODO set private
|
||||
public readonly List<InputHandler> _handlers = new List<InputHandler>();
|
||||
readonly List<InputHandler> _handlers = new List<InputHandler>();
|
||||
readonly Dictionary<Type, InputHandler> _typemap = new Dictionary<Type, InputHandler>();
|
||||
readonly Dictionary<InputHandler, double> _timeOrigins = new Dictionary<InputHandler, double>();
|
||||
readonly object _lock = new object();
|
||||
|
@@ -275,7 +275,7 @@ namespace Cryville.Crtr {
|
||||
|
||||
private void LoadFromString(string s) {
|
||||
Match m = Regex.Match(s, @"^(.+?)(#(\d+))?(@(.+?))?(\^(.+?))?(\*(.+?))?(:(.+))?$");
|
||||
if (!m.Success) throw new ArgumentException(); // TODO
|
||||
if (!m.Success) throw new ArgumentException("Invalid motion string format");
|
||||
name = new Identifier(m.Groups[1].Value);
|
||||
var registry = ChartPlayer.motionRegistry[name];
|
||||
if (m.Groups[3].Success) {
|
||||
|
@@ -129,7 +129,6 @@ namespace Cryville.Crtr.Components {
|
||||
}
|
||||
}
|
||||
|
||||
// Vector3 prevp = Vector3.zero;
|
||||
protected override void AppendPointInternal(Vector3 p, Quaternion r) {
|
||||
if (vertices == null) {
|
||||
vertices = _ptPool.Rent();
|
||||
|
@@ -367,11 +367,11 @@ namespace Cryville.Crtr {
|
||||
static readonly Type[] stringTypeArray = new Type[] { typeof(string) };
|
||||
static readonly Type[] floatArrayTypeArray = new Type[] { typeof(float[]) };
|
||||
public static Vector Construct(Type type, string s) {
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||
return (Vector)type.GetConstructor(stringTypeArray).Invoke(new object[] { s });
|
||||
}
|
||||
public static Vector Construct(Type type, float[] values) {
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||
return (Vector)type.GetConstructor(floatArrayTypeArray).Invoke(new object[] { values });
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ namespace Cryville.Crtr {
|
||||
|
||||
public void Init() {
|
||||
if (Texture == null)
|
||||
throw new InvalidOperationException(); // TODO
|
||||
throw new InvalidOperationException("Missing texture");
|
||||
_frame = new Rect(Vector2.zero, Size);
|
||||
var w = _frame.width;
|
||||
var h = _frame.height;
|
||||
@@ -92,7 +92,7 @@ namespace Cryville.Crtr {
|
||||
|
||||
public void Init(int w, int h, Texture2D _base) {
|
||||
if (Texture != null)
|
||||
throw new InvalidOperationException(); // TODO
|
||||
throw new InvalidOperationException("Missing texture");
|
||||
Texture = _base;
|
||||
float x = _frame.x / w;
|
||||
float y = 1 - _frame.y / h;
|
||||
|
@@ -97,7 +97,7 @@ namespace Cryville.Crtr {
|
||||
pwp = Vector3.zero;
|
||||
ptime = s.Time;
|
||||
length = 0;
|
||||
//Logger.LogFormat("main", 0, "Debug", "SV: {0}", cs.GetRawValue<Vec1m>("svm").Value);
|
||||
// Logger.LogFormat("main", 0, "Debug", "SV: {0}", cs.GetRawValue<Vec1m>("svm").Value);
|
||||
}
|
||||
|
||||
// TODO Fix anchor rotation
|
||||
|
Reference in New Issue
Block a user