mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
Nettoyage
This commit is contained in:
parent
aa88df78ad
commit
7b1bb89777
7 changed files with 50 additions and 67 deletions
|
|
@ -26,7 +26,6 @@ namespace AideDeJeu.Droid
|
||||||
|
|
||||||
public static void UpdateIdValues()
|
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;
|
global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::AideDeJeu.Droid.Resource.Attribute.actionBarSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,9 @@
|
||||||
using AideDeJeu.Tools;
|
using AideDeJeu.Tools;
|
||||||
using AideDeJeuLib.Spells;
|
using AideDeJeuLib.Monsters;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using System.Reactive.Linq;
|
|
||||||
using AideDeJeuLib.Monsters;
|
|
||||||
|
|
||||||
namespace AideDeJeu.ViewModels
|
namespace AideDeJeu.ViewModels
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using System.Reactive.Linq;
|
|
||||||
|
|
||||||
namespace AideDeJeu.ViewModels
|
namespace AideDeJeu.ViewModels
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
>
|
>
|
||||||
<MasterDetailPage.Master>
|
<MasterDetailPage.Master>
|
||||||
<ContentPage Title=" ">
|
<ContentPage Title=" ">
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
<StackLayout Orientation="Vertical" Padding="15">
|
<StackLayout Orientation="Vertical" Padding="15">
|
||||||
<!--<StackLayout Orientation="Horizontal">
|
<!--<StackLayout Orientation="Horizontal">
|
||||||
<Button Clicked="OnPlay" Image="ic_play.png" />
|
<Button Clicked="OnPlay" Image="ic_play.png" />
|
||||||
|
|
@ -54,6 +55,7 @@
|
||||||
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
||||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</MasterDetailPage.Master>
|
</MasterDetailPage.Master>
|
||||||
<MasterDetailPage.Detail>
|
<MasterDetailPage.Detail>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
>
|
>
|
||||||
<MasterDetailPage.Master>
|
<MasterDetailPage.Master>
|
||||||
<ContentPage Title=" ">
|
<ContentPage Title=" ">
|
||||||
|
<ScrollView Orientation="Vertical">
|
||||||
<StackLayout Orientation="Vertical" Padding="15">
|
<StackLayout Orientation="Vertical" Padding="15">
|
||||||
<!--<StackLayout Orientation="Horizontal">
|
<!--<StackLayout Orientation="Horizontal">
|
||||||
<Button Clicked="OnPlay" Image="ic_play.png" />
|
<Button Clicked="OnPlay" Image="ic_play.png" />
|
||||||
|
|
@ -45,6 +46,7 @@
|
||||||
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
||||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</MasterDetailPage.Master>
|
</MasterDetailPage.Master>
|
||||||
<MasterDetailPage.Detail>
|
<MasterDetailPage.Detail>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="akavache.core" Version="5.0.0" />
|
|
||||||
<PackageReference Include="AkavacheLite" Version="0.3.0" />
|
|
||||||
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
|
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
using Akavache;
|
using HtmlAgilityPack;
|
||||||
using HtmlAgilityPack;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Reactive.Linq;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
|
@ -28,8 +26,6 @@ namespace AideDeJeuLib.Spells
|
||||||
string html = null;
|
string html = null;
|
||||||
using (var client = GetHttpClient())
|
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/
|
// 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));
|
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;
|
return spells;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Spell> GetSpellFromSource(string id)
|
public async Task<Spell> GetSpell(string id)
|
||||||
{
|
{
|
||||||
string html = null;
|
string html = null;
|
||||||
using (var client = GetHttpClient())
|
using (var client = GetHttpClient())
|
||||||
{
|
{
|
||||||
// https://www.aidedd.org/dnd/sorts.php?vo=ray-of-frost
|
// 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/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));
|
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);
|
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)
|
public async Task<IEnumerable<string>> GetSpellIds(string classe, int niveauMin = 0, int niveauMax = 9)
|
||||||
{
|
{
|
||||||
string html = null;
|
string html = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue