-
-
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.
Add factory, enhance ALR, add empty knifefight example
- Loading branch information
Showing
9 changed files
with
157 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Jailbreak.Formatting.Base; | ||
using Jailbreak.Formatting.Views; | ||
|
||
namespace Jailbreak.English.LastRequest; | ||
|
||
public class LastRequestMessages : ILastRequestMessages | ||
{ | ||
public IView LastRequestEnabled() => new SimpleView() | ||
{ | ||
{ "Last Request has been enabled." } | ||
}; | ||
|
||
public IView LastRequestDisabled() => new SimpleView() | ||
{ | ||
{ "Last Request has been disabled." } | ||
}; | ||
} |
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,6 @@ | ||
namespace Jailbreak.LastRequest; | ||
|
||
public class LastRequestConfig | ||
{ | ||
public int PrisonersToActiveLR { get; set; } = 2; | ||
} |
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,15 @@ | ||
using Jailbreak.Public.Extensions; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Jailbreak.LastRequest; | ||
|
||
public static class LastRequestExtension | ||
{ | ||
public static void AddJailbreakLastRequest(this IServiceCollection collection) | ||
{ | ||
collection.AddConfig<LastRequestConfig>("lastrequest"); | ||
|
||
collection.AddPluginBehavior<ILastRequestManager, LastRequestManager>(); | ||
} | ||
} |
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,25 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.LastRequest.LastRequests; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
using Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
namespace Jailbreak.LastRequest; | ||
|
||
public class LastRequestFactory : ILastRequestFactory | ||
{ | ||
private BasePlugin plugin; | ||
|
||
public LastRequestFactory(BasePlugin plugin) | ||
{ | ||
this.plugin = plugin; | ||
} | ||
|
||
public AbstractLastRequest CreateLastRequest(CCSPlayerController prisoner, CCSPlayerController guard, LRType type) | ||
{ | ||
return type switch | ||
{ | ||
LRType.KnifeFight => new KnifeFight(plugin, prisoner, guard), | ||
_ => throw new ArgumentException("Invalid last request type: " + type, nameof(type)) | ||
}; | ||
} | ||
} |
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,28 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using Jailbreak.Public.Mod.LastRequest; | ||
using Jailbreak.Public.Mod.LastRequest.Enums; | ||
|
||
namespace Jailbreak.LastRequest.LastRequests; | ||
|
||
public class KnifeFight : AbstractLastRequest | ||
{ | ||
public KnifeFight(BasePlugin plugin, CCSPlayerController prisoner, CCSPlayerController guard) : base(plugin, | ||
prisoner, guard) | ||
{ | ||
} | ||
|
||
public override void Setup() | ||
{ | ||
// Strip weapons, teleport T to CT | ||
} | ||
|
||
public override void Execute() | ||
{ | ||
// Give knives | ||
} | ||
|
||
public override void End(LRResult result) | ||
{ | ||
// Slay the loser | ||
} | ||
} |
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 @@ | ||
using Jailbreak.Formatting.Base; | ||
|
||
namespace Jailbreak.Formatting.Views; | ||
|
||
public interface ILastRequestMessages | ||
{ | ||
public IView LastRequestEnabled(); | ||
public IView LastRequestDisabled(); | ||
} |
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