Skip to content

Commit

Permalink
Move Kethane project into its own folder alongside the solution file
Browse files Browse the repository at this point in the history
  • Loading branch information
Majiir committed Sep 4, 2014
1 parent 067e525 commit 5a1df50
Show file tree
Hide file tree
Showing 56 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion Plugin/Kethane.sln
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kethane", "Kethane.csproj", "{8D1501AC-6C11-459B-9561-6CC5E3EC15FE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kethane", "Kethane\Kethane.csproj", "{8D1501AC-6C11-459B-9561-6CC5E3EC15FE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
192 changes: 96 additions & 96 deletions Plugin/Misc.cs → Plugin/Kethane/Misc.cs
@@ -1,96 +1,96 @@
using System;
using UnityEngine;

namespace Kethane
{
internal static class Misc
{
#region Parsing utility methods

public static float Parse(string s, float defaultValue)
{
float value;
if (!float.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static double Parse(string s, double defaultValue)
{
double value;
if (!double.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static int Parse(string s, int defaultValue)
{
int value;
if (!int.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static bool Parse(string s, bool defaultValue)
{
bool value;
if (!bool.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static Vector3 Parse(string s, Vector3 defaultValue)
{
try
{
return ConfigNode.ParseVector3(s);
}
catch
{
return defaultValue;
}
}

public static Color32 Parse(string s, Color32 defaultValue)
{
if (s == null) { return defaultValue; }
return ConfigNode.ParseColor32(s);
}

public static ParticleRenderMode Parse(string s, ParticleRenderMode defaultValue)
{
try
{
return (ParticleRenderMode)Enum.Parse(typeof(ParticleRenderMode), s);
}
catch
{
return defaultValue;
}
}

#endregion

#region Encoding

public static byte[] FromBase64String(string encoded)
{
return Convert.FromBase64String(encoded.Replace('.', '/').Replace('%', '='));
}

public static string ToBase64String(byte[] data)
{
return Convert.ToBase64String(data).Replace('/', '.').Replace('=', '%');
}

#endregion
}
}
using System;
using UnityEngine;

namespace Kethane
{
internal static class Misc
{
#region Parsing utility methods

public static float Parse(string s, float defaultValue)
{
float value;
if (!float.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static double Parse(string s, double defaultValue)
{
double value;
if (!double.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static int Parse(string s, int defaultValue)
{
int value;
if (!int.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static bool Parse(string s, bool defaultValue)
{
bool value;
if (!bool.TryParse(s, out value))
{
value = defaultValue;
}
return value;
}

public static Vector3 Parse(string s, Vector3 defaultValue)
{
try
{
return ConfigNode.ParseVector3(s);
}
catch
{
return defaultValue;
}
}

public static Color32 Parse(string s, Color32 defaultValue)
{
if (s == null) { return defaultValue; }
return ConfigNode.ParseColor32(s);
}

public static ParticleRenderMode Parse(string s, ParticleRenderMode defaultValue)
{
try
{
return (ParticleRenderMode)Enum.Parse(typeof(ParticleRenderMode), s);
}
catch
{
return defaultValue;
}
}

#endregion

#region Encoding

public static byte[] FromBase64String(string encoded)
{
return Convert.FromBase64String(encoded.Replace('.', '/').Replace('%', '='));
}

public static string ToBase64String(byte[] data)
{
return Convert.ToBase64String(data).Replace('/', '.').Replace('=', '%');
}

#endregion
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5a1df50

Please sign in to comment.