diff --git a/TheGameExtreme.sln b/TheGameExtreme.sln index 0701b18..1a37b29 100644 --- a/TheGameExtreme.sln +++ b/TheGameExtreme.sln @@ -24,6 +24,7 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|iPhone.ActiveCfg = Debug|Any CPU {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|iPhone.Build.0 = Debug|Any CPU {DD6C4FD6-058C-41F9-824F-84DABA5DD444}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU diff --git a/TheGameExtreme/AppRessource.Designer.cs b/TheGameExtreme/AppRessource.Designer.cs index d02341d..3b25acb 100644 --- a/TheGameExtreme/AppRessource.Designer.cs +++ b/TheGameExtreme/AppRessource.Designer.cs @@ -79,7 +79,7 @@ namespace TheGameExtreme { } /// - /// Recherche une chaîne localisée semblable à Vous n'avez pas joué assez de carte!. + /// Recherche une chaîne localisée semblable à Vous n'avez pas joué assez de carte! essaye encore. /// internal static string StrCardPlayedLessThanTwo { get { @@ -114,6 +114,15 @@ namespace TheGameExtreme { } } + /// + /// Recherche une chaîne localisée semblable à Le jeu est fini! Veuillez lancer une nouvelle partie!. + /// + internal static string StrEndOfGame { + get { + return ResourceManager.GetString("StrEndOfGame", resourceCulture); + } + } + /// /// Recherche une chaîne localisée semblable à Fin de tour. /// diff --git a/TheGameExtreme/AppRessource.resx b/TheGameExtreme/AppRessource.resx index 64a8bf6..ada4757 100644 --- a/TheGameExtreme/AppRessource.resx +++ b/TheGameExtreme/AppRessource.resx @@ -125,7 +125,7 @@ La pile choisie n'existe pas! - Vous n'avez pas joué assez de carte! + Vous n'avez pas joué assez de carte! essaye encore Veuillez selectionner une carte à placer sur une pile @@ -139,6 +139,9 @@ Pile Descendante String to indicate an down stack + + Le jeu est fini! Veuillez lancer une nouvelle partie! + Fin de tour Button to end turn diff --git a/TheGameExtreme/AppRessources-br.Designer.cs b/TheGameExtreme/AppRessources-br.Designer.cs new file mode 100644 index 0000000..0958a53 --- /dev/null +++ b/TheGameExtreme/AppRessources-br.Designer.cs @@ -0,0 +1,189 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace TheGameExtreme { + using System; + + + /// + /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// + // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder + // à l'aide d'un outil, tel que ResGen ou Visual Studio. + // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen + // avec l'option /str ou régénérez votre projet VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AppRessources_br { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AppRessources_br() { + } + + /// + /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TheGameExtreme.AppRessources-br", typeof(AppRessources_br).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Remplace la propriété CurrentUICulture du thread actuel pour toutes + /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Recherche une chaîne localisée semblable à rising stack. + /// + internal static string StrAcendingStack { + get { + return ResourceManager.GetString("StrAcendingStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à the chosen pile does not exist. + /// + internal static string StrCantGetStack { + get { + return ResourceManager.GetString("StrCantGetStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à You have not played enough cards!. + /// + internal static string StrCardPlayedLessThanTwo { + get { + return ResourceManager.GetString("StrCardPlayedLessThanTwo", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Please select a card to place on a stack. + /// + internal static string StrChooseCardToPlay { + get { + return ResourceManager.GetString("StrChooseCardToPlay", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Select the stack on which you want to put the card. + /// + internal static string StrChooseStack { + get { + return ResourceManager.GetString("StrChooseStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Down stack. + /// + internal static string StrDownStack { + get { + return ResourceManager.GetString("StrDownStack", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à End of turn. + /// + internal static string StrEndTurn { + get { + return ResourceManager.GetString("StrEndTurn", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à . + /// + internal static string String1 { + get { + return ResourceManager.GetString("String1", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à The game is over! Sorry, you lost ... Try again!. + /// + internal static string StrLose { + get { + return ResourceManager.GetString("StrLose", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à The game is over! Sorry, you lost ... You had to play three cards because of the effect \ "Three cards played \" off your game does not play as much! Try again!. + /// + internal static string StrLose3CardEffect { + get { + return ResourceManager.GetString("StrLose3CardEffect", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à The player has no more cards in his hand. + /// + internal static string StrNoMoreCardOnHand { + get { + return ResourceManager.GetString("StrNoMoreCardOnHand", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à Sorry, you did not cover the skull ... Try again;). + /// + internal static string StrSkullEffect { + get { + return ResourceManager.GetString("StrSkullEffect", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à The game is over! Well done you won!. + /// + internal static string StrWin { + get { + return ResourceManager.GetString("StrWin", resourceCulture); + } + } + + /// + /// Recherche une chaîne localisée semblable à The card does not fit in the selected stack!. + /// + internal static string StrWrongStack { + get { + return ResourceManager.GetString("StrWrongStack", resourceCulture); + } + } + } +} diff --git a/TheGameExtreme/AppRessources.br.resx b/TheGameExtreme/AppRessources-br.resx similarity index 99% rename from TheGameExtreme/AppRessources.br.resx rename to TheGameExtreme/AppRessources-br.resx index ad114eb..8f9ac32 100644 --- a/TheGameExtreme/AppRessources.br.resx +++ b/TheGameExtreme/AppRessources-br.resx @@ -143,6 +143,9 @@ End of turn Button to end turn + + + The game is over! Sorry, you lost ... Try again! diff --git a/TheGameExtreme/TheGameExtreme.csproj b/TheGameExtreme/TheGameExtreme.csproj index 7f44d32..c42e40e 100644 --- a/TheGameExtreme/TheGameExtreme.csproj +++ b/TheGameExtreme/TheGameExtreme.csproj @@ -12,7 +12,6 @@ - @@ -25,12 +24,33 @@ + + ResXFileCodeGenerator + AppRessource.Designer.cs + + + ResXFileCodeGenerator + AppRessources-br.Designer.cs + PublicResXFileCodeGenerator AppResources.Designer.cs + + MSBuild:UpdateDesignTimeXaml + + + True + True + AppRessource.resx + + + True + True + AppRessources-br.resx + AppResources.resx diff --git a/TheGameExtreme/model/manager/GameManager.cs b/TheGameExtreme/model/manager/GameManager.cs index e3a233a..57778ad 100644 --- a/TheGameExtreme/model/manager/GameManager.cs +++ b/TheGameExtreme/model/manager/GameManager.cs @@ -21,6 +21,7 @@ namespace TheGameExtreme.model.manager public List CurrentHand { get; set; } protected int nbCardAtBeginOfTurn; protected List CurrentCardPlayed = new List(); + protected string langue; public GameManager(int nbPlayer, List players) @@ -30,6 +31,7 @@ namespace TheGameExtreme.model.manager this.nbPlayer = nbPlayer; players.ForEach(player => playerList.Add(new Player(player))); + ListOrderedStacks.Add(new Stack()); ListOrderedStacks.Add(new Stack()); @@ -128,7 +130,8 @@ namespace TheGameExtreme.model.manager { if (EndMessage != null) { - throw new Exception("Le jeu est fini! Veuillez lancer une nouvelle partie!"); + //throw new Exception("Le jeu est fini! Veuillez lancer une nouvelle partie!"); + throw new Exception(AppRessource.StrEndOfGame); } foreach(Card card in CurrentHand) { @@ -147,7 +150,7 @@ namespace TheGameExtreme.model.manager } else { - throw new Exception("La pile choisie n'existe pas!"); + throw new Exception(AppRessource.StrCantGetStack); } return; } @@ -166,7 +169,7 @@ namespace TheGameExtreme.model.manager } else { - throw new Exception("La carte ne rentre pas dans la pile sectionné!"); + throw new Exception(AppRessource.StrWrongStack); } } diff --git a/TheGameExtreme/model/manager/SoloGameManager.cs b/TheGameExtreme/model/manager/SoloGameManager.cs index 6f031ad..9d196be 100644 --- a/TheGameExtreme/model/manager/SoloGameManager.cs +++ b/TheGameExtreme/model/manager/SoloGameManager.cs @@ -66,8 +66,8 @@ namespace TheGameExtreme.model.manager } else { - throw new Exception("Vous n'avez pas joué assez de carte!"); - throw new Exception(AppRessource.StrCardPlayedLessThanTwo); + //throw new Exception("Vous n'avez pas joué assez de carte!"); + throw new Exception(AppRessources_br.StrCardPlayedLessThanTwo); } } diff --git a/TheGameExtreme/view/HomePage.xaml b/TheGameExtreme/view/HomePage.xaml new file mode 100644 index 0000000..4ce4767 --- /dev/null +++ b/TheGameExtreme/view/HomePage.xaml @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/TheGameExtreme/view/HomePage.xaml.cs b/TheGameExtreme/view/HomePage.xaml.cs new file mode 100644 index 0000000..8572dd1 --- /dev/null +++ b/TheGameExtreme/view/HomePage.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace TheGameExtreme.view +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class HomePage : ContentView + { + public HomePage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/UnitTestProjectGame/UnitTest1.cs b/UnitTestProjectGame/UnitTest1.cs index a79c9e9..4fe1452 100644 --- a/UnitTestProjectGame/UnitTest1.cs +++ b/UnitTestProjectGame/UnitTest1.cs @@ -61,7 +61,7 @@ namespace UnitTestProjectGame bool valueExpected = false; bool valueExpected1 = true; bool valueBool; - int nbCardplayed = 2; + valueBool = g1.endTurn(); try {