Move Json class into main package

See #138
This commit is contained in:
ORelio 2017-05-06 21:08:56 +02:00
parent f177ea272f
commit 9f1ef83680
3 changed files with 4 additions and 9 deletions

View file

@ -3,19 +3,17 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace MinecraftClient.Protocol.Handlers namespace MinecraftClient
{ {
/// <summary> /// <summary>
/// This class parses JSON data and returns an object describing that data. /// This class parses JSON data and returns an object describing that data.
/// Really lightweight JSON handling by ORelio - (c) 2013 - 2014 /// Really lightweight JSON handling by ORelio - (c) 2013 - 2014
/// </summary> /// </summary>
public static class Json
static class Json
{ {
/// <summary> /// <summary>
/// Parse some JSON and return the corresponding JSON object /// Parse some JSON and return the corresponding JSON object
/// </summary> /// </summary>
public static JSONData ParseJson(string json) public static JSONData ParseJson(string json)
{ {
int cursorpos = 0; int cursorpos = 0;
@ -26,7 +24,6 @@ namespace MinecraftClient.Protocol.Handlers
/// The class storing unserialized JSON data /// The class storing unserialized JSON data
/// The data can be an object, an array or a string /// The data can be an object, an array or a string
/// </summary> /// </summary>
public class JSONData public class JSONData
{ {
public enum DataType { Object, Array, String }; public enum DataType { Object, Array, String };
@ -49,7 +46,6 @@ namespace MinecraftClient.Protocol.Handlers
/// </summary> /// </summary>
/// <param name="toparse">String to parse</param> /// <param name="toparse">String to parse</param>
/// <param name="cursorpos">Cursor start (set to 0 for function init)</param> /// <param name="cursorpos">Cursor start (set to 0 for function init)</param>
private static JSONData String2Data(string toparse, ref int cursorpos) private static JSONData String2Data(string toparse, ref int cursorpos)
{ {
try try
@ -173,7 +169,6 @@ namespace MinecraftClient.Protocol.Handlers
/// </summary> /// </summary>
/// <param name="c">Char to test</param> /// <param name="c">Char to test</param>
/// <returns>True if hexadecimal</returns> /// <returns>True if hexadecimal</returns>
private static bool isHex(char c) { return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); } private static bool isHex(char c) { return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f')); }
} }
} }

View file

@ -117,6 +117,7 @@
<Compile Include="Crypto\Streams\RegularAesStream.cs" /> <Compile Include="Crypto\Streams\RegularAesStream.cs" />
<Compile Include="Crypto\CryptoHandler.cs" /> <Compile Include="Crypto\CryptoHandler.cs" />
<Compile Include="CSharpRunner.cs" /> <Compile Include="CSharpRunner.cs" />
<Compile Include="Json.cs" />
<Compile Include="Mapping\Block.cs" /> <Compile Include="Mapping\Block.cs" />
<Compile Include="Mapping\Chunk.cs" /> <Compile Include="Mapping\Chunk.cs" />
<Compile Include="Mapping\ChunkColumn.cs" /> <Compile Include="Mapping\ChunkColumn.cs" />
@ -206,7 +207,6 @@
<Compile Include="Protocol\Handlers\Compression\ZlibBaseStream.cs" /> <Compile Include="Protocol\Handlers\Compression\ZlibBaseStream.cs" />
<Compile Include="Protocol\Handlers\Compression\ZlibCodec.cs" /> <Compile Include="Protocol\Handlers\Compression\ZlibCodec.cs" />
<Compile Include="Protocol\Handlers\Compression\ZlibConstants.cs" /> <Compile Include="Protocol\Handlers\Compression\ZlibConstants.cs" />
<Compile Include="Protocol\Handlers\Json.cs" />
<Compile Include="Protocol\Handlers\ZlibUtils.cs" /> <Compile Include="Protocol\Handlers\ZlibUtils.cs" />
<Compile Include="Protocol\Handlers\ChatParser.cs" /> <Compile Include="Protocol\Handlers\ChatParser.cs" />
<Compile Include="Crypto\IAesStream.cs" /> <Compile Include="Crypto\IAesStream.cs" />

View file

@ -11,7 +11,7 @@ using MinecraftClient.Protocol.SessionCache;
namespace MinecraftClient namespace MinecraftClient
{ {
/// <summary> /// <summary>
/// Minecraft Console Client by ORelio and Contributors (c) 2012-2016. /// Minecraft Console Client by ORelio and Contributors (c) 2012-2017.
/// Allows to connect to any Minecraft server, send and receive text, automated scripts. /// Allows to connect to any Minecraft server, send and receive text, automated scripts.
/// This source code is released under the CDDL 1.0 License. /// This source code is released under the CDDL 1.0 License.
/// </summary> /// </summary>