cldupland 5 years ago
commit 9e43bbfc54

Binary file not shown.

@ -27,6 +27,15 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MvvmCross.Plugins.BLE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.BLE.2.1.1\lib\netstandard2.0\MvvmCross.Plugins.BLE.dll</HintPath>
</Reference>
<Reference Include="Plugin.BLE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Plugin.BLE.2.1.1\lib\netstandard2.0\Plugin.BLE.dll</HintPath>
</Reference>
<Reference Include="Plugin.BLE.Abstractions, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Plugin.BLE.2.1.1\lib\netstandard2.0\Plugin.BLE.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MvvmCross.Plugin.BLE" version="2.1.1" targetFramework="net472" />
<package id="NUnit" version="3.12.0" targetFramework="net472" />
<package id="Plugin.BLE" version="2.1.1" targetFramework="net472" />
<package id="TouchTracking" version="1.1.0" targetFramework="net472" />
<package id="TouchTracking.Forms" version="1.1.0" targetFramework="net472" />
<package id="Xamarin.Forms" version="3.0.0.446417" targetFramework="net472" />

@ -6,6 +6,7 @@ using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Xamarin.Forms;
namespace TheGameExtreme.Droid
{
@ -30,5 +31,7 @@ namespace TheGameExtreme.Droid
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}

@ -3,6 +3,13 @@
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:icon="@drawable/TrierImageB" android:label="OrderStacks"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
</manifest>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@ -48,6 +48,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="Mono.Android.Export" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -56,6 +57,9 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Plugin.BLE">
<Version>2.1.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using Foundation;
using UIKit;
namespace TheGameExtreme.iOS
@ -20,6 +16,7 @@ namespace TheGameExtreme.iOS
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();

@ -19,6 +19,24 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIBackgroundModes</key>
<array>
<!--for connecting to devices (client)-->
<string>bluetooth-central</string>
<!--for server configurations if needed-->
<string>bluetooth-peripheral</string>
</array>
<!--Description of the Bluetooth request message (required on iOS 10, deprecated)-->
<key>NSBluetoothPeripheralUsageDescription</key>
<string>YOUR CUSTOM MESSAGE</string>
<!--Description of the Bluetooth request message (required on iOS 13)-->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Wallah</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<key>CFBundleDisplayName</key>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 360 KiB

@ -137,6 +137,9 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MvvmCross.Plugin.BLE">
<Version>2.1.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.709249" />
<PackageReference Include="Xamarin.Essentials" Version="1.2.0" />
<PackageReference Include="SkiaSharp.Views.Forms">

@ -11,6 +11,7 @@ namespace TheGameExtreme.IO
static string pathPlayers = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NbPlayers.xml");
static string pathGameModeValue = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "GameModeValue.xml");
static string pathNbStacks = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NbStacks.xml");
static string pathNbCards = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NbCards.xml");
public static void SaveParamaterGamePreparationNbPlayers(int nbPlayers)
{
@ -87,5 +88,30 @@ namespace TheGameExtreme.IO
return 0;
}
}
public static void SaveParameterGamePreparationNbCards(int nbCard)
{
XmlSerializer xs = new XmlSerializer(typeof(int));
TextWriter tw = new StreamWriter(pathNbCards);
xs.Serialize(tw, nbCard);
tw.Close();
}
public static int LoadParameterGamePreparationNbCards()
{
XmlSerializer xs = new XmlSerializer(typeof(int));
try
{
using (FileStream fs = new FileStream(pathNbCards, FileMode.Open))
{
int nbCards = (int)xs.Deserialize(fs);
return nbCards;
}
}
catch
{
return 0;
}
}
}
}

@ -6,6 +6,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MvvmCross" Version="6.4.1" />
<PackageReference Include="MvvmCross.Plugin.BLE" Version="2.1.1" />
<PackageReference Include="Plugin.BLE" Version="2.1.1" />
<PackageReference Include="System.Drawing.Common" Version="4.6.1" />
<PackageReference Include="Xamarin.Forms" Version="4.3.0.991211" />
<PackageReference Include="Xamarin.Essentials" Version="1.3.1" />

@ -12,6 +12,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="10*" />
<RowDefinition Height="90*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*" />
@ -99,8 +100,9 @@
</StackLayout>
<StackLayout
Grid.Row="2"
Margin="0,0,10,0">
Grid.Row="0"
Grid.Column="2"
Margin="0,0,20,0">
<Label Text="Nombre de pile en jeu :"
TextColor="{DynamicResource WhiteColor}"
@ -117,6 +119,26 @@
VerticalOptions="Center"/>
</StackLayout>
<StackLayout
Grid.Row="1"
Grid.Column="2"
Margin="0,0,20,0">
<Label Text="Nombre de cartes:"
TextColor="{DynamicResource WhiteColor}"
FontSize="16"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Center"/>
<Picker x:Name="SelectNbCard"
BackgroundColor="{DynamicResource SkyBlueColor}"
Margin="0,0,10,0"
MinimumWidthRequest="30"
WidthRequest="100"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</StackLayout>
</Grid>
@ -155,6 +177,7 @@
MinimumWidthRequest="50"
WidthRequest="200"/>
</StackLayout>
</Grid>

@ -10,6 +10,7 @@ namespace TheGameExtreme.view
public List<int> listNbPlayer = new List<int> { 1, 2, 3, 4, 5 };
public List<string> listGameMode = new List<string> { "entières", "relatives", "décimales", "dizaines", "centaines", "millièmes", "fractionnées" };
public List<int> listNbStack = new List<int> { 4, 6, 8 };
public List<int> listNbCard = new List<int> { 100, 80, 60, 40 };
public GamePreparationPage()
@ -26,6 +27,9 @@ namespace TheGameExtreme.view
SelectNbStack.ItemsSource = listNbStack;
LoadParameterNbStacksGamePreparation();
SelectNbCard.ItemsSource = listNbCard;
LoadParameterNbCardsGamePreparation();
}
@ -35,6 +39,7 @@ namespace TheGameExtreme.view
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
await Navigation.PopAsync();
}
protected override bool OnBackButtonPressed()
@ -42,6 +47,7 @@ namespace TheGameExtreme.view
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
return base.OnBackButtonPressed();
}
@ -62,6 +68,7 @@ namespace TheGameExtreme.view
IOGamePreparation.SaveParamaterGamePreparationNbPlayers(PlayerSelecter.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationGameModeValue(SelectMode.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbStacks(SelectNbStack.SelectedIndex);
IOGamePreparation.SaveParameterGamePreparationNbCards(SelectNbCard.SelectedIndex);
await Navigation.PushAsync(new MainPage(playersNames, (int)SelectNbStack.SelectedItem, (int)SelectMode.SelectedIndex));
}
@ -108,6 +115,11 @@ namespace TheGameExtreme.view
int nbStackSer = IOGamePreparation.LoadParamaterGamePreparationNbStacks();
SelectNbStack.SelectedIndex = nbStackSer;
}
public void LoadParameterNbCardsGamePreparation()
{
int nbCards = IOGamePreparation.LoadParameterGamePreparationNbCards();
SelectNbCard.SelectedIndex = nbCards;
}

@ -82,6 +82,8 @@
</Grid>
</Grid>
</ContentPage>

@ -19,7 +19,6 @@
<ImageButton Source="ArrowSettingsBack.png"
Margin="15,15,0,0"
Clicked="BackMulti_Clicked"
BackgroundColor="Transparent"
VerticalOptions="StartAndExpand"
HorizontalOptions="Start"
@ -33,7 +32,7 @@
HorizontalTextAlignment="Center"
Grid.Column="1" Grid.Row="0"/>
<Button Text="Connexion Bluetooth"
<!--<Button Text="Connexion Bluetooth"
Grid.Row="1"
Grid.Column="1"
WidthRequest="230"
@ -51,8 +50,30 @@
VerticalOptions="Center"
HorizontalOptions="Center"
CornerRadius="10"
BackgroundColor="{DynamicResource SkyBlueColor}"/>-->
<!--<Button Text="bouton statue"
Clicked="BtnStatueClicked"
Grid.Row="1"
Grid.Column="0"
WidthRequest="230"
HeightRequest="57"
VerticalOptions="Center"
HorizontalOptions="Center"
CornerRadius="10"
BackgroundColor="{DynamicResource SkyBlueColor}"/>
<Button Text="bouton scan"
Clicked="BtnScanClicked"
Grid.Row="1"
Grid.Column="1"
WidthRequest="230"
HeightRequest="57"
VerticalOptions="Center"
HorizontalOptions="Center"
CornerRadius="10"
BackgroundColor="{DynamicResource SkyBlueColor}"/>-->
</Grid>
</ContentPage>

@ -1,21 +1,55 @@
using System;
using System.Collections.Generic;
using MvvmCross;
using Plugin.BLE;
using Plugin.BLE.Abstractions.Contracts;
using System;
using System.Collections.ObjectModel;
using Xamarin.Forms;
namespace TheGameExtreme.view
{
public partial class MultiPlayerMode : ContentPage
{
/*IBluetoothLE ble;
IAdapter adapter;
ObservableCollection<IDevice> devicesList;
IDevice device;*/
public MultiPlayerMode()
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
/*ble = CrossBluetoothLE.Current;
adapter = CrossBluetoothLE.Current.Adapter;
devicesList = new ObservableCollection<IDevice>();*/
}
private async void BackMulti_Clicked(object sender, EventArgs e)
/*private async void BackMulti_Clicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
public void BtnStatueClicked(object sender, EventArgs args)
{
var state = ble.State;
this.DisplayAlert("Notice", state.ToString(), "ok");
}
public async void BtnScanClicked(object sender, EventArgs args)
{
devicesList.Clear();
adapter.DeviceDiscovered += (s, a) =>
{
devicesList.Add(a.Device);
};
if (!ble.Adapter.IsScanning)
{
await adapter.StartScanningForDevicesAsync();
}
}*/
}
}

@ -45,6 +45,15 @@
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="MvvmCross.Plugins.BLE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MvvmCross.Plugin.BLE.2.1.1\lib\netstandard2.0\MvvmCross.Plugins.BLE.dll</HintPath>
</Reference>
<Reference Include="Plugin.BLE, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Plugin.BLE.2.1.1\lib\netstandard2.0\Plugin.BLE.dll</HintPath>
</Reference>
<Reference Include="Plugin.BLE.Abstractions, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Plugin.BLE.2.1.1\lib\netstandard2.0\Plugin.BLE.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>

@ -2,4 +2,6 @@
<packages>
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
<package id="MvvmCross.Plugin.BLE" version="2.1.1" targetFramework="net472" />
<package id="Plugin.BLE" version="2.1.1" targetFramework="net472" />
</packages>
Loading…
Cancel
Save