Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

Commit ddbb5d8

Browse files
author
BuildTools
committed
Modified the GameEvent class a bit
1 parent 7b7cb3a commit ddbb5d8

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

Event.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace Splotch.Event.AbilityEvents
151151
/// <summary>
152152
/// A class that should be extended by any ability-related events
153153
/// </summary>
154-
public abstract class AbilityEvent : Event, Cancellable
154+
public abstract class AbilityEvent : GameEvent, Cancellable
155155
{
156156
public bool Cancelled { get; set; } = false;
157157

@@ -240,15 +240,10 @@ public abstract class PlayerEvent : GameEvent
240240
/// </summary>
241241
/// <returns></returns>
242242
public abstract Player GetPlayer();
243-
public override GameSessionHandler GetGameSessionHandler()
244-
{
245-
FieldInfo selfRefField = typeof(GameSessionHandler).GetField("selfRef", BindingFlags.Static | BindingFlags.NonPublic);
246-
return selfRefField.GetValue(null) as GameSessionHandler;
247-
}
248243

249244
public SlimeController GetSlimeController()
250245
{
251-
return GetSlimeControllers()[GetPlayer().Id - 1];
246+
return Splotch.GetSlimeControllers()[GetPlayer().Id - 1];
252247
}
253248
}
254249

@@ -335,11 +330,5 @@ public abstract class GameEvent : Event, Cancellable
335330
{
336331
public bool Cancelled { get; set; } = false;
337332

338-
public abstract GameSessionHandler GetGameSessionHandler();
339-
public SlimeController[] GetSlimeControllers()
340-
{
341-
FieldInfo slimeControllersField = typeof(GameSessionHandler).GetField("slimeControllers", BindingFlags.Instance | BindingFlags.NonPublic);
342-
return slimeControllersField.GetValue(GetGameSessionHandler()) as SlimeController[];
343-
}
344333
}
345334
}

0 commit comments

Comments
 (0)