-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\public\Jailbreak.Public\Jailbreak.Public.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Behaviors; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
|
||
namespace Jailbreak.LastRequest; | ||
|
||
public class LastRequestManager : IPluginBehavior, ILastRequestManager | ||
{ | ||
private BasePlugin _parent; | ||
|
||
public void Start(BasePlugin parent) | ||
{ | ||
_parent = parent; | ||
_parent.RegisterEventHandler<EventPlayerDeath>(OnPlayerDeath); | ||
} | ||
|
||
public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info) | ||
{ | ||
return HookResult.Continue; | ||
} | ||
|
||
public bool IsLREnabled { get; set; } | ||
public IList<AbstractLastRequest> ActiveLRs { get; } = new List<AbstractLastRequest>(); | ||
|
||
public void InitiateLastRequest(AbstractLastRequest lastRequest) | ||
{ | ||
lastRequest.Setup(); | ||
ActiveLRs.Add(lastRequest); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
public/Jailbreak.Public/Mod/LastRequest/AbstractLastRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public abstract class AbstractLastRequest | ||
{ | ||
protected CCSPlayerController prisoner, guard; | ||
Check warning on line 8 in public/Jailbreak.Public/Mod/LastRequest/AbstractLastRequest.cs GitHub Actions / build
|
||
protected LRType type; | ||
protected LRState state; | ||
|
||
protected DateTimeOffset startTime; | ||
|
||
public abstract void Setup(); | ||
public abstract void Execute(); | ||
public abstract void End(LRResult result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
public enum LRResult | ||
{ | ||
PrisonerWin, | ||
GuardWin, | ||
TimedOut, | ||
Interrupted | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
public enum LRState | ||
{ | ||
Pending, | ||
Active, | ||
Completed, | ||
Cancelled | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
public enum LRType | ||
{ | ||
GunToss, | ||
RockPaperScissors, | ||
KnifeFight, | ||
NoScope, | ||
FiftyFifty, | ||
ShotForShot, | ||
MagForMag, | ||
Race | ||
} |
10 changes: 10 additions & 0 deletions
10
public/Jailbreak.Public/Mod/LastRequest/ILastRequestFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Behaviors; | ||
using Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public interface ILastRequestFactory : IPluginBehavior | ||
{ | ||
AbstractLastRequest CreateLastRequest(CCSPlayerController prisoner, CCSPlayerController guard, LRType type); | ||
} |
12 changes: 12 additions & 0 deletions
12
public/Jailbreak.Public/Mod/LastRequest/ILastRequestManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Jailbreak.Public.Behaviors; | ||
|
||
namespace Jailbreak.Public.Mod.LastRequest; | ||
|
||
public interface ILastRequestManager : IPluginBehavior | ||
{ | ||
public bool IsLREnabled { get; set; } | ||
public IList<AbstractLastRequest> ActiveLRs { get; } | ||
|
||
void InitiateLastRequest(AbstractLastRequest lastRequest); | ||
|
||
} |