Skip to content

Commit

Permalink
* add InhibitorRespawningSoon client event
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes-Schneider committed Oct 22, 2020
1 parent 59f94d4 commit 93968a4
Show file tree
Hide file tree
Showing 6 changed files with 3,561 additions and 1,941 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ internal sealed class LoLClientEventTypeConverter : ReadOnlyConverter<string>
return LoLClientEventType.InhibitorKilled;
}

if (value.Equals("InhibRespawningSoon", StringComparison.InvariantCultureIgnoreCase))
{
return LoLClientEventType.InhibitorRespawningSoon;
}

if (value.Equals("InhibRespawned", StringComparison.InvariantCultureIgnoreCase))
{
return LoLClientEventType.InhibitorRespawned;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public enum LoLClientEventType
TurretKilled,

InhibitorKilled,

InhibitorRespawningSoon,

InhibitorRespawned,

Expand Down Expand Up @@ -45,6 +47,7 @@ internal static class LoLClientEventTypeExtensions
{LoLClientEventType.FirstTurretKilled, () => new LoLClientFirstTurretKilledEvent()},
{LoLClientEventType.TurretKilled, () => new LoLClientTurretKilledEvent()},
{LoLClientEventType.InhibitorKilled, () => new LoLClientInhibitorKilledEvent()},
{LoLClientEventType.InhibitorRespawningSoon, () => new LoLClientInhibitorRespawningSoonEvent()},
{LoLClientEventType.InhibitorRespawned, () => new LoLClientInhibitorRespawnedEvent()},
{LoLClientEventType.DragonKilled, () => new LoLClientDragonKilledEvent()},
{LoLClientEventType.HeraldKilled, () => new LoLClientHeraldKilledEvent()},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using GoldDiff.LeagueOfLegends.ClientApi.Converter;
using Newtonsoft.Json;

namespace GoldDiff.LeagueOfLegends.ClientApi.Event
{
public class LoLClientInhibitorRespawningSoonEvent : LoLClientEvent
{
[JsonProperty("InhibRespawningSoon")]
[JsonConverter(typeof(LoLClientInhibitorConverter))]
public LoLClientInhibitor Inhibitor { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<Compile Include="Event\LoLClientInhibitor.cs" />
<Compile Include="Event\LoLClientInhibitorKilledEvent.cs" />
<Compile Include="Event\LoLClientInhibitorRespawnedEvent.cs" />
<Compile Include="Event\LoLClientInhibitorRespawningSoonEvent.cs" />
<Compile Include="Event\LoLClientInhibitorTier.cs" />
<Compile Include="Event\LoLClientKilledEvent.cs" />
<Compile Include="Event\LoLClientKilledWithAssistersEvent.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void TestDeserializeFullGame()
{
var gameData = JsonConvert.DeserializeObject<LoLClientGameData>(File.ReadAllText(FullGameAsJsonPath));

Assert.AreEqual(61, gameData.EventCollection.Events.Count);
Assert.AreEqual(236, gameData.EventCollection.Events.Count);
Assert.AreEqual(LoLClientEventType.GameStarted, gameData.EventCollection.Events.First().EventType);
Assert.AreEqual(LoLClientEventType.GameEnded, gameData.EventCollection.Events.Last().EventType);

Expand Down
Loading

0 comments on commit 93968a4

Please sign in to comment.