-
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
5 changed files
with
52 additions
and
4 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
35 changes: 35 additions & 0 deletions
35
src/plugin/Edelstein.Plugin.Rue/Commands/Admin/QuestCommand.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,35 @@ | ||
using Edelstein.Protocol.Gameplay.Game.Objects.User; | ||
using Edelstein.Protocol.Gameplay.Models.Characters.Quests.Templates; | ||
using Edelstein.Protocol.Gameplay.Models.Inventories.Templates; | ||
using Edelstein.Protocol.Utilities.Templates; | ||
|
||
namespace Edelstein.Plugin.Rue.Commands.Admin; | ||
|
||
public class QuestCommand : AbstractTemplateCommand<IQuestTemplate> | ||
{ | ||
public override string Name => "Quest"; | ||
public override string Description => "Searches a specified quest"; | ||
|
||
private readonly ITemplateManager<IQuestTemplate> _strings; | ||
|
||
public QuestCommand( | ||
ITemplateManager<IQuestTemplate> templates | ||
) : base(templates) | ||
{ | ||
_strings = templates; | ||
} | ||
|
||
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, IQuestTemplate 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
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