public async Task <bool> ListMonsters()
        {
            return(await TakePostAction <MonsterListRequest>((res, data) =>
            {
                int?maxCR = Monster.TryGetCRChartInt(data.MaxCR);
                int?minCR = Monster.TryGetCRChartInt(data.MinCR);
                res.Data = LocalRemoteConverter.CreateRemoteMonsterList(m =>
                {
                    int?crInt = m.IntCR;


                    try
                    {
                        return (data.Name.IsEmptyOrNull() || m.Name.ToUpper().Contains(data.Name.ToUpper())) &&
                        (data.IsCustom == null || m.IsCustom == data.IsCustom) &&
                        (data.IsNPC == null || m.NPC == data.IsNPC) &&
                        (crInt.IsNullOrBetweenInclusive(minCR, maxCR)
                        );
                    }
                    catch (Exception ex)
                    {
                        if (ex != null)
                        {
                        }
                        return false;
                    }
                });
            }));
        }
Exemple #2
0
 public async Task <object> ListMagicItems()
 {
     return(await TakePostAction <MagicItemListRequest>((res, data) =>
     {
         res.Data = LocalRemoteConverter.CreateRemoteMagicItemList(m =>
         {
             try
             {
                 return m.Name.ContainsOrNullIgnoreCase(data.Name) &&
                 (data.IsCustom == null || m.IsCustom == data.IsCustom) &&
                 m.Slot.ContainsOrNullIgnoreCase(data.Slot) &&
                 m.Group.ContainsOrNullIgnoreCase(data.Group) &&
                 (data.MinCL == null || m.CL >= data.MinCL.Value) &&
                 (data.MaxCL == null || m.CL <= data.MaxCL.Value);
             }
             catch (Exception ex)
             {
                 if (ex != null)
                 {
                 }
                 return false;
             }
         });
     }));
 }
Exemple #3
0
 public async Task <object> ListFeats()
 {
     return(await TakePostAction <FeatListRequest>((res, data) =>
     {
         res.Data = LocalRemoteConverter.CreateRemoteFeatList(m =>
         {
             try
             {
                 return m.Name.ContainsOrNullIgnoreCase(data.Name) &&
                 (data.IsCustom == null || m.IsCustom == data.IsCustom) &&
                 (data.Type == null || m.Types.Contains(data.Type));
             }
             catch (Exception ex)
             {
                 if (ex != null)
                 {
                 }
                 return false;
             }
         });
     }));
 }
Exemple #4
0
 public async Task <object> ListSpells()
 {
     return(await TakePostAction <SpellListRequest>((res, data) =>
     {
         res.Data = LocalRemoteConverter.CreateRemoteSpellList(m =>
         {
             try
             {
                 return m.Name.ContainsOrNullIgnoreCase(data.Name) &&
                 (data.IsCustom == null || m.IsCustom == data.IsCustom) &&
                 (data.School == null || m.school.Equals(data.School, StringComparison.CurrentCultureIgnoreCase)) &&
                 m.subschool.ContainsOrNullIgnoreCase(data.Subschool);
             }
             catch (Exception ex)
             {
                 if (ex != null)
                 {
                 }
                 return false;
             }
         });
     }));
 }