Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge branch 'gurrenm3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrenm3 authored and Gurrenm3 committed Mar 27, 2020
2 parents 940a4c6 + e230949 commit 692f270
Show file tree
Hide file tree
Showing 12 changed files with 3,150 additions and 20 deletions.
10 changes: 10 additions & 0 deletions BTDToolbox/BTDToolbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<ItemGroup>
<Compile Include="Classes\Announcements.cs" />
<Compile Include="Classes\Bloon_Class.cs" />
<Compile Include="Classes\Card_Class.cs" />
<Compile Include="Classes\CrackBTDB_Pass.cs" />
<Compile Include="Classes\ImageProcessing.cs" />
<Compile Include="Classes\ModLoader_Handling.cs" />
Expand All @@ -89,6 +90,12 @@
<Compile Include="Extra Forms\CreditViewer.Designer.cs">
<DependentUpon>CreditViewer.cs</DependentUpon>
</Compile>
<Compile Include="Extra Forms\EZCard_Editor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Extra Forms\EZCard_Editor.Designer.cs">
<DependentUpon>EZCard_Editor.cs</DependentUpon>
</Compile>
<Compile Include="Extra Forms\EZBloon_Editor.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -134,6 +141,9 @@
<EmbeddedResource Include="Extra Forms\BGForm.resx">
<DependentUpon>BGForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Extra Forms\EZCard_Editor.resx">
<DependentUpon>EZCard_Editor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Extra Forms\EZBloon_Editor.resx">
<DependentUpon>EZBloon_Editor.cs</DependentUpon>
</EmbeddedResource>
Expand Down
226 changes: 226 additions & 0 deletions BTDToolbox/Classes/Card_Class.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using BTDToolbox.Classes;
//
// var card = Card.FromJson(jsonString);

namespace BTDToolbox.Classes
{
using System;
using System.Collections.Generic;

using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

public partial class Card
{
[JsonProperty("Bloon")]
public Card_Bloon Bloon { get; set; }

[JsonProperty("CardSet")]
public string CardSet { get; set; }

[JsonProperty("CardSprite")]
public string CardSprite { get; set; }

[JsonProperty("DiscardCost")]
public long DiscardCost { get; set; }

[JsonProperty("Name")]
public string Name { get; set; }

[JsonProperty("NameOld")]
public string NameOld { get; set; }

[JsonProperty("StartingCard")]
public bool StartingCard { get; set; }

[JsonProperty("Tower")]
public Tower Tower { get; set; }

[JsonProperty("UnlockMethod")]
public string UnlockMethod { get; set; }
[JsonProperty("UnlockWin")]
public UnlockWin UnlockWin { get; set; }

[JsonProperty("Visible")]
public bool Visible { get; set; }

[JsonProperty("Description")]
public string Description { get; set; }

[JsonProperty("PlatformProductID")]
public string PlatformProductId { get; set; }

[JsonProperty("Power")]
public Power Power { get; set; }

[JsonProperty("ProductID")]
public string ProductId { get; set; }
}

public partial class Card_Bloon
{
[JsonProperty("BackgroundSprite")]
public string BackgroundSprite { get; set; }

[JsonProperty("Cost")]
public long Cost { get; set; }

[JsonProperty("Features")]
public string[] Features { get; set; }

[JsonProperty("IncomeChange")]
public long IncomeChange { get; set; }

[JsonProperty("Interval")]
public double Interval { get; set; }

[JsonProperty("NumBloons")]
public long NumBloons { get; set; }

[JsonProperty("Type")]
public string BloonType { get; set; }

[JsonProperty("UnlockRound")]
public long UnlockRound { get; set; }
}

public partial class Tower
{
[JsonProperty("BackgroundSprite")]
public string BackgroundSprite { get; set; }

[JsonProperty("Cost")]
public long Cost { get; set; }

[JsonProperty("Features")]
public string[] Features { get; set; }

[JsonProperty("Type")]
public string TowerType { get; set; }

[JsonProperty("Upgrades")]
public long[] Upgrades { get; set; }
}

public partial class Card
{
public static Card FromJson(string json) => JsonConvert.DeserializeObject<Card>(json, BTDToolbox.Classes.Converter.Settings);
}

public static class SerializeCard
{
public static string ToJson(this Card self) => JsonConvert.SerializeObject(self, BTDToolbox.Classes.Converter.Settings);
}
public partial class PowerCard
{
[JsonProperty("CardSet")]
public string CardSet { get; set; }

[JsonProperty("CardSprite")]
public string CardSprite { get; set; }

[JsonProperty("Description")]
public string Description { get; set; }

[JsonProperty("DiscardCost")]
public long DiscardCost { get; set; }

[JsonProperty("Name")]
public string Name { get; set; }

[JsonProperty("NameOld")]
public string NameOld { get; set; }

[JsonProperty("PlatformProductID")]
public string PlatformProductId { get; set; }

[JsonProperty("Power")]
public Power Power { get; set; }

[JsonProperty("ProductID")]
public string ProductId { get; set; }

[JsonProperty("StartingCard")]
public bool StartingCard { get; set; }

[JsonProperty("UnlockMethod")]
public string UnlockMethod { get; set; }

[JsonProperty("UnlockWin")]
public UnlockWin UnlockWin { get; set; }

[JsonProperty("Visible")]
public bool Visible { get; set; }
}

public partial class Power
{
[JsonProperty("BackgroundSprite")]
public string BackgroundSprite { get; set; }

[JsonProperty("Cost")]
public long Cost { get; set; }

[JsonProperty("Features")]
public string[] Features { get; set; }

[JsonProperty("Type")]
public string Type { get; set; }
}

public partial class UnlockWin
{
[JsonProperty("Count")]
public long Count { get; set; }

[JsonProperty("SpotlightCount")]
public long SpotlightCount { get; set; }

[JsonProperty("Type")]
public string Type { get; set; }
}

public partial class PowerCard
{
public static PowerCard FromJson(string json) => JsonConvert.DeserializeObject<PowerCard>(json, BTDToolbox.Classes.Converter.Settings);
}
public static class SerializePower
{
public static string ToJson(this PowerCard self) => JsonConvert.SerializeObject(self, BTDToolbox.Classes.Converter.Settings);
}
internal class ParseStringConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(long) || t == typeof(long?);

public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
long l;
if (Int64.TryParse(value, out l))
{
return l;
}
throw new Exception("Cannot unmarshal type long");
}

public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (long)untypedValue;
serializer.Serialize(writer, value.ToString());
return;
}

public static readonly ParseStringConverter Singleton = new ParseStringConverter();
}
}
42 changes: 29 additions & 13 deletions BTDToolbox/Extra Forms/EZBloon_Editor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 692f270

Please sign in to comment.