diff --git a/spine-csharp/src/Animation.cs b/spine-csharp/src/Animation.cs
index 8144543cc..23f1eff7f 100644
--- a/spine-csharp/src/Animation.cs
+++ b/spine-csharp/src/Animation.cs
@@ -442,7 +442,7 @@ namespace Spine {
/// The maximum number of Bezier curves. See .
/// Unique identifiers for the properties the timeline modifies.
public CurveTimeline2 (int frameCount, int bezierCount, string propertyId1, string propertyId2)
- :base (frameCount, bezierCount, propertyId1, propertyId2) {
+ : base(frameCount, bezierCount, propertyId1, propertyId2) {
}
public override int FrameEntries {
@@ -515,7 +515,7 @@ namespace Spine {
public TranslateTimeline (int frameCount, int bezierCount, int boneIndex)
: base(frameCount, bezierCount, //
(int)Property.X + "|" + boneIndex, //
- (int) Property.Y + "|" + boneIndex) {
+ (int)Property.Y + "|" + boneIndex) {
this.boneIndex = boneIndex;
}
@@ -2077,7 +2077,7 @@ namespace Spine {
/// Between 0 and frameCount, inclusive.
public void SetFrame (int frame, Event e) {
frames[frame] = e.time;
- events [frame] = e;
+ events[frame] = e;
}
/// Fires events for frames > lastTime and <= time.
@@ -2411,7 +2411,7 @@ namespace Spine {
readonly int pathConstraintIndex;
public PathConstraintPositionTimeline (int frameCount, int bezierCount, int pathConstraintIndex)
- :base(frameCount, bezierCount, (int)Property.PathConstraintPosition + "|" + pathConstraintIndex) {
+ : base(frameCount, bezierCount, (int)Property.PathConstraintPosition + "|" + pathConstraintIndex) {
this.pathConstraintIndex = pathConstraintIndex;
}
diff --git a/spine-csharp/src/AnimationState.cs b/spine-csharp/src/AnimationState.cs
index 7ce9544cc..0da0475e5 100644
--- a/spine-csharp/src/AnimationState.cs
+++ b/spine-csharp/src/AnimationState.cs
@@ -73,7 +73,7 @@ namespace Spine {
/// out position.
internal const int HoldMix = 4;
- internal const int Setup = 1, Current = 2;
+ internal const int Setup = 1, Current = 2;
protected AnimationStateData data;
private readonly ExposedList tracks = new ExposedList();
@@ -510,15 +510,15 @@ namespace Spine {
float r1, r2;
if (time < frames[0]) { // Time is before first frame.
switch (blend) {
- case MixBlend.Setup:
- bone.rotation = bone.data.rotation;
- goto default; // Fall through.
- default:
- return;
- case MixBlend.First:
- r1 = bone.rotation;
- r2 = bone.data.rotation;
- break;
+ case MixBlend.Setup:
+ bone.rotation = bone.data.rotation;
+ goto default; // Fall through.
+ default:
+ return;
+ case MixBlend.First:
+ r1 = bone.rotation;
+ r2 = bone.data.rotation;
+ break;
}
} else {
r1 = blend == MixBlend.Setup ? bone.data.rotation : bone.rotation;
@@ -590,7 +590,7 @@ namespace Spine {
///
/// It may be desired to use to mix the skeletons back to the setup pose,
/// rather than leaving them in their current pose.
- ///
+ ///
public void ClearTracks () {
bool oldDrainDisabled = queue.drainDisabled;
queue.drainDisabled = true;
@@ -896,7 +896,7 @@ namespace Spine {
}
timelineMode[i] = AnimationState.HoldFirst;
}
- continue_outer: {}
+ continue_outer: { }
}
}
diff --git a/spine-csharp/src/Atlas.cs b/spine-csharp/src/Atlas.cs
index 56f4dc58b..347ffbd07 100644
--- a/spine-csharp/src/Atlas.cs
+++ b/spine-csharp/src/Atlas.cs
@@ -261,7 +261,7 @@ namespace Spine {
int colon = line.IndexOf(':');
if (colon == -1) return 0;
entry[0] = line.Substring(0, colon).Trim();
- for (int i = 1, lastMatch = colon + 1;; i++) {
+ for (int i = 1, lastMatch = colon + 1; ; i++) {
int comma = line.IndexOf(',', lastMatch);
if (comma == -1) {
entry[i] = line.Substring(lastMatch).Trim();
diff --git a/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs b/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs
index 8dc263196..3cf20a53b 100644
--- a/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs
+++ b/spine-csharp/src/Attachments/AtlasAttachmentLoader.cs
@@ -89,7 +89,7 @@ namespace Spine {
return new PointAttachment(name);
}
- public ClippingAttachment NewClippingAttachment(Skin skin, string name) {
+ public ClippingAttachment NewClippingAttachment (Skin skin, string name) {
return new ClippingAttachment(name);
}
diff --git a/spine-csharp/src/Attachments/ClippingAttachment.cs b/spine-csharp/src/Attachments/ClippingAttachment.cs
index b0aa8db61..039f9bc22 100644
--- a/spine-csharp/src/Attachments/ClippingAttachment.cs
+++ b/spine-csharp/src/Attachments/ClippingAttachment.cs
@@ -35,7 +35,7 @@ namespace Spine {
public SlotData EndSlot { get { return endSlot; } set { endSlot = value; } }
- public ClippingAttachment(string name) : base(name) {
+ public ClippingAttachment (string name) : base(name) {
}
public override Attachment Copy () {
diff --git a/spine-csharp/src/Attachments/MeshAttachment.cs b/spine-csharp/src/Attachments/MeshAttachment.cs
index 12603915d..88ec38c6b 100644
--- a/spine-csharp/src/Attachments/MeshAttachment.cs
+++ b/spine-csharp/src/Attachments/MeshAttachment.cs
@@ -129,7 +129,7 @@ namespace Spine {
width = RegionOriginalHeight / textureWidth;
height = RegionOriginalWidth / textureHeight;
- for (int i = 0, n = uvs.Length; iThe base class for all constraint datas.
public abstract class ConstraintData {
internal readonly string name;
diff --git a/spine-csharp/src/ExposedList.cs b/spine-csharp/src/ExposedList.cs
index 07cde4a9a..6bcd610fe 100644
--- a/spine-csharp/src/ExposedList.cs
+++ b/spine-csharp/src/ExposedList.cs
@@ -298,7 +298,7 @@ namespace Spine {
private int GetLastIndex (int startIndex, int count, Predicate match) {
// unlike FindLastIndex, takes regular params for search range
- for (int i = startIndex + count; i != startIndex; )
+ for (int i = startIndex + count; i != startIndex;)
if (match(Items[--i]))
return i;
return -1;
diff --git a/spine-csharp/src/IkConstraint.cs b/spine-csharp/src/IkConstraint.cs
index 4018ee423..1bcdfab11 100644
--- a/spine-csharp/src/IkConstraint.cs
+++ b/spine-csharp/src/IkConstraint.cs
@@ -166,27 +166,27 @@ namespace Spine {
float rotationIK = -bone.ashearX - bone.arotation;
float tx = 0, ty = 0;
- switch(bone.data.transformMode) {
- case TransformMode.OnlyTranslation:
- tx = targetX - bone.worldX;
- ty = targetY - bone.worldY;
- break;
- case TransformMode.NoRotationOrReflection: {
- float s = Math.Abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
- float sa = pa / bone.skeleton.ScaleX;
- float sc = pc / bone.skeleton.ScaleY;
- pb = -sc * s * bone.skeleton.ScaleX;
- pd = sa * s * bone.skeleton.ScaleY;
- rotationIK += (float)Math.Atan2(sc, sa) * MathUtils.RadDeg;
- goto default; // Fall through.
- }
- default: {
- float x = targetX - p.worldX, y = targetY - p.worldY;
- float d = pa * pd - pb * pc;
- tx = (x * pd - y * pb) / d - bone.ax;
- ty = (y * pa - x * pc) / d - bone.ay;
- break;
- }
+ switch (bone.data.transformMode) {
+ case TransformMode.OnlyTranslation:
+ tx = targetX - bone.worldX;
+ ty = targetY - bone.worldY;
+ break;
+ case TransformMode.NoRotationOrReflection: {
+ float s = Math.Abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
+ float sa = pa / bone.skeleton.ScaleX;
+ float sc = pc / bone.skeleton.ScaleY;
+ pb = -sc * s * bone.skeleton.ScaleX;
+ pd = sa * s * bone.skeleton.ScaleY;
+ rotationIK += (float)Math.Atan2(sc, sa) * MathUtils.RadDeg;
+ goto default; // Fall through.
+ }
+ default: {
+ float x = targetX - p.worldX, y = targetY - p.worldY;
+ float d = pa * pd - pb * pc;
+ tx = (x * pd - y * pb) / d - bone.ax;
+ ty = (y * pa - x * pc) / d - bone.ay;
+ break;
+ }
}
rotationIK += (float)Math.Atan2(ty, tx) * MathUtils.RadDeg;
@@ -199,11 +199,11 @@ namespace Spine {
float sx = bone.ascaleX, sy = bone.ascaleY;
if (compress || stretch) {
switch (bone.data.transformMode) {
- case TransformMode.NoScale:
- case TransformMode.NoScaleOrReflection:
- tx = targetX - bone.worldX;
- ty = targetY - bone.worldY;
- break;
+ case TransformMode.NoScale:
+ case TransformMode.NoScaleOrReflection:
+ tx = targetX - bone.worldX;
+ ty = targetY - bone.worldY;
+ break;
}
float b = bone.data.length * sx, dd = (float)Math.Sqrt(tx * tx + ty * ty);
if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001f) {
diff --git a/spine-csharp/src/Json.cs b/spine-csharp/src/Json.cs
index aa790f422..fbb263843 100644
--- a/spine-csharp/src/Json.cs
+++ b/spine-csharp/src/Json.cs
@@ -28,11 +28,11 @@
*****************************************************************************/
using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
using System.IO;
using System.Text;
-using System.Collections;
-using System.Globalization;
-using System.Collections.Generic;
namespace Spine {
public static class Json {
@@ -70,10 +70,8 @@ namespace Spine {
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-namespace SharpJson
-{
- class Lexer
- {
+namespace SharpJson {
+ class Lexer {
public enum Token {
None,
Null,
@@ -110,23 +108,20 @@ namespace SharpJson
bool success = true;
char[] stringBuffer = new char[4096];
- public Lexer(string text)
- {
+ public Lexer (string text) {
Reset();
json = text.ToCharArray();
parseNumbersAsFloat = false;
}
- public void Reset()
- {
+ public void Reset () {
index = 0;
lineNumber = 1;
success = true;
}
- public string ParseString()
- {
+ public string ParseString () {
int idx = 0;
StringBuilder builder = null;
@@ -165,8 +160,8 @@ namespace SharpJson
case 'b':
stringBuffer[idx++] = '\b';
break;
- case'f':
- stringBuffer[idx++] = '\f';
+ case 'f':
+ stringBuffer[idx++] = '\f';
break;
case 'n':
stringBuffer[idx++] = '\n';
@@ -183,7 +178,7 @@ namespace SharpJson
var hex = new string(json, index, 4);
// XXX: handle UTF
- stringBuffer[idx++] = (char) Convert.ToInt32(hex, 16);
+ stringBuffer[idx++] = (char)Convert.ToInt32(hex, 16);
// skip 4 chars
index += 4;
@@ -211,40 +206,37 @@ namespace SharpJson
}
if (builder != null)
- return builder.ToString ();
+ return builder.ToString();
else
- return new string (stringBuffer, 0, idx);
+ return new string(stringBuffer, 0, idx);
}
- string GetNumberString()
- {
+ string GetNumberString () {
SkipWhiteSpaces();
int lastIndex = GetLastIndexOfNumber(index);
int charLength = (lastIndex - index) + 1;
- var result = new string (json, index, charLength);
+ var result = new string(json, index, charLength);
index = lastIndex + 1;
return result;
}
- public float ParseFloatNumber()
- {
+ public float ParseFloatNumber () {
float number;
- var str = GetNumberString ();
+ var str = GetNumberString();
- if (!float.TryParse (str, NumberStyles.Float, CultureInfo.InvariantCulture, out number))
+ if (!float.TryParse(str, NumberStyles.Float, CultureInfo.InvariantCulture, out number))
return 0;
return number;
}
- public double ParseDoubleNumber()
- {
+ public double ParseDoubleNumber () {
double number;
- var str = GetNumberString ();
+ var str = GetNumberString();
if (!double.TryParse(str, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
return 0;
@@ -252,23 +244,21 @@ namespace SharpJson
return number;
}
- int GetLastIndexOfNumber(int index)
- {
+ int GetLastIndexOfNumber (int index) {
int lastIndex;
for (lastIndex = index; lastIndex < json.Length; lastIndex++) {
char ch = json[lastIndex];
if ((ch < '0' || ch > '9') && ch != '+' && ch != '-'
- && ch != '.' && ch != 'e' && ch != 'E')
+ && ch != '.' && ch != 'e' && ch != 'E')
break;
}
return lastIndex - 1;
}
- void SkipWhiteSpaces()
- {
+ void SkipWhiteSpaces () {
for (; index < json.Length; index++) {
char ch = json[index];
@@ -280,22 +270,19 @@ namespace SharpJson
}
}
- public Token LookAhead()
- {
+ public Token LookAhead () {
SkipWhiteSpaces();
int savedIndex = index;
return NextToken(json, ref savedIndex);
}
- public Token NextToken()
- {
+ public Token NextToken () {
SkipWhiteSpaces();
return NextToken(json, ref index);
}
- static Token NextToken(char[] json, ref int index)
- {
+ static Token NextToken (char[] json, ref int index) {
if (index == json.Length)
return Token.None;
@@ -314,8 +301,16 @@ namespace SharpJson
return Token.Comma;
case '"':
return Token.String;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
case '-':
return Token.Number;
case ':':
@@ -329,10 +324,10 @@ namespace SharpJson
// false
if (remainingLength >= 5) {
if (json[index] == 'f' &&
- json[index + 1] == 'a' &&
- json[index + 2] == 'l' &&
- json[index + 3] == 's' &&
- json[index + 4] == 'e') {
+ json[index + 1] == 'a' &&
+ json[index + 2] == 'l' &&
+ json[index + 3] == 's' &&
+ json[index + 4] == 'e') {
index += 5;
return Token.False;
}
@@ -341,9 +336,9 @@ namespace SharpJson
// true
if (remainingLength >= 4) {
if (json[index] == 't' &&
- json[index + 1] == 'r' &&
- json[index + 2] == 'u' &&
- json[index + 3] == 'e') {
+ json[index + 1] == 'r' &&
+ json[index + 2] == 'u' &&
+ json[index + 3] == 'e') {
index += 4;
return Token.True;
}
@@ -352,9 +347,9 @@ namespace SharpJson
// null
if (remainingLength >= 4) {
if (json[index] == 'n' &&
- json[index + 1] == 'u' &&
- json[index + 2] == 'l' &&
- json[index + 3] == 'l') {
+ json[index + 1] == 'u' &&
+ json[index + 2] == 'l' &&
+ json[index + 3] == 'l') {
index += 4;
return Token.Null;
}
@@ -364,8 +359,7 @@ namespace SharpJson
}
}
- public class JsonDecoder
- {
+ public class JsonDecoder {
public string errorMessage {
get;
private set;
@@ -378,14 +372,12 @@ namespace SharpJson
Lexer lexer;
- public JsonDecoder()
- {
+ public JsonDecoder () {
errorMessage = null;
parseNumbersAsFloat = false;
}
- public object Decode(string text)
- {
+ public object Decode (string text) {
errorMessage = null;
lexer = new Lexer(text);
@@ -394,14 +386,12 @@ namespace SharpJson
return ParseValue();
}
- public static object DecodeText(string text)
- {
+ public static object DecodeText (string text) {
var builder = new JsonDecoder();
return builder.Decode(text);
}
- IDictionary ParseObject()
- {
+ IDictionary ParseObject () {
var table = new Dictionary();
// {
@@ -449,8 +439,7 @@ namespace SharpJson
//return null; // Unreachable code
}
- IList