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()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System.Diagnostics;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace AideDeJeu.ViewModels
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,52 +8,54 @@
|
|||
>
|
||||
<MasterDetailPage.Master>
|
||||
<ContentPage Title=" ">
|
||||
<StackLayout Orientation="Vertical" Padding="15">
|
||||
<!--<StackLayout Orientation="Horizontal">
|
||||
<ScrollView Orientation="Vertical">
|
||||
<StackLayout Orientation="Vertical" Padding="15">
|
||||
<!--<StackLayout Orientation="Horizontal">
|
||||
<Button Clicked="OnPlay" Image="ic_play.png" />
|
||||
<Button Clicked="OnStop" Image="ic_stop.png" />
|
||||
</StackLayout>-->
|
||||
<!--<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
||||
<!--<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextCell Text="{Binding Title}" TextColor="Black" Command="{Binding Path=BindingContext.OpenUrl, Source={x:Reference Name=This}}" CommandParameter="{Binding Url}" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>-->
|
||||
<!--<Label Text="Liste" />
|
||||
<!--<Label Text="Liste" />
|
||||
<Picker HorizontalOptions="FillAndExpand">
|
||||
<Picker.Items>
|
||||
<x:String>Sorts</x:String>
|
||||
</Picker.Items>
|
||||
</Picker>-->
|
||||
|
||||
<Label Text="Catégorie" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Categories, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Category}" />
|
||||
<Label Text="Catégorie" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Categories, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Category}" />
|
||||
|
||||
<Label Text="Type" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Types, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Type}" />
|
||||
<Label Text="Type" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Types, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Type}" />
|
||||
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<Label Text="FP minimum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Powers, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding MinPower}" />
|
||||
<StackLayout Orientation="Horizontal">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<Label Text="FP minimum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Powers, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding MinPower}" />
|
||||
</StackLayout>
|
||||
|
||||
<StackLayout Orientation="Vertical">
|
||||
<Label Text="FP maximum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Powers, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding MaxPower}" />
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
|
||||
<StackLayout Orientation="Vertical">
|
||||
<Label Text="FP maximum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Powers, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding MaxPower}" />
|
||||
</StackLayout>
|
||||
<Label Text="Taille" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sizes, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Size}" />
|
||||
|
||||
<Label Text="Légendaire" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Legendaries, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Legendary}" />
|
||||
|
||||
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
||||
</StackLayout>
|
||||
|
||||
<Label Text="Taille" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sizes, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Size}" />
|
||||
|
||||
<Label Text="Légendaire" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Legendaries, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Legendary}" />
|
||||
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -8,43 +8,45 @@
|
|||
>
|
||||
<MasterDetailPage.Master>
|
||||
<ContentPage Title=" ">
|
||||
<StackLayout Orientation="Vertical" Padding="15">
|
||||
<!--<StackLayout Orientation="Horizontal">
|
||||
<ScrollView Orientation="Vertical">
|
||||
<StackLayout Orientation="Vertical" Padding="15">
|
||||
<!--<StackLayout Orientation="Horizontal">
|
||||
<Button Clicked="OnPlay" Image="ic_play.png" />
|
||||
<Button Clicked="OnStop" Image="ic_stop.png" />
|
||||
</StackLayout>-->
|
||||
<!--<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
||||
<!--<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextCell Text="{Binding Title}" TextColor="Black" Command="{Binding Path=BindingContext.OpenUrl, Source={x:Reference Name=This}}" CommandParameter="{Binding Url}" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>-->
|
||||
<!--<Label Text="Liste" />
|
||||
<!--<Label Text="Liste" />
|
||||
<Picker HorizontalOptions="FillAndExpand">
|
||||
<Picker.Items>
|
||||
<x:String>Sorts</x:String>
|
||||
</Picker.Items>
|
||||
</Picker>-->
|
||||
|
||||
<Label Text="Classe" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Classes, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Classe}" />
|
||||
<Label Text="Classe" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Classes, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Classe}" />
|
||||
|
||||
<Label Text="Niveau minimum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Niveaux, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding NiveauMin}" />
|
||||
<Label Text="Niveau minimum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Niveaux, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding NiveauMin}" />
|
||||
|
||||
<Label Text="Niveau maximum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Niveaux, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding NiveauMax}" />
|
||||
<Label Text="Niveau maximum" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Niveaux, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding NiveauMax}" />
|
||||
|
||||
<Label Text="École" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Ecoles, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Ecole}" />
|
||||
<Label Text="École" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Ecoles, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Ecole}" />
|
||||
|
||||
<Label Text="Rituel" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Rituels, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Rituel}" />
|
||||
<Label Text="Rituel" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Rituels, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Rituel}" />
|
||||
|
||||
<Label Text="Source" Style="{StaticResource Key=subsubsection}" />
|
||||
<Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding Sources, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Source}" />
|
||||
</StackLayout>
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue