Exemplo n.º 1
0
        public override async Task <TypeReaderResponse> Read(ICommandContext context, string value)
        {
            var equip = Equipment.Find(value);

            if (equip == null)
            {
                return(TypeReaderResponse.FromError($"`{value}` is not a valid equipment"));
            }

            var dataService = context.DependencyFactory.Get <TT2DataService>();

            var equipment = await dataService.GetEquipment(equip);

            if (equipment == null)
            {
                return(TypeReaderResponse.FromError($"Could not download data for equipment `{equip.Id}`"));
            }
            return(TypeReaderResponse.FromSuccess(equipment));
        }
Exemplo n.º 2
0
        public override async Task <TypeReaderResponse> Read(ICommandContext context, string value)
        {
            var art = Artifact.Find(value);

            if (art == null)
            {
                return(TypeReaderResponse.FromError($"`{value}` is not a valid artifact"));
            }

            var dataService = context.DependencyFactory.Get <TT2DataService>();

            var artifact = await dataService.GetArtifact(art);

            if (artifact == null)
            {
                return(TypeReaderResponse.FromError($"Could not download data for artifact `#{art.Id}`"));
            }
            return(TypeReaderResponse.FromSuccess(artifact));
        }
Exemplo n.º 3
0
        public override async Task <TypeReaderResponse> Read(ICommandContext context, string value)
        {
            var helper = Helper.Find(value);

            if (helper == null)
            {
                return(TypeReaderResponse.FromError($"`{value}` is not a valid hero"));
            }

            var dataService = context.DependencyFactory.Get <TT2DataService>();

            var hero = await dataService.GetHelper(helper);

            if (hero == null)
            {
                return(TypeReaderResponse.FromError($"Could not download data for hero `#{helper.Id}`"));
            }
            return(TypeReaderResponse.FromSuccess(hero));
        }