-
Notifications
You must be signed in to change notification settings - Fork 29
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
4 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/plugin/Edelstein.Plugin.Rue/Commands/Admin/MobCommand.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,33 @@ | ||
using Edelstein.Protocol.Gameplay.Game.Objects.Mob.Templates; | ||
using Edelstein.Protocol.Gameplay.Game.Objects.User; | ||
using Edelstein.Protocol.Utilities.Templates; | ||
|
||
namespace Edelstein.Plugin.Rue.Commands.Admin; | ||
|
||
public class MobCommand : AbstractTemplateCommand<IMobTemplate> | ||
{ | ||
private readonly ITemplateManager<IMobStringTemplate> _strings; | ||
|
||
public MobCommand( | ||
ITemplateManager<IMobTemplate> templates, | ||
ITemplateManager<IMobStringTemplate> strings | ||
) : base(templates) | ||
=> _strings = strings; | ||
|
||
public override string Name => "Mob"; | ||
public override string Description => "Searches a specified mob"; | ||
|
||
protected override async Task<IEnumerable<TemplateCommandIndex>> Indices() | ||
{ | ||
var result = new List<TemplateCommandIndex>(); | ||
var strings = (await _strings.RetrieveAll()).ToList(); | ||
|
||
result.AddRange(strings.Select(s => new TemplateCommandIndex(s.ID, s.ID.ToString(), s.Name))); | ||
result.AddRange(strings.Select(s => new TemplateCommandIndex(s.ID, s.Name, s.Name))); | ||
|
||
return result; | ||
} | ||
|
||
protected override Task Execute(IFieldUser user, IMobTemplate template, TemplateCommandArgs args) | ||
=> Task.CompletedTask; | ||
} |
34 changes: 34 additions & 0 deletions
34
src/plugin/Edelstein.Plugin.Rue/Commands/Admin/NPCCommand.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,34 @@ | ||
using Edelstein.Protocol.Gameplay.Game.Objects.NPC.Templates; | ||
using Edelstein.Protocol.Gameplay.Game.Objects.User; | ||
using Edelstein.Protocol.Utilities.Templates; | ||
|
||
namespace Edelstein.Plugin.Rue.Commands.Admin; | ||
|
||
public class NPCCommand : AbstractTemplateCommand<INPCTemplate> | ||
{ | ||
private readonly ITemplateManager<INPCStringTemplate> _strings; | ||
|
||
public NPCCommand( | ||
ITemplateManager<INPCTemplate> templates, | ||
ITemplateManager<INPCStringTemplate> strings | ||
) : base(templates) | ||
=> _strings = strings; | ||
|
||
public override string Name => "NPC"; | ||
public override string Description => "Searches a specified NPC"; | ||
|
||
protected override async Task<IEnumerable<TemplateCommandIndex>> Indices() | ||
{ | ||
var result = new List<TemplateCommandIndex>(); | ||
var strings = (await _strings.RetrieveAll()).ToList(); | ||
|
||
result.AddRange(strings.Select(s => new TemplateCommandIndex(s.ID, s.ID.ToString(), s.Name))); | ||
result.AddRange(strings.Select(s => new TemplateCommandIndex(s.ID, s.Name, $"{s.Name}{(!string.IsNullOrWhiteSpace(s.Func) ? $": {s.Func}" : "")}"))); | ||
result.AddRange(strings.Select(s => new TemplateCommandIndex(s.ID, s.Func, $"{s.Name}{(!string.IsNullOrWhiteSpace(s.Func) ? $": {s.Func}" : "")}"))); | ||
|
||
return result; | ||
} | ||
|
||
protected override Task Execute(IFieldUser user, INPCTemplate template, TemplateCommandArgs args) | ||
=> Task.CompletedTask; | ||
} |
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