1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 14:35:45 +00:00

Nettoyage

This commit is contained in:
Yan Maniez 2018-04-30 23:09:22 +02:00
parent aa88df78ad
commit 7b1bb89777
7 changed files with 50 additions and 67 deletions

View file

@ -26,7 +26,6 @@ namespace AideDeJeu.Droid
public static void UpdateIdValues()
{
global::Splat.Resource.String.library_name = global::AideDeJeu.Droid.Resource.String.library_name;
global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::AideDeJeu.Droid.Resource.Attribute.actionBarSize;
}

View file

@ -1,12 +1,9 @@
using AideDeJeu.Tools;
using AideDeJeuLib.Spells;
using AideDeJeuLib.Monsters;
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Reactive.Linq;
using AideDeJeuLib.Monsters;
namespace AideDeJeu.ViewModels
{

View file

@ -5,7 +5,6 @@ using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Reactive.Linq;
namespace AideDeJeu.ViewModels
{

View file

@ -8,6 +8,7 @@
>
<MasterDetailPage.Master>
<ContentPage Title=" ">
<ScrollView Orientation="Vertical">
<StackLayout Orientation="Vertical" Padding="15">
<!--<StackLayout Orientation="Horizontal">
<Button Clicked="OnPlay" Image="ic_play.png" />
@ -54,6 +55,7 @@
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
</StackLayout>
</ScrollView>
</ContentPage>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>

View file

@ -8,6 +8,7 @@
>
<MasterDetailPage.Master>
<ContentPage Title=" ">
<ScrollView Orientation="Vertical">
<StackLayout Orientation="Vertical" Padding="15">
<!--<StackLayout Orientation="Horizontal">
<Button Clicked="OnPlay" Image="ic_play.png" />
@ -45,6 +46,7 @@
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
</StackLayout>
</ScrollView>
</ContentPage>
</MasterDetailPage.Master>
<MasterDetailPage.Detail>

View file

@ -5,8 +5,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="akavache.core" Version="5.0.0" />
<PackageReference Include="AkavacheLite" Version="0.3.0" />
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
</ItemGroup>

View file

@ -1,10 +1,8 @@
using Akavache;
using HtmlAgilityPack;
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@ -28,8 +26,6 @@ namespace AideDeJeuLib.Spells
string html = null;
using (var client = GetHttpClient())
{
// https://www.aidedd.org/dnd/sorts.php?vo=ray-of-frost
// https://www.aidedd.org/dnd/sorts.php?vf=rayon-de-givre
// https://www.aidedd.org/regles/sorts/
html = await client.GetStringAsync(string.Format("https://www.aidedd.org/regles/sorts/?c={0}&min=1{1}&max=1{2}&e={3}&r={4}&s={5}", classe, niveauMin, niveauMax, ecole, rituel, source));
@ -59,14 +55,13 @@ namespace AideDeJeuLib.Spells
return spells;
}
public async Task<Spell> GetSpellFromSource(string id)
public async Task<Spell> GetSpell(string id)
{
string html = null;
using (var client = GetHttpClient())
{
// https://www.aidedd.org/dnd/sorts.php?vo=ray-of-frost
// https://www.aidedd.org/dnd/sorts.php?vf=rayon-de-givre
// https://www.aidedd.org/regles/sorts/
html = await client.GetStringAsync(string.Format("https://www.aidedd.org/dnd/sorts.php?vf={0}", id));
}
@ -76,15 +71,6 @@ namespace AideDeJeuLib.Spells
return Spell.FromHtml(divSpell);
}
public async Task<Spell> GetSpell(string id)
{
BlobCache.ApplicationName = "AkavacheExperiment";
//await BlobCache.UserAccount.InsertObject(id, newSpell);
var spell = await BlobCache.LocalMachine.GetOrFetchObject<Spell>(id, () => GetSpellFromSource(id));
await BlobCache.LocalMachine.Flush();
return spell;
}
public async Task<IEnumerable<string>> GetSpellIds(string classe, int niveauMin = 0, int niveauMax = 9)
{
string html = null;