diff --git a/APropos.rb b/APropos.rb new file mode 100644 index 00000000..2c7b9b7d --- /dev/null +++ b/APropos.rb @@ -0,0 +1,56 @@ +require 'gtk3' + +## +# Cette classe représente le menu A Propos +class APropos < Gtk::Window + + # Constructeur du menu A propos + def initialize(menu) + super() + + set_title "A Propos" + set_resizable(true) + signal_connect "destroy" do + menu.set_sensitive(true) + self.destroy + + end + + set_default_size 500, 400 + + set_window_position Gtk::WindowPosition::CENTER + + title = "A Propos\n" + texte = "Créé par le groupe 4\n\n Aaron Amani \n Axel Jourry \n Clement Janvier \n Cindy Calvados \n Collins Soares \n Florian Dreux \n Rayyan Lajnef \n Thomas Malabry \n Willhem Liban \n" + + boxMenu = Gtk::Box.new(:vertical, 6) + + textTitle = Gtk::Label.new("A Propos") + textTitle.set_markup(title) + textTitle.set_justify(Gtk::Justification::CENTER) + + textepro = Gtk::Label.new() + textepro.set_markup(texte) + textepro.set_justify(Gtk::Justification::CENTER) + + # Creation d'un nouveau fichier permettant de gérer le CSS + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + .about { + background-color: #F8DDD7; + } + CSS + + # Ajout de la classe CSS a la box + boxMenu.style_context.add_class('about') + # Lien entre la box et le fichier css afin que le css puisse être appliqué + boxMenu.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + boxMenu.add(textTitle) + boxMenu.add(textepro) + + add(boxMenu) + + show_all + end +end diff --git a/Aide.rb b/Aide.rb new file mode 100644 index 00000000..46f6df09 --- /dev/null +++ b/Aide.rb @@ -0,0 +1,287 @@ +require 'gtk3' + +load 'HashiGrid.rb' +load "Ile.rb" +load "Pont.rb" + +## +# Cette classe correspond à l'aide du jeu +class Aide + + # @id -> Id de l'aide + # @grille -> Grille dans laquelle l'aide est utile + # @nb_voisins -> Nombre de voisins de chaque sommet de la grille + # @position -> Case concernée par l'aide + + + # Identifiant correspondant a l'état dans laquelle se trouve le plateau + attr_reader :id + + # Constructeur du menu Aide + # * +grille+ grille dans laquelle l'aide doit opérer + def initialize(grille) + @grille = grille + @nb_voisins = Array.new(@grille.sommets.size) + @id = 0 + end + + # Méthode permettant de definir un cas en fonction de l'etat du tableau + def lireId + @id = definirCas() + return self + end + + # Méthode permettant d'obtenir le message d'aide correspondant un id + def getMessageAide + self.lireId() + file = File.readlines("AideTexte.txt") + file.each do |line| + temp = line.split(':') + if( temp[0] == @id.to_s ) + return temp[1] + end + end + end + + + # Méthode responsable de l'analyse de la grille ainsi que de ses sommets + # afin de déduire le cas dans lequel on se trouve. + def definirCas() + @grille.sommets.each_with_index do |x, i| + @nb_voisins[i] = x.compterVoisins() + end + if estCas1?() + return 1 + elsif estCas2?() + return 2 + elsif estCas3?() + return 3 + elsif estCas4?() + return 4 + elsif estCas5?() + return 5 + elsif estCas6?() + return 6 + elsif estCas7?() + return 7 + elsif estCas8?() + return 8 + elsif estCas9?() + return 9 + elsif estCas10?() + return 10 + elsif estCas11?() + return 11 + elsif estCas12?() + return 12 + elsif estCas13?() + return 13 + elsif estCas14?() + return 14 + else + return 0 + end + end + + # VALIDE + def estCas1?() + @grille.sommets.each_with_index do |x, i| + if @nb_voisins[i] == 1 && x.pontRestants() != x.degreeMax + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + + # Cas 2 : île avec une seule île voisine restante dans la grille + def estCas2?() + @grille.sommets.each_with_index do |x, i| + + if x.compterVoisinsNonComplets() == 1 && x.pontRestants() != x.degreeMax + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 3 : île à 8 restante dans la grille + def estCas3?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 8 && x.pontRestants() != x.degreeMax + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 4 : île à 6 avec 3 îles voisines restante dans la grille + def estCas4?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 6 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 5 : île à 4 avec 2 îles voisines restante dans la grille + def estCas5?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 4 && @nb_voisins[i] == 2 && x.pontRestants() != x.degreeMax + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 6 : île à 4 avec deux des îles voisines à 1 + def estCas6?() + compteur = 0 + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 4 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax + x.getVoisins().each do |v| + compteur = 0 + if v.degreeMax == 1 + compteur += 1 + end + end + if compteur == 2 + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + end + return false + end + + # Cas 7 : île à 5 avec trois îles voisines restante dans la grille + def estCas7?() + compteur = 0 + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 5 && @nb_voisins[i] == 3 && !x.pontAvecVoisins() + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + + # Cas 8 : île à 3 avec deux îles voisines dont une à 1 restante dans la grille + def estCas8?() + compteur = 0 + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 3 && @nb_voisins[i] == 2 && x.pontRestants() != x.degreeMax + x.getVoisins().each do |v| + if v.degreeMax == 1 && v.connexionRestantes() != 0 + compteur += 1 + end + end + if compteur == 1 + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + end + return false + end + + + # Cas 9 : île à 7 restante dans la grille + def estCas9?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 7 && !x.pontAvecVoisins() + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 10 : île à 5 avec trois îles voisines restante dans la grille + def estCas10?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 5 && @nb_voisins[i] == 3 && !x.pontAvecVoisins() + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + + # Cas 11 : île à 3 avec deux îles voisines restante dans la grille + def estCas11?() + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 3 && @nb_voisins[i] == 2 && !x.pontAvecVoisins() + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + return false + end + + # Cas 12 : île à 6 avec deux des îles voisines à 1 + def estCas12?() + compteur = 0 + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 6 && x.pontRestants() != x.degreeMax + x.getVoisins().each do |v| + compteur = 0 + if v.degreeMax == 1 + compteur += 1 + end + end + if compteur == 2 + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + end + return false + end + + + # Cas 13 : île à 4 avec deux des îles voisines à 1 + def estCas13?() + compteur = 0 + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 4 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax + x.getVoisins().each do |v| + compteur = 0 + if v.degreeMax == 1 + compteur += 1 + end + end + if compteur == 2 + @position = @grille.get_child_at(x.column, x.row) + return true + end + end + end + return false + end + + # Cas 14 : île à 2 avec deux îles voisines dont une île à 2 restante + def estCas14?() + voisinDeux = false + @grille.sommets.each_with_index do |x, i| + if x.degreeMax == 2 && @nb_voisins[i] == 2 && x.pontRestants() == 0 + x.getVoisins().each do |v| + if v.degreeMax == 2 + @position = @grille.get_child_at(x.column, x.row) + voisinDeux = true + end + end + end + end + return voisinDeux + end + +end diff --git a/AideTexte.txt b/AideTexte.txt new file mode 100644 index 00000000..519cf79b --- /dev/null +++ b/AideTexte.txt @@ -0,0 +1,15 @@ +0:Une ile ne doit pas depasser son degre +1:Ile avec une seule ile voisine restante dans la grille +2:Ile avec une seule possibilite de connexion restante dans la grille +3:Ile a 8 restante dans la grille +4:Ile a 6 avec 3 iles voisines restante dans la grille +5:Ile a 4 avec 2 iles voisines restante dans la grille +6:Ile a 4 avec une ile voisine a 1 restante dans la grille +7:Ile a 5 avec trois iles voisines dont une a 1 restante dans la grille +8:Ile a 3 avec deux iles voisines dont une a 1 restante dans la grille +9:Ile a 7 restante dans la grille +10:Ile a 5 avec trois iles voisines restante dans la grille +11:Ile a 3 avec deux iles voisines restante dans la grille +12:Ile a 6 avec deux des iles voisines a 1 restante dans la grille +13:Ile a 4 avec deux des iles voisines a 1 restante dans la grille +14:Ile a 2 avec deux iles voisines dont une ile a 2 restante dans la grille \ No newline at end of file diff --git a/BoutonChoix.rb b/BoutonChoix.rb new file mode 100644 index 00000000..c1ee4d4d --- /dev/null +++ b/BoutonChoix.rb @@ -0,0 +1,91 @@ +require 'gtk3' + + +## +# Représentation d'un Bouton qui fait le lien entre le menu de sélection et chaque plateau qui hérite de la classe Button de Gtk +## +class BoutonChoix < Gtk::Button + + # @facile -> Variable qui permet de savoir si le bouton renvoit vers un niveau facile + # @moyen -> Variable qui permet de savoir si le bouton renvoit vers un niveau moyen + # @hard -> Variable qui permet de savoir si le bouton renvoit vers un niveau hard + # @niveau -> Variable qui correspond au PATH vers le niveau que redirige le bouton + # @x -> Coordonnée X du plateau qui correspond au niveau renvoyer par le plateau + # @y -> Coordonnée Y du plateau qui correspond au niveau renvoyer par le plateau + # @path -> Variable contenant le path complet du bouton + + + # Variable qui correspond au PATH vers le niveau que redirige le bouton + attr_reader :niveau + + # Coordonnée X du plateau qui correspond au niveau renvoyer par le plateau + attr_reader :x + + # Coordonnée Y du plateau qui correspond au niveau renvoyer par le plateau + attr_reader :y + + # Variable contenant le path complet du bouton + attr_accessor :path + + # Constructeur du bouton + # * +facile+ Variable qui permet de savoir si le bouton renvoit vers un niveau facile + # * +moyen+ Variable qui permet de savoir si le bouton renvoit vers un niveau moyen + # * +hard+ Variable qui permet de savoir si le bouton renvoit vers un niveau difficile + # * +niv+ Variable qui correspond au PATH vers le niveau que redirige le bouton + # * +x+ Coordonnée X du plateau qui correspond au niveau renvoyer par le plateau + # * +y+ Coordonnée Y du plateau qui correspond au niveau renvoyer par le plateau + def initialize(facile,moyen,hard,niv,x,y) + super() + # Charge une image correspondants au noeud + self.image = Gtk::Image.new(:file => "./Ressources/MenuSelection/btn_grille.png") + # Retire les contours + self.set_relief(Gtk::ReliefStyle::NONE) + self.always_show_image = true + + @facile=facile + @moyen=moyen + @hard=hard + @niveau=niv + @x=x + @y=y + if(self.isFacile?) + self.set_label(@x.to_s+"x"+@y.to_s) + elsif(self.isMoyen?) + self.set_label(@x.to_s+"x"+@y.to_s) + else + self.set_label(@x.to_s+"x"+@y.to_s) + end + end + + #Permet au bouton de savoir si le niveau qu'il renvoit est facile + def isFacile? + return @facile + end + #Permet au bouton de savoir si le niveau qu'il renvoit est Moyen + def isMoyen? + return @moyen + end + #Permet au bouton de savoir si le niveau qu'il renvoit est difficile + def isHard? + return @hard + end + #Getter du niveau du plateau + def getNiveau + return @niveau + end + #Getter de la coordonnée X de la grille du plateau + def getX + return @x + end + #Getter de la coordonnée Y de la grille du plateau + def getY + return @y + end + + # Méthode permettant de modifier le path d'un bouton + # * +path+ le nouveau path du bouton + def set_path(path) + @path = path + return self + end +end \ No newline at end of file diff --git a/Classement.rb b/Classement.rb new file mode 100644 index 00000000..1b66d693 --- /dev/null +++ b/Classement.rb @@ -0,0 +1,38 @@ + +require 'gtk3' +load 'MenuLayout.rb' +load 'ClassementNiveau.rb' + +## +# Cette classe représente le Classement +## +class Classement < MenuLayout + + # @menu -> Variable contenant le menu, initialisé dans MenuLayout + # @builder -> Variable contenant les propriétés d'affichage, initialisé dans MenuLayout + + # Création du Classement + def initialize + super("Classement","Classement") + + image = @builder.get_object('logo-menu') + image.from_file = "css/classement.png" + + # Lien entre le classement et chaque niveau + tableauBtn.each_index{|x| tableauBtn[x].signal_connect('clicked'){ + @menu.set_sensitive(false) + File.open(tableauBtn[x].path, 'a') + classement = ClassementNiveau.new(tableauBtn[x].path) + + classement.style_context.add_class('menu-ext') + classement.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + + classement.signal_connect('destroy') { + @menu.set_sensitive(true) + } + } + } + + @menu.show + end +end \ No newline at end of file diff --git a/Classement/Difficile/test.txt b/Classement/Difficile/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Classement/Difficile/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/Classement/Facile/test.txt b/Classement/Facile/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Classement/Facile/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/Classement/Moyen/test.txt b/Classement/Moyen/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Classement/Moyen/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/ClassementNiveau.rb b/ClassementNiveau.rb new file mode 100644 index 00000000..75ab4653 --- /dev/null +++ b/ClassementNiveau.rb @@ -0,0 +1,80 @@ + +require 'gtk3' + +## +# Cette classe représente l'affichage des résultats sur un niveau +## +class ClassementNiveau < Gtk::Window + + + # Création du Classement par Niveau + # * +nomniv+ Chemin du niveau + def initialize(nomniv) + super + set_title "Classement Niveau " + set_resizable(true) + signal_connect "destroy" do + self.destroy + end + + set_default_size 500, 400 + + set_window_position Gtk::WindowPosition::CENTER + + #Creation de zone de texte + texte = "Resultats du Niveau :\n" + texte1 = "(Temps):(Joueur)\n" + texte_0 ="" + + boxMenu = Gtk::Box.new(:vertical, 6) + + preset = Gtk::Label.new() + preset.set_markup(texte1) + textTitle = Gtk::Label.new() + textTitle.set_markup(texte) + + #Tri les lignes en fonctions des temps + tab = File.read(nomniv).split("\n") + tab = tab.sort_by{ |s| s.scan(/\d+/).first.to_i } + + #Inclu toutes les lignes du tableau tab dans une variable texte_0 pour être affiché dans une box + tab.each.with_index do |line| + texte_0 += "#{line} \n" + end + + score = Gtk::Label.new() + score.set_markup(texte_0) + + btnQuitter = Gtk::Button.new() + btnQuitter.signal_connect('clicked'){self.destroy} + btnQuitter.image = Gtk::Image.new(:file => "./Ressources/MenuSelection/back.png") + btnQuitter.halign = Gtk::Align::CENTER + btnQuitter.valign = Gtk::Align::CENTER + btnQuitter.always_show_image = true + + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + button { + all:unset; + } + + button:hover { + opacity: .6; + } + CSS + + btnQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + btnScore = Gtk::Label + + #Affichage de toutes les box + boxMenu.add(textTitle) + boxMenu.add(preset) + boxMenu.add(score) + boxMenu.add(btnQuitter) + + add(boxMenu) + + show_all + end +end diff --git a/Client.rb b/Client.rb new file mode 100644 index 00000000..af4b2d19 --- /dev/null +++ b/Client.rb @@ -0,0 +1,17 @@ + +load "Pause.rb" +load "Pont.rb" +load "HashiGrid.rb" +load "Ile.rb" +load 'Plateau.rb' +load "APropos.rb" +load "Classement.rb" +load "MenuSelection.rb" +load "Tuto.rb" +load 'BoutonChoix.rb' +load 'MainMenu.rb' + + +window = MainMenu.new + +Gtk.main diff --git a/HashiGrid.rb b/HashiGrid.rb new file mode 100644 index 00000000..4c75c7c0 --- /dev/null +++ b/HashiGrid.rb @@ -0,0 +1,494 @@ +require 'gtk3' +load "Sauvegarde.rb" +load "MainMenu.rb" +load "UndoRedo.rb" + +## +# Cette classe représente la grille +# contenant les boutons ( autrement dit les noeuds , et les +# ponts d'un point de vue graphique ) +# Il y à peu de méthode encore mais ça arrive +class HashiGrid < Gtk::Grid + + # @diff -> Attribut correspondant au niveau de difficulté de la grille + # @nomniv -> Attribut correspondant au nom du niveau + # @x -> Nombre de colonnes + # @y -> Nombre de lignes + # @undoRedo -> Attribut de type UndoRedo + # @nb_iles -> Nombres d'iles contenues dans la grille + # @sommets -> Attribut correspondant au nombre de sommets contenus dans la grille + # @nodeLink -> Tableau permettant de contenir temporairement les deux cases cliquées + # @saveManager -> Attribut de type Sauvegarde + + + + # Attribut de type Sauvegarde + attr_accessor :saveManager + + # Nombre de colonnes + attr_accessor :colonnes + + # Nombre de lignes + attr_accessor :lignes + + # Tableau permettant de contenir temporairement les deux cases + # cliquées + attr_accessor :nodeLink + + # Attribut correspondant au niveau de difficulté de la grille + attr_reader :diff + + # Attribut correspondant au nombre de sommets contenus dans la grille + attr_accessor :sommets + + # Attribut correspondant au nom du niveau + attr_reader :nomniv + + # Attribut de type UndoRedo + attr_reader :undoRedo + + # Constructeur de la grille + # * +nomniv+ Nom du niveau + # * +diff+ Difficulté du niveau + # * +x+ Nombre de colonnes + # * +y+ Nombre de lignes + def initialize(nomniv,diff, x,y) + super() + @diff = diff + @nomniv=nomniv + @x=x + @y=y + @undoRedo = UndoRedo.new + @nb_iles = 0 + @sommets = Array.new() + @nodeLink = [] + @saveManager = Sauvegarde.new(nomniv, diff) + end + + # Active le retour en arrière + def undoPrevious + if !@undoRedo.undoStack.empty? + + n2 = @undoRedo.undoStack.pop() + n1 = @undoRedo.undoStack.pop() + + @undoRedo.redoStack << n2 + @undoRedo.redoStack << n1 + + supprimePont(n2,n1, true) + end + + return self + end + + # Active le retour en avant + def redoPrevious + if !@undoRedo.redoStack.empty? + n2 = @undoRedo.redoStack.pop() + n1 = @undoRedo.redoStack.pop() + + @undoRedo.undoStack << n2 + @undoRedo.undoStack << n1 + + + ajoutPont(n2,n1) + end + + return self + end + + # Methode permettant de lancer les traitements lié aux cases + # - Ajout d'un pont + # - Suppression d'un pont + # - Récupération des cases cliquées conservé par le SaveManager + def handleClick() + @nodeLink.first.choixPossible() + if( @nodeLink.length >= 2 ) + @nodeLink.first.enleverChoixPossible() + # Si l'utilisateur clique autre part que sur le bouton REDO + # La pile du REDO est vidé + if !@undoRedo.redoStack.empty? + @undoRedo.redoStack.clear() + end + + p2 = @nodeLink.pop() + p1 = @nodeLink.pop() + + if ajoutValid?(p1,p2) == true + + #Important pour les REDOS et Undo de conserver + # Sauvegarde les case cliqué + @undoRedo.undoStack << p1 + @undoRedo.undoStack << p2 + + ajoutPont(p1,p2) + saveManager.sauvegarder(self) + $window.partiFini + end + end + + return self + end + + # Vérifie si la grille est fini + # autrement dit que tous les noeuds ont correment été remplis + def grilleFini? + for x in 0..(self.lignes-1) + for y in 0..(self.colonnes-1) + ile = self.get_child_at(x,y) + if (ile.status == 'i') + if !ile.estComplet + return false + end + end + end + end + return true + end + + # Méthode permettant de notifier la grille qu'une case à été cliquée + def notify(_case) + @nodeLink << _case + handleClick() + end + + # Ajoute un pont entre deux iles + def ajoutPont(n1,n2) + + # incrémente le nombre de pont sur les iles + n1.inc() + n2.inc() + + # Récupère les cases entre les deux iles ( le pont ) + ponts = getPontEntre(n1,n2) + + # Ile Nord + if n1.northNode == n2 + n1.northEdge = n1.northEdge + 1 + n2.southEdge = n2.southEdge + 1 + n1.update + n2.update + + elsif n1.eastNode == n2 #Ile droit + n1.eastEdge = n1.eastEdge + 1 + n2.westEdge = n2.westEdge + 1 + n1.update + n2.update + + elsif n1.westNode == n2 # Ile gauche + + n1.westEdge = n1.westEdge + 1 + n2.eastEdge = n2.eastEdge + 1 + n1.update + n2.update + + elsif n1.southNode == n2 # Ile bas + + n1.southEdge = n1.southEdge + 1 + n2.northEdge = n2.northEdge + 1 + n1.update + n2.update + + else + p "Erreur: n2 n'est pas un noeud valide pour n1" + end + + n1.pontRestants + n2.pontRestants + + # Ajoute le pont entre deux iles + ponts.each do |pont| + pont.set_typePont( pont.get_typePont() + 1) + pont.estDouble = true + pont.update + end + + return self + end + + + # Supprime le pont entre deux iles + # * +n1+ Premier pont + # * +n2+ Deuxieme pont + # * +undo+ Attribut par défaut à false permettant permettant d'adapter le traitement de suppression au besoin + def supprimePont(n1, n2, undo = false) + + + # Récupère les cases entre les deux iles ( le pont ) + ponts = getPontEntre(n1,n2) + + # Mis à jour des pont ( tout du moins de leurs edges ) + if n1.northNode == n2 + n1.northEdge = 0 + n2.southEdge = 0 + + elsif n1.eastNode == n2 #Ile droit + n1.eastEdge = 0 + n2.westEdge = 0 + + elsif n1.westNode == n2 # Ile gauche + + n1.westEdge = 0 + n2.eastEdge = 0 + + elsif n1.southNode == n2 # Ile bas + + n1.southEdge = 0 + n2.northEdge = 0 + + else + p "Erreur: n2 n'est pas un noeud valide pour n1" + end + + # Supprime le pont + ponts.each do |pont| + + if undo + pont.set_typePont( pont.get_typePont - 1 ) + else + pont.set_typePont( pont.get_typePont - ( pont.estDouble ? 2 : 1 ) ) + end + pont.estDouble = false + + if pont.get_typePont == 0 + pont.set_directionPont(0) + end + pont.update + end + + n1.set_degree( n1.pontRestants ) + n2.set_degree ( n2.pontRestants ) + n1.update + n2.update + + saveManager.sauvegarder(self) + $window.partiFini + + return self + end + + # Charge les voisins accessibles d'une case en HAUT, BAS, GAUCHE, DROITE + def chargeVoisins + for x in 0..(self.lignes-1) + for y in 0..(self.colonnes-1) + if (self.get_child_at(x,y).status == 'i') + + # DROITE + for x2 in (x+1).upto(self.lignes-1) + if (self.get_child_at(x2, y).status == 'i') + self.get_child_at(x, y).eastNode = self.get_child_at(x2,y) + break + end + end + + #BAS + for y2 in (y+1).upto(self.colonnes-1) + if (self.get_child_at(x,y2).status == 'i') + self.get_child_at(x,y).southNode = self.get_child_at(x,y2) + break + end + end + + #HAUT + for y2 in (y-1).downto(0) + if (self.get_child_at(x,y2).status == 'i') + self.get_child_at(x,y).northNode = self.get_child_at(x,y2) + break + end + end + + # Gauche + for x2 in (x-1).downto(0) + if (self.get_child_at(x2,y).status == 'i') + self.get_child_at(x,y).westNode = self.get_child_at(x2,y) + break + end + end + end + end + end + + return self + end + + + # Vérifie si l'ajout est valide + # Autrement dit : + # - vérifie si les noeuds sont bien voisins sinon renvoi faux + # - vérifie si il existe un croisement d'arêtes entre les noeuds + # * +n1+ Premier pont + # * +n2+ Deuxieme pont + def ajoutValid?(n1,n2) + + if(n1.northNode != n2 && n1.eastNode != n2 && n1.southNode != n2 && n1.westNode != n2) + return false; + end + + # Voisins NORD + if(n1.northNode == n2) + if(n1.northEdge == 2) + supprimePont(n1,n2) + return false; + else + # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds. + for y2 in (n1.row-1).downto(0) + if(self.get_child_at(n1.column,y2) == n2) + break; + else + if(self.get_child_at(n1.column,y2).get_directionPont == 1) + return false; + end + end + end + end + end + + # Voisins DROIT + if(n1.eastNode == n2) + if(n1.eastEdge == 2) + supprimePont(n1,n2) + return false; + else + # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds. + for x2 in (n1.column+1).upto(self.lignes-1) + if(self.get_child_at(x2,n1.row) == n2) + break; + else + if(self.get_child_at(x2,n1.row).get_directionPont == 2) + return false; + end + end + end + end + end + + # Voisins BAS + if(n1.southNode == n2) + + if(n1.southEdge == 2) + supprimePont(n1,n2) + return false; + else + # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds. + for y2 in (n1.row+1).upto(self.colonnes-1) + if(self.get_child_at(n1.column,y2) == n2) + break; + else + if(self.get_child_at(n1.column,y2).get_directionPont == 1) + return false; + end + end + end + end + + end + # Voisins GAUCHE + if(n1.westNode == n2) + if(n1.westEdge == 2) + supprimePont(n1,n2) + return false; + else + # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds. + for x2 in (n1.column-1).downto(0) + if(self.get_child_at(x2,n1.row) == n2) + break; + else + if( self.get_child_at(x2,n1.row).get_directionPont == 2) + return false; + end + end + end + end + end + return true + end + + # Retourne un tableau contenant les cases correspondants aux pont entre deux iles + # * +n1+ Premier pont + # * +n2+ Deuxieme pont + def getPontEntre(n1, n2) + + # Tableau temporaire visant à contenir l'index des cases formant le pont + arr = [] + + # Cas où la case est le voisin du haut + if n1.northNode == n2 # Ile HAUT + + for y2 in (n1.row-1).downto(0) + if(self.get_child_at(n1.column,y2) == n2) + break; + else + self.get_child_at(n1.column,y2).set_directionPont(2) + arr << self.get_child_at(n1.column,y2) + end + end + # Cas où la case est le voisin de droite + elsif n1.eastNode == n2 #Ile droit + + for x2 in (n1.column+1).upto(self.lignes-1) + if(self.get_child_at(x2,n1.row) == n2) + break; + else + self.get_child_at(x2,n1.row).set_directionPont(1) + arr << self.get_child_at(x2,n1.row) + end + end + # Cas où la case est le voisin de gauche + elsif n1.westNode == n2 # Ile gauche + + for x2 in (n1.column-1).downto(0) + if(self.get_child_at(x2,n1.row) == n2) + break; + else + self.get_child_at(x2,n1.row).set_directionPont(1) + arr << self.get_child_at(x2,n1.row) + end + end + + # Cas où la case est le voisin du bas + elsif n1.southNode == n2 # Ile bas + for y2 in (n1.row+1).upto(self.colonnes-1) + if(self.get_child_at(n1.column,y2) == n2) + break; + else + self.get_child_at(n1.column,y2).set_directionPont(2) + arr << self.get_child_at(n1.column,y2) + end + end + end + return arr + end + + # Chargement d'une grille depuis un fichier + def chargeGrille() + data = [] + File.foreach(@nomniv).with_index do |line, line_no| + data << line.chomp + end + # Slice permet de récupérer la taille de la matrice + # tel que 7:7 + num = data.slice!(0) + self.colonnes = @x + self.lignes = @y + + # Parcours des données récupérés afin de charger + # les boutons + for i in 0..(data.length() - 1) + data[i].split(':').each_with_index do | ch, index| + # # Création d'une case + if ch != '0' + btn = Ile.new(self, ch,index,i) + @sommets << btn + else + btn = Pont.new(self, index, i) + end + + # On attache la référence de la grille + self.attach(btn, index,i, 1,1) + end + end + + return self + end + +end \ No newline at end of file diff --git a/Hypothese.rb b/Hypothese.rb new file mode 100644 index 00000000..b51684af --- /dev/null +++ b/Hypothese.rb @@ -0,0 +1,145 @@ +require 'gtk3' + +load 'HashiGrid.rb' + +## +# Cette classe représente le mode Hypothèse +# Elle est responsable de la création du mode hypothèse +# - Créer une copie du plateau courant +class Hypothese + + # $window -> la fenêtre contenant le plateau de jeu + + # Constructeur du mode hypothèse + # * +plateau+ Référence sur le plateau de jeu + def initialize(plateau) + + main_window_res = "./Ressources/Glade/hypo.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + hypo = builder.get_object('hypo') + hypo.set_title "Hypothèse" + hypo.signal_connect "destroy" do + hypo.destroy + plateau.getPlateau().set_sensitive(true) + + end + hypo.set_window_position Gtk::WindowPosition::CENTER + css_file = Gtk::CssProvider.new + + css_file.load(data: <<-CSS) + button { + all:unset; + } + + button:hover { + opacity: .6; + } + + .bg-hypo { + background-color: #F8DDD7; + } + + CSS + + + + # #Reglage du bouton Undo + boutonUndo = builder.get_object('btnUndo') + + # #Reglage du bouton Redo + boutonRedo = builder.get_object('btnRedo') + + # #Initialisation de la grille + # # Copie des noeuds contenus dans la grille + copy_grille = plateau.grid.collect(&:dup) + + + # # Création d'une nouvelle grille + @hypoGrille = HashiGrid.new(plateau.grid.nomniv,plateau.grid.diff, plateau.grid.lignes, plateau.grid.colonnes) + @hypoGrille.set_column_homogeneous(true) + @hypoGrille.set_row_homogeneous(true) + @hypoGrille.colonnes = plateau.grid.colonnes + @hypoGrille.lignes = plateau.grid.lignes + @hypoGrille.sommets = plateau.grid.sommets + + # # On parcourt le tableau des iles/ponts copiés + copy_grille.each do |x| + # Si c'est une ile + # On copie les attributs de l'ile + if x.status != 'p' + btn = Ile.new(@hypoGrille,x.degreeMax.to_s,x.column,x.row) + btn.degree = x.degree + btn.estComplet = x.estComplet + btn.northEdge = x.northEdge + btn.southEdge = x.southEdge + btn.westEdge = x.westEdge + btn.eastEdge = x.eastEdge + btn.update + else + # Si c'est un pont on copie les attributs + # et on met à jour le pont + btn = Pont.new(@hypoGrille,x.column,x.row) + btn.set_typePont( x.get_typePont ) + btn.estDouble = x.estDouble + btn.set_directionPont ( x.get_directionPont ) + btn.update + end + # On attache la référence de la grille + @hypoGrille.attach(btn, x.column,x.row, 1,1) + end + # # Chargement des voisins + @hypoGrille.chargeVoisins + + boxJeu = builder.get_object('boxJeu') + boxJeu.add(@hypoGrille) + + + #Creation et affichage de la fenêtre principale + boxPrincipale = builder.get_object('boxPrincipale') + + aide = Aide.new(@hypoGrille) + label_aide = builder.get_object('label_indice') + + boutonIndice = builder.get_object('btnIndice') + boutonIndice.signal_connect('clicked'){ + label_aide.set_label(aide.getMessageAide) + boxPrincipale.show_all + } + + + btnValider = builder.get_object('btnValider') + btnValider.signal_connect('clicked'){ + boxJeu.remove(@hypoGrille) + plateau.hypotheseValider(@hypoGrille) + hypo.destroy + $window.getPlateau().set_sensitive(true) + } + + btnAnnuler = builder.get_object('btnAnnuler') + btnAnnuler.signal_connect('clicked'){ + hypo.destroy + $window.getPlateau().set_sensitive(true) + } + + boutonUndo.signal_connect('clicked'){ + @hypoGrille.undoPrevious + } + + boutonRedo.signal_connect('clicked'){ + @hypoGrille.redoPrevious + } + + btnAnnuler.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + btnValider.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonUndo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonIndice.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonRedo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + hypo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + + hypo.show_all + end + +end \ No newline at end of file diff --git a/Ile.rb b/Ile.rb new file mode 100644 index 00000000..9ef77241 --- /dev/null +++ b/Ile.rb @@ -0,0 +1,261 @@ +require ('gtk3') + + +## +# Cette classe représente les îles +class Ile < Gtk::Button + + # @gridRef -> Référence sur la grille + # @degreeMax -> Représente le degrée max autorisé sur le noeud + # @degree -> Représente le nombre de degrée restant à connecter avant d'atteindre le degree max + # @row -> Numéro de ligne + # @estComplet -> Attribut permettant de savoir si l'ile est complète ou non + # @column -> Numéro de colonne + # @northNode -> Noeud voisin au nord + # @eastNode -> Noeud voisin à l'est + # @southNode -> Noeud voisin au sud + # @westNode -> Noeud voisin à l'ouest + # @northEdge -> Statut de l'arête nord entre deux noeuds + # @eastEdge -> Statut de l'arête est entre deux noeuds + # @southEdge -> Statut de l'arête sud entre deux noeuds + # @westEdge -> Statut de l'arête ouest entre deux noeuds + + # Remplace le label du GTK::Button + # Identifie une case comme étant un pont 'p' + # ou une ile 'i' + attr_accessor :status + + # Numéro de ligne + attr_accessor :row + + # Numéro de colonne + attr_accessor :column + + # Attribut permettant de savoir si l'ile est complète ou non + attr_accessor :estComplet + + # Référence sur la grille + attr_accessor :gridRef + + # Représente les nœuds auxquels ce nœud peut être connecté + attr_accessor :northNode, :eastNode, :southNode, :westNode + + # Représente le statut d'une arête entre deux noeuds. 0 = pas d'arête, 1 = simple, 2 = double + attr_accessor :northEdge, :eastEdge, :southEdge, :westEdge; + + # Représente le degrée max autorisé sur le noeud + attr_reader :degreeMax + + # Représente le nombre de degrée restant à connecter avant d'atteindre le degree max + attr_accessor :degree + + # Construction d'une île + # * +grid+ Référence sur la grille + # * +degreeMax+ Degree maximum de l'ile ( nombres de ponts attendus ) + # * +col+ Numéro de colonne + # * +lig+ Numéro de ligne + def initialize(grid, degreeMax, col, lig ) + super() + @gridRef = grid + @degreeMax = degreeMax.to_i + @degree = 0 + @row = lig + @estComplet = false + @column = col + + # Noeuds voisins permet de conserver la reference sur les voisins + @northNode = nil + @southNode = nil + @eastNode = nil + @westNode = nil + + # Permet de représenter le statut d'une arête entre chaque voisin + @northEdge = 0; + @eastEdge = 0; + @southEdge = 0; + @westEdge = 0; + + self.style_context.add_class('ile') + self.set_name("ile") + # Status représente une ile + self.status = 'i' + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/plateau_style.css"); + CSS + self.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + # Charge une image correspondants au noeud + self.image = Gtk::Image.new(:file => "Ressources/Ile/"+degreeMax+".png") + + # Retire les contours + self.set_relief(Gtk::ReliefStyle::NONE) + self.always_show_image = false + self.signal_connect('clicked') { self.click() } + end + + # Calcule le nombres de ponts restants sur une ile + def pontRestants + compteur = 0 + + if( @northNode != nil ) + compteur += @northEdge + end + if( @eastNode != nil ) + compteur += @eastEdge + end + if( @southNode != nil ) + compteur += @southEdge + end + if( @westNode != nil ) + compteur += @westEdge + end + return compteur + end + + # Renvoi vrai si l'ile est relie a + # chacun de ses voisins + # sinon faux + def pontAvecVoisins + return self.pontRestants() >= self.compterVoisins() + end + + # Retourne le nombre de voisins + def compterVoisins() + return self.getVoisins().size + end + + # Retourne le nombre de connexions restantes avant + # que l'île soit complète. + # Si le nombre est négatif - il y à trop de pont + # Si le nombre est positif - Nombre de ponts manquants + # Si le nombre == 0 - Le pont est complet + def connexionRestantes + return @degreeMax - self.pontRestants() + end + + # Retourne un tableau contenant les voisins d'une ile + # Un noeud à nil équivaut à une absence de voisin dans cette + # direction + # On ne retourne donc que les voisins valides + def getVoisins + arr = Array.new + if( @northNode != nil ) + arr.push(@northNode) + end + if( @eastNode != nil ) + arr.push(@eastNode) + end + if( @southNode != nil ) + arr.push(@southNode) + end + if( @westNode != nil ) + arr.push(@westNode) + end + return arr + end + + # Retourne la liste des voisins non complets + # d'une ile + def voisinsNonComplets() + liste = self.getVoisins() + array = Array.new() + + liste.each do |voisin| + if voisin.pontRestants() != 0 + array.push(voisin) + end + end + return array + end + + # Renvoi le nombre de voisins non complets + def compterVoisinsNonComplets + return self.voisinsNonComplets().size + end + + # Décrémente le nombre de pont sur la case + def dec + @degree -= 1 + return self + end + + # Modifie le nombre de ponts relie à l'ile + def set_degree val + @degree = val + return self + end + + # Incrément le nombre de pont sur la case + def inc + @degree += 1 + return self + end + + # Met à jour le noeud + # - Si le noeud à un nombre de pont supérieur a son degree max, il est affiché en rouge + # - Si le noeud comporte le bon nombre il s'affiche en vert + # - Sinon il est blanc par défaut + def update + if @degree > @degreeMax + self.estComplet = false + self.image.from_file = "Ressources/Ile/#{degreeMax}_r.png" + elsif @degree == @degreeMax + self.estComplet = true + self.image.from_file = "Ressources/Ile/#{degreeMax}_v.png" + else + self.image.from_file = "Ressources/Ile/#{degreeMax}.png" + self.estComplet = false + self.style_context.remove_class('complet') + self.style_context.remove_class('incorrect') + end + + return self + end + + # Affiche les voisins auxquelles l'île peut-être relié + def choixPossible() + voisins = self.getVoisins + for voisin in voisins + if voisin != nil + if voisin.estComplet == false + voisin.style_context.add_class('possibles') + voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}_s.png" + end + end + end + + return self + end + + # Supprime l'affichage des voisins possibles + def enleverChoixPossible() + voisins = self.getVoisins + for voisin in voisins + if voisin != nil + if voisin.estComplet == false + voisin.style_context.remove_class('possibles') + if voisin.degree > voisin.degreeMax + voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}_r.png" + else + voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}.png" + end + end + end + end + + return self + end + + + # Affiche la ligne et la colonne + def to_s + return "[#{@row}-#{@column}]" + end + + # Méthode de test afin de s'assurer du bon fonctionnement des clics + def click() + @gridRef.notify(self) + return self + end + +end diff --git a/ListeNiveau/Difficile/10x10.txt b/ListeNiveau/Difficile/10x10.txt new file mode 100644 index 00000000..4db85da9 --- /dev/null +++ b/ListeNiveau/Difficile/10x10.txt @@ -0,0 +1,11 @@ +10:10 +4:0:0:0:3:0:2:0:1:0 +0:0:1:0:0:3:0:3:0:2 +6:0:0:0:5:0:3:0:1:0 +0:3:0:1:0:1:0:2:0:3 +3:0:0:0:0:0:0:0:0:0 +0:5:0:0:3:0:2:0:0:3 +2:0:2:0:0:4:0:0:2:0 +0:3:0:1:0:0:0:0:0:0 +1:0:1:0:0:3:0:0:0:3 +0:2:0:3:0:0:0:1:0:0 \ No newline at end of file diff --git a/ListeNiveau/Difficile/10x10_2.txt b/ListeNiveau/Difficile/10x10_2.txt new file mode 100644 index 00000000..78685ede --- /dev/null +++ b/ListeNiveau/Difficile/10x10_2.txt @@ -0,0 +1,11 @@ +10:10 +0:1:0:3:0:0:0:0:0:0 +2:0:2:0:2:0:0:4:0:3 +0:0:0:0:0:0:0:0:0:0 +0:0:0:0:1:0:0:1:0:0 +1:0:0:3:0:0:0:0:0:3 +0:0:0:0:0:0:0:0:0:0 +4:0:4:0:0:0:0:0:0:3 +0:0:0:0:0:0:0:0:0:0 +0:1:0:0:2:0:3:0:0:3 +4:0:4:0:0:0:0:2:0:0 \ No newline at end of file diff --git a/ListeNiveau/Difficile/10x7.txt b/ListeNiveau/Difficile/10x7.txt new file mode 100644 index 00000000..7b846fa4 --- /dev/null +++ b/ListeNiveau/Difficile/10x7.txt @@ -0,0 +1,8 @@ +10:7 +4:0:4:0:0:2:0:0:1:0 +0:0:0:0:3:0:0:3:0:3 +3:0:2:0:0:0:2:0:1:0 +0:0:0:0:0:0:0:3:0:3 +4:0:3:0:3:0:3:0:1:0 +0:0:0:0:0:0:0:2:0:1 +3:0:2:0:3:0:5:0:2:0 diff --git a/ListeNiveau/Difficile/12x12.txt b/ListeNiveau/Difficile/12x12.txt new file mode 100644 index 00000000..7ce9f3a1 --- /dev/null +++ b/ListeNiveau/Difficile/12x12.txt @@ -0,0 +1,13 @@ +12:12 +0:2:0:0:3:0:0:4:0:3:0:0 +0:0:0:1:0:1:0:0:2:0:0:1 +1:0:0:0:1:0:0:2:0:2:0:0 +0:3:0:3:0:4:0:0:5:0:3:0 +3:0:0:0:0:0:2:0:0:0:0:2 +0:0:1:0:0:2:0:0:4:0:4:0 +0:3:0:4:0:0:4:0:0:0:0:0 +3:0:2:0:2:0:0:0:3:0:0:2 +0:2:0:1:0:0:0:0:0:0:0:0 +2:0:3:0:4:0:3:0:2:0:0:2 +0:2:0:3:0:0:0:2:0:0:0:0 +2:0:2:0:0:2:0:0:4:0:0:4 \ No newline at end of file diff --git a/ListeNiveau/Difficile/15x5.txt b/ListeNiveau/Difficile/15x5.txt new file mode 100644 index 00000000..6b379e4b --- /dev/null +++ b/ListeNiveau/Difficile/15x5.txt @@ -0,0 +1,6 @@ +15:5 +3:0:4:0:3:0:2:0:3:0:4:0:0:2:0 +0:2:0:2:0:3:0:3:0:3:0:0:3:0:3 +3:0:1:0:2:0:1:0:0:0:0:3:0:1:0 +0:3:0:2:0:3:0:0:3:0:1:0:0:0:0 +3:0:2:0:3:0:0:2:0:2:0:3:0:0:2 \ No newline at end of file diff --git a/ListeNiveau/Difficile/7x7.txt b/ListeNiveau/Difficile/7x7.txt new file mode 100644 index 00000000..9a41801a --- /dev/null +++ b/ListeNiveau/Difficile/7x7.txt @@ -0,0 +1,8 @@ +7:7 +3:0:4:0:0:0:3 +0:1:0:3:0:2:0 +0:0:0:0:0:0:0 +0:0:0:2:0:0:5 +0:0:0:0:0:0:0 +2:0:3:0:0:1:0 +0:2:0:0:0:0:3 \ No newline at end of file diff --git a/ListeNiveau/Difficile/8x8.txt b/ListeNiveau/Difficile/8x8.txt new file mode 100644 index 00000000..0db0f2ce --- /dev/null +++ b/ListeNiveau/Difficile/8x8.txt @@ -0,0 +1,9 @@ +8:8 +1:0:2:0:4:0:0:3 +0:0:0:0:0:0:2:0 +1:0:3:0:3:0:0:1 +0:0:0:0:0:0:0:0 +0:0:3:0:3:0:6:0 +1:0:0:0:0:0:0:1 +0:0:0:0:1:0:3:0 +3:0:5:0:0:2:0:2 \ No newline at end of file diff --git a/ListeNiveau/Facile/10x10.txt b/ListeNiveau/Facile/10x10.txt new file mode 100644 index 00000000..60770127 --- /dev/null +++ b/ListeNiveau/Facile/10x10.txt @@ -0,0 +1,11 @@ +10:10 +0:4:0:6:0:0:3:0:1:0 +2:0:0:0:0:2:0:5:0:3 +0:4:0:0:1:0:0:0:0:0 +3:0:0:3:0:2:0:0:0:3 +0:4:0:0:3:0:0:4:0:0 +3:0:0:1:0:1:0:0:0:3 +0:6:0:0:7:0:0:5:0:0 +3:0:2:0:0:0:0:0:0:0 +0:2:0:0:3:0:1:0:0:1 +2:0:4:0:0:3:0:4:0:0 \ No newline at end of file diff --git a/ListeNiveau/Facile/10x7.txt b/ListeNiveau/Facile/10x7.txt new file mode 100644 index 00000000..74d8933f --- /dev/null +++ b/ListeNiveau/Facile/10x7.txt @@ -0,0 +1,8 @@ +10:7 +0:1:0:2:0:0:4:0:2:0 +3:0:3:0:3:0:0:0:0:0 +0:0:0:0:0:0:0:3:0:3 +0:0:0:0:6:0:5:0:0:0 +5:0:4:0:0:0:0:1:0:0 +0:0:0:0:4:0:5:0:0:2 +1:0:2:0:0:3:0:0:2:0 \ No newline at end of file diff --git a/ListeNiveau/Facile/12x12.txt b/ListeNiveau/Facile/12x12.txt new file mode 100644 index 00000000..833c8903 --- /dev/null +++ b/ListeNiveau/Facile/12x12.txt @@ -0,0 +1,13 @@ +12:12 +3:0:3:0:3:0:3:0:4:0:4:0 +0:1:0:2:0:4:0:3:0:3:0:0 +0:0:0:0:3:0:0:0:0:0:0:1 +4:0:0:2:0:3:0:0:1:0:3:0 +0:2:0:0:7:0:0:6:0:6:0:0 +4:0:0:0:0:0:0:0:0:0:0:2 +0:0:1:0:4:0:0:5:0:5:0:0 +0:3:0:2:0:0:0:0:0:0:1:0 +0:0:0:0:3:0:0:6:0:5:0:3 +3:0:0:2:0:0:1:0:0:0:0:0 +0:2:0:0:0:2:0:0:3:0:2:0 +3:0:3:0:2:0:3:0:0:3:0:2 \ No newline at end of file diff --git a/ListeNiveau/Facile/12x12_1.txt b/ListeNiveau/Facile/12x12_1.txt new file mode 100644 index 00000000..baf278eb --- /dev/null +++ b/ListeNiveau/Facile/12x12_1.txt @@ -0,0 +1,13 @@ +12:12 +3:0:0:0:0:3:0:5:0:2:0:1 +0:0:1:0:3:0:1:0:0:0:0:0 +0:1:0:3:0:0:0:2:0:0:1:0 +5:0:1:0:0:3:0:0:4:0:0:3 +0:0:0:0:2:0:0:0:0:0:2:0 +0:3:0:4:0:0:1:0:2:0:0:0 +0:0:0:0:0:2:0:0:0:0:5:0 +0:2:0:0:2:0:0:3:0:1:0:0 +0:0:0:0:0:0:0:0:0:0:0:3 +4:0:0:3:0:2:0:5:0:0:3:0 +0:0:0:0:0:0:0:0:0:1:0:3 +1:0:1:0:0:0:0:5:0:0:2:0 \ No newline at end of file diff --git a/ListeNiveau/Facile/15x5.txt b/ListeNiveau/Facile/15x5.txt new file mode 100644 index 00000000..83a101a3 --- /dev/null +++ b/ListeNiveau/Facile/15x5.txt @@ -0,0 +1,6 @@ +15:5 +0:3:0:0:0:4:0:4:0:3:0:0:3:0:3 +1:0:0:3:0:0:3:0:3:0:0:3:0:0:0 +0:1:0:0:1:0:0:2:0:0:3:0:4:0:6 +0:0:0:0:0:0:0:0:0:0:0:1:0:0:0 +2:0:0:4:0:0:4:0:3:0:4:0:4:0:4 \ No newline at end of file diff --git a/ListeNiveau/Facile/7x7_1.txt b/ListeNiveau/Facile/7x7_1.txt new file mode 100644 index 00000000..894d209d --- /dev/null +++ b/ListeNiveau/Facile/7x7_1.txt @@ -0,0 +1,8 @@ +7:7 +4:0:4:0:0:1:0 +0:0:0:2:0:0:3 +0:0:3:0:0:2:0 +6:0:0:0:0:0:5 +0:0:0:0:0:0:0 +0:0:0:0:0:0:0 +4:0:0:0:0:0:4 \ No newline at end of file diff --git a/ListeNiveau/Facile/7x7_2.txt b/ListeNiveau/Facile/7x7_2.txt new file mode 100644 index 00000000..83370eae --- /dev/null +++ b/ListeNiveau/Facile/7x7_2.txt @@ -0,0 +1,8 @@ +7:7 +4:0:0:3:0:0:2 +0:0:0:0:0:0:0 +0:0:0:0:0:0:0 +5:0:0:0:0:0:5 +0:1:0:3:0:1:0 +0:0:0:0:0:0:0 +3:0:0:5:0:0:4 \ No newline at end of file diff --git a/ListeNiveau/Facile/7x7_3.txt b/ListeNiveau/Facile/7x7_3.txt new file mode 100644 index 00000000..081a022f --- /dev/null +++ b/ListeNiveau/Facile/7x7_3.txt @@ -0,0 +1,8 @@ +7:7 +0:1:0:0:4:0:4 +3:0:1:0:0:0:0 +0:0:0:0:0:0:4 +6:0:0:0:5:0:0 +0:0:1:0:0:0:4 +0:0:0:0:0:0:0 +2:0:3:0:6:0:4 \ No newline at end of file diff --git a/ListeNiveau/Moyen/10x10.txt b/ListeNiveau/Moyen/10x10.txt new file mode 100644 index 00000000..79969d45 --- /dev/null +++ b/ListeNiveau/Moyen/10x10.txt @@ -0,0 +1,11 @@ +10:10 +3:0:0:2:0:2:0:5:0:3 +0:2:0:0:3:0:3:0:0:0 +4:0:2:0:0:0:0:3:0:3 +0:2:0:0:1:0:0:0:0:0 +3:0:3:0:0:0:4:0:1:0 +0:3:0:4:0:3:0:1:0:2 +2:0:0:0:0:0:0:0:0:0 +0:2:0:0:0:0:0:0:0:2 +1:0:0:4:0:4:0:1:0:0 +0:2:0:0:3:0:4:0:0:3 \ No newline at end of file diff --git a/ListeNiveau/Moyen/10x10_2.txt b/ListeNiveau/Moyen/10x10_2.txt new file mode 100644 index 00000000..f46b36aa --- /dev/null +++ b/ListeNiveau/Moyen/10x10_2.txt @@ -0,0 +1,11 @@ +10:10 +4:0:0:0:4:0:1:0:0:1 +0:0:0:0:0:0:0:0:0:0 +0:0:0:0:0:0:4:0:0:4 +4:0:2:0:0:0:0:1:0:0 +0:1:0:0:0:0:0:0:0:0 +0:0:0:0:0:0:0:0:0:0 +0:0:0:0:0:0:0:0:0:0 +0:0:0:0:0:0:0:2:0:2 +0:0:0:0:0:0:0:0:0:0 +0:3:0:0:5:0:3:0:0:1 \ No newline at end of file diff --git a/ListeNiveau/Moyen/10x7.txt b/ListeNiveau/Moyen/10x7.txt new file mode 100644 index 00000000..3fb16e9f --- /dev/null +++ b/ListeNiveau/Moyen/10x7.txt @@ -0,0 +1,8 @@ +10:7 +0:1:0:0:2:0:3:0:3:0 +2:0:0:3:0:3:0:2:0:0 +0:0:2:0:1:0:0:0:0:1 +2:0:0:1:0:3:0:0:2:0 +0:0:4:0:2:0:0:1:0:2 +0:0:0:1:0:4:0:0:2:0 +3:0:4:0:2:0:0:2:0:2 \ No newline at end of file diff --git a/ListeNiveau/Moyen/12x12.txt b/ListeNiveau/Moyen/12x12.txt new file mode 100644 index 00000000..7463832e --- /dev/null +++ b/ListeNiveau/Moyen/12x12.txt @@ -0,0 +1,13 @@ +12:12 +0:2:0:0:3:0:3:0:2:0:1:0 +2:0:2:0:0:0:0:0:0:3:0:2 +0:4:0:5:0:3:0:2:0:0:2:0 +3:0:0:0:0:0:1:0:0:2:0:2 +0:0:0:3:0:3:0:0:2:0:1:0 +0:4:0:0:0:0:0:2:0:3:0:4 +3:0:2:0:4:0:3:0:3:0:1:0 +0:3:0:0:0:2:0:4:0:1:0:0 +3:0:0:0:4:0:0:0:2:0:0:4 +0:0:1:0:0:1:0:0:0:0:0:0 +0:3:0:0:5:0:0:4:0:0:0:0 +3:0:0:3:0:0:3:0:3:0:0:1 \ No newline at end of file diff --git a/ListeNiveau/Moyen/15x5.txt b/ListeNiveau/Moyen/15x5.txt new file mode 100644 index 00000000..28ffa0bb --- /dev/null +++ b/ListeNiveau/Moyen/15x5.txt @@ -0,0 +1,6 @@ +15:5 +0:3:0:0:4:0:3:0:2:0:0:2:0:1:0 +0:0:0:1:0:1:0:3:0:2:0:0:2:0:3 +1:0:0:0:3:0:2:0:0:0:0:0:0:0:0 +0:3:0:4:0:3:0:3:0:2:0:0:1:0:0 +2:0:2:0:2:0:2:0:2:0:2:0:0:0:3 \ No newline at end of file diff --git a/ListeNiveau/Moyen/7x7.txt b/ListeNiveau/Moyen/7x7.txt new file mode 100644 index 00000000..3a5ca7a3 --- /dev/null +++ b/ListeNiveau/Moyen/7x7.txt @@ -0,0 +1,8 @@ +7:7 +2:0:5:0:0:0:4 +0:0:0:0:0:0:0 +0:0:0:0:1:0:0 +1:0:0:0:0:0:0 +0:0:0:0:0:0:3 +0:0:0:0:0:0:0 +2:0:4:0:3:0:1 \ No newline at end of file diff --git a/ListeNiveau/Moyen/8x8.txt b/ListeNiveau/Moyen/8x8.txt new file mode 100644 index 00000000..15c4ba03 --- /dev/null +++ b/ListeNiveau/Moyen/8x8.txt @@ -0,0 +1,9 @@ +8:8 +2:0:3:0:3:0:1:0 +0:0:0:0:0:0:0:0 +3:0:0:0:3:0:0:2 +0:0:0:0:0:0:0:0 +4:0:0:0:4:0:3:0 +0:0:1:0:0:0:0:0 +1:0:0:0:1:0:0:1 +0:0:3:0:0:0:3:0 \ No newline at end of file diff --git a/Livrables/Cahier d'Analyse et de Conception.pdf b/Livrables/Cahier d'Analyse et de Conception.pdf new file mode 100644 index 00000000..394d6db3 Binary files /dev/null and b/Livrables/Cahier d'Analyse et de Conception.pdf differ diff --git a/Livrables/Cahier des charges.pdf b/Livrables/Cahier des charges.pdf new file mode 100644 index 00000000..50dcdf50 Binary files /dev/null and b/Livrables/Cahier des charges.pdf differ diff --git a/Livrables/Diagramme de Classe.png b/Livrables/Diagramme de Classe.png new file mode 100644 index 00000000..8bc0539d Binary files /dev/null and b/Livrables/Diagramme de Classe.png differ diff --git a/Livrables/Manuel Utilisateur.pdf b/Livrables/Manuel Utilisateur.pdf new file mode 100644 index 00000000..96b6b119 Binary files /dev/null and b/Livrables/Manuel Utilisateur.pdf differ diff --git a/MainMenu.rb b/MainMenu.rb new file mode 100644 index 00000000..78d87380 --- /dev/null +++ b/MainMenu.rb @@ -0,0 +1,79 @@ +require 'gtk3' + + +## +# Cette classe représente le menu Principal du jeu HASHI +class MainMenu + + # Constructeur du menu principal + def initialize + + + main_window_res = "./Ressources/Glade/menu_principal.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + main_menu = builder.get_object('main_window') + main_menu.set_title "Menu principal" + main_menu.signal_connect "destroy" do + Gtk.main_quit + end + + main_menu.set_window_position Gtk::WindowPosition::CENTER + main_menu_CSS = Gtk::CssProvider.new + main_menu_CSS.load(data: <<-CSS) + @import url("css/style.css"); + CSS + + main_menu.set_title "Hashi Game" + main_menu.style_context.add_provider(main_menu_CSS, Gtk::StyleProvider::PRIORITY_USER) + + + btnSelection = builder.get_object('btn-selection-menu') + btnSelection.signal_connect('clicked'){ + + MenuSelection.new + main_menu.destroy + Gtk.main + } + + btnTuto = builder.get_object('btn-tutoriel') + btnTuto.signal_connect('clicked'){ + Tuto.new + main_menu.destroy + Gtk.main + } + + btnClassement = builder.get_object('btn-classement') + btnClassement.signal_connect('clicked'){ + Classement.new + main_menu.destroy + Gtk.main + } + + btnAPropos =builder.get_object('btn-about') + btnAPropos.signal_connect('clicked'){ + main_menu.set_sensitive(false) + APropos.new(main_menu) + + } + + + btnQuitter = builder.get_object('btn-quitter') + btnQuitter.signal_connect('clicked'){Gtk.main_quit} + + bouton_css = Gtk::CssProvider.new + bouton_css.load(data: <<-CSS) + @import url("css/style.css"); + CSS + btnSelection.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER) + btnTuto.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER) + btnClassement.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER) + btnQuitter.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER) + btnAPropos.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER) + + main_menu.show_all + end + +end + diff --git a/MenuLayout.rb b/MenuLayout.rb new file mode 100644 index 00000000..137a89aa --- /dev/null +++ b/MenuLayout.rb @@ -0,0 +1,181 @@ +require 'gtk3' + +## +# Cette classe sert de layout de base pour la création de Menu. +# Les classes héritantes peuvent ainsi implémenter les attributs en fonction de leurs besoins. +class MenuLayout + + # @builder -> Variable contenant le GTK Builder pour donner forme aux menus + # @menu -> Variable contenant la fenetre du menu en cours + # @btn_retour -> Variable contenant le bouton de retour + # @css_file -> Fichier contenant toutes les caractéristiques CSS + # @btn_facile -> Zone contenant les boutons faciles + # @btn_moyen -> Zone contenant les boutons moyens + # @btn_difficile -> Zone contenant les boutons difficiles + # @tabfacile -> Tableau contenant les paths des niveaux faciles + # @tabdimfacile -> Tableau contenant les dimensions des niveaux faciles + # @tabmoyen -> Tableau contenant les paths des niveaux moyens + # @tabdimmoyen -> Tableau contenant les dimensions des niveaux moyens + # @tabdifficile -> Tableau contenant les paths des niveaux difficiles + # @tabdimdifficile -> Tableau contenant les dimensions des niveaux difficiles + # @tableauBtn -> Tableau contenant la liste de tous les boutons + + + + + # Attribut correspondant au menu + attr_reader :menu + + # Bouton du mode Facile + attr_accessor :btn_facile + + # Bouton du mode Moyen + attr_accessor :btn_moyen + + # Bouton du mode Difficile + attr_accessor :btn_difficile + + # Tableau de bouton + attr_accessor :tableauBtn + + # Attribut correspondant au fichier CSS + attr_accessor :css_file + + + # Constructeur du MenuLayout + # * +path+ Chemin du fichier + # * +title+ Titre du menu + def initialize(path, title) + + main_window_res = "./Ressources/Glade/menu_selection.glade" + @builder = Gtk::Builder.new + @builder.add_from_file(main_window_res) + + @menu = @builder.get_object('main_window') + @menu.set_title title + @menu.signal_connect "destroy" do + Gtk.main_quit + end + @menu.set_window_position Gtk::WindowPosition::CENTER + + allbtn = @builder.get_object('listbox') + + facile_box = @builder.get_object('facile_box') + moyen_box= @builder.get_object('moyen_box') + difficile_box= @builder.get_object('difficile_box') + + niveau = @builder.get_object('niveau') + + @btn_retour = @builder.get_object('btn_retour') + @css_file = Gtk::CssProvider.new + @css_file.load(data: <<-CSS) + @import url("css/style.css"); + CSS + + # #Bouton Retour cliqué + @btn_retour.signal_connect('clicked'){ + @menu.destroy + MainMenu.new + Gtk.main + } + + @btn_facile = @builder.get_object('btn_facile') + @btn_moyen = @builder.get_object('btn_moyen') + @btn_difficile = @builder.get_object('btn_difficile') + + @btn_retour.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + @menu.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + @btn_facile.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + @btn_moyen.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + @btn_difficile.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + + + facile_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + moyen_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + difficile_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + + + @tableauBtn=Array.new(22) + # "ListeNiveau" + #Initialisation des boutons de niveau + @tabfacile=[path+"/Facile/7x7_1.txt",path+"/Facile/7x7_2.txt",path+"/Facile/7x7_3.txt",path+"/Facile/10x7.txt",path+"/Facile/10x10.txt",path+"/Facile/12x12.txt",path+"/Facile/15x5.txt",path+"/Facile/12x12_1.txt"] + @tabdimfacile=[7,7,7,7,7,7,10,7,10,10,12,12,15,5,12,12] + @tabmoyen=[path+"/Moyen/7x7.txt",path+"/Moyen/8x8.txt",path+"/Moyen/10x7.txt",path+"/Moyen/10x10_2.txt",path+"/Moyen/10x10.txt",path+"/Moyen/12x12.txt",path+"/Moyen/15x5.txt"] + @tabdimmoyen=[7,7,8,8,10,7,10,10,10,10,12,12,15,5] + @tabdifficile=[path+"/Difficile/7x7.txt",path+"/Difficile/8x8.txt",path+"/Difficile/10x7.txt",path+"/Difficile/10x10.txt",path+"/Difficile/10X10_2.txt",path+"/Difficile/12x12.txt",path+"/Difficile/15x5.txt"] + @tabdimdifficile=[7,7,8,8,10,7,10,10,10,10,12,12,15,5] + dimfacile=0 + facile=0 + moyen=0 + dimmoyen=0 + difficile=0 + dimdifficile=0 + @tableauBtn.each_index{|z| + if (z<8) + x=@tabdimfacile[dimfacile] + dimfacile+=1 + y=@tabdimfacile[dimfacile] + dimfacile+=1 + niveaufacile=@tabfacile[facile] + facile+=1 + @tableauBtn[z]= BoutonChoix.new(true,false,false,niveaufacile,x,y) + @tableauBtn[z].set_path(niveaufacile) + facile_box.add(@tableauBtn[z]) + elsif(z<15) + x=@tabdimmoyen[dimmoyen] + dimmoyen+=1 + y=@tabdimmoyen[dimmoyen] + dimmoyen+=1 + niveaumoyen=@tabmoyen[moyen] + moyen+=1 + @tableauBtn[z]= BoutonChoix.new(false,true,false,niveaumoyen,x,y) + @tableauBtn[z].set_path(niveaumoyen) + moyen_box.add(@tableauBtn[z]) + elsif(z<22) + x=@tabdimdifficile[dimdifficile] + dimdifficile+=1 + y=@tabdimdifficile[dimdifficile] + dimdifficile+=1 + niveaudifficile=@tabdifficile[difficile] + difficile+=1 + @tableauBtn[z]= BoutonChoix.new(false,false,true,niveaudifficile,x,y) + @tableauBtn[z].set_path(niveaudifficile) + difficile_box.add(@tableauBtn[z]) + end + + @tableauBtn[z].style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER) + # allbtn.add(@tableauBtn[z]) + } + + facile_box.show_all + moyen_box.show_all + difficile_box.show_all + + moyen_box.visible = false + difficile_box.visible = false + + + @btn_facile = @builder.get_object('btn_facile').signal_connect('clicked'){ + facile_box.visible = true + moyen_box.visible = false + difficile_box.visible = false + niveau.from_file= "./Ressources/MenuSelection/facile.png" + + } + @btn_moyen = @builder.get_object('btn_moyen').signal_connect('clicked'){ + facile_box.visible = false + moyen_box.visible = true + difficile_box.visible = false + niveau.from_file= "./Ressources/MenuSelection/moyen.png" + } + @btn_difficile = @builder.get_object('btn_difficile').signal_connect('clicked'){ + facile_box.visible = false + moyen_box.visible = false + difficile_box.visible = true + niveau.from_file= "./Ressources/MenuSelection/difficile.png" + + } + + end + +end \ No newline at end of file diff --git a/MenuSelection.rb b/MenuSelection.rb new file mode 100644 index 00000000..6231b60f --- /dev/null +++ b/MenuSelection.rb @@ -0,0 +1,92 @@ +require 'gtk3' +load "MenuLayout.rb" + +## +# Représentation du Menu de Selection de Niveau qui hérite de la classe MenuLayout +# Le Menu de Selection implémente la logique permettant d'accéder à une grille spécifique +## +class MenuSelection < MenuLayout + + # @menu -> Variable contenant le menu, initialisé dans MenuLayout + # @builder -> Variable contenant les propriétés d'affichage, initialisé dans MenuLayout + # $window -> variable globale contenant la fenetre du plateau + + # Constructeur du Menu de selection + def initialize + super("ListeNiveau","Menu Selection") + + image = @builder.get_object('logo-menu') + image.from_file = "css/logo-selection.png" + + #Lien entre Menu Selection et chaque plateau + tableauBtn.each_index{|x| tableauBtn[x].signal_connect('clicked'){ + + @menu.set_sensitive(false) + main_window_res = "./Ressources/Glade/menu_chargement.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + window = builder.get_object('main_window') + window.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + window.signal_connect "destroy" do + @menu.set_sensitive(true) + window.destroy + end + window.set_window_position Gtk::WindowPosition::CENTER + + btnLancer = builder.get_object('btnLancer') + btnSave = builder.get_object('btnSave') + #Recuperer la difficulté en variable + if(tableauBtn[x].isFacile?) + diff = "Facile" + elsif(tableauBtn[x].isMoyen?) + diff = "Moyen" + else + diff = "Difficile" + end + titre = tableauBtn[x].getNiveau.match(/[^\/]*.txt/) + if ((!(File.file?("./Sauvegarde/#{diff}/save#{titre}"))) || File.zero?("./Sauvegarde/#{diff}/save#{titre}")) + btnSave.sensitive = false + end + btnSave.signal_connect('clicked'){ + chargement=1 + + window.destroy + @menu.destroy + $window = Plateau.new(tableauBtn[x].getNiveau,tableauBtn[x].getY,tableauBtn[x].getX, diff,chargement) + Gtk.main + } + btnLancer.signal_connect('clicked'){ + chargement =0 + window.destroy + @menu.destroy + $window = Plateau.new(tableauBtn[x].getNiveau,tableauBtn[x].getY,tableauBtn[x].getX, diff,chargement) + Gtk.main + } + btnRetourcharg = builder.get_object('btnRetourcharg') + btnRetourcharg.signal_connect('clicked'){ + @menu.set_sensitive(true) + window.destroy + } + + #---- Création du style CSS ---- + btn_css = Gtk::CssProvider.new + btn_css.load(data: <<-CSS) + @import url("css/style.css"); + CSS + + #---- Affectation du style CSS ---- + btnLancer.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER) + btnSave.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER) + btnRetourcharg.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER) + + + window.show_all + } + + } + + + @menu.show + end +end diff --git a/Pause.rb b/Pause.rb new file mode 100644 index 00000000..ed222d06 --- /dev/null +++ b/Pause.rb @@ -0,0 +1,62 @@ +require 'gtk3' + +## +# Représentation du Menu Pause +## +class Pause + + # $window -> variable globale contenant la fenetre du plateau + + # Constructeur du Menu Pause + def initialize() + + file_import = "./Ressources/Glade/menu_pause.glade" + builder = Gtk::Builder.new + builder.add_from_file(file_import) + + + menu_pause = builder.get_object('menu_pause') + + menu_pause.signal_connect "destroy" do + $window.getPlateau().set_sensitive(true) + menu_pause.destroy + end + + menu_pause.set_window_position Gtk::WindowPosition::CENTER + + + boutonReprendre = builder.get_object('boutonReprendre') + boutonReprendre.signal_connect('clicked'){ + $window.getPlateau().set_sensitive(true) + menu_pause.destroy + $window.lancerChrono + } + + boutonRecommencer = builder.get_object('boutonRecommencer') + boutonRecommencer.signal_connect('clicked'){ + $window.getPlateau().set_sensitive(true) + menu_pause.destroy + $window.resetPlateau() + } + + boutonQuitter = builder.get_object('boutonQuitter') + boutonQuitter.signal_connect('clicked'){ + menu_pause.destroy + $window.getPlateau().destroy + MainMenu.new + Gtk.main + } + + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/style.css"); + CSS + + menu_pause.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonReprendre.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonRecommencer.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + menu_pause.show_all + end +end \ No newline at end of file diff --git a/Plateau.rb b/Plateau.rb new file mode 100644 index 00000000..ad691a11 --- /dev/null +++ b/Plateau.rb @@ -0,0 +1,305 @@ +require 'gtk3' + +load "HashiGrid.rb" +load "Ile.rb" +load "Pont.rb" +load "Hypothese.rb" +load "Sauvegarde.rb" +load "Aide.rb" + +## +# Cette classe représente le plateau du plateau du jeu +## +class Plateau + + # @nomniv -> Nom du niveau lancé + # @x -> Nombre de colonnes + # @y -> Nombre de lignes + # @diff -> Difficulté du niveau lancé + # @chargement -> Variable indiquand si le niveau créé est un nouveau niveau ou un niveau chargé + # @grid -> Variable contenant la grille du niveau + # @plateau -> Variable contenant la fenetre du jeu + # @t -> Variable contenant le thread pour faire fonctionner le chronomètre + # @label_aide -> Variable contenant le texte affiché quand on demande de l'aide + # @aide -> Variable contenant une instance du système d'aide + # $temps -> Variable contenant l'affichage du chronomètre dans la fenêtre + # @boxJeu -> Variable contenant le style de la grille de jeu + # $tempssec -> Variable contenant le temps écoulé pendant la partie, incrémenté dans le thread + # @boxPrincipale -> Variable contenant le style de la fenètre de jeu + + + # Référence sur la grille + attr_accessor :grid + + # Constructeur du plateau + # * +nomniv+ nom du niveau lancé + # * +x+ nombre de colonnes + # * +y+ nombre de lignes + # * +diff+ difficulté du niveau lancé + # * +chargement+ variable indiquand si le niveau créé est un nouveau niveau ou un niveau chargé + + def initialize(nomniv, x, y, diff, chargement) + @nomniv=nomniv + @x=x + @y=y + @diff = diff + @chargement=chargement #0 ou 1 si 1 ils s'agit d'un chargement + + # Initialisation de la grille + @grid = HashiGrid.new(@nomniv, @diff, @x,@y) + + #Creation de la fenêtre + main_window_res = "./Ressources/Glade/plateau.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + @plateau = builder.get_object('plateau') + @plateau.set_title "Hashi Game" + @plateau.signal_connect "destroy" do + Thread.kill(@t) + Gtk.main_quit + end + + @plateau.set_window_position Gtk::WindowPosition::CENTER + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/plateau_style.css"); + CSS + + #Reglage bouton pause + boutonPause = builder.get_object('boutonPause') + boutonPause.signal_connect('clicked'){ + @plateau.set_sensitive(false) + Thread.kill(@t) + pause = Pause.new() + } + @plateau.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + @label_aide = builder.get_object('label_aide') + @label_aide.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + + @aide = Aide.new(@grid) + @label_aide.set_label("") + + + # #Reglage du bouton indice + boutonIndice = builder.get_object('boutonIndice') + boutonIndice.signal_connect('clicked'){ + @label_aide.set_label(@aide.getMessageAide) + @boxPrincipale.show_all + } + + # #Reglage du bouton Undo + boutonUndo = builder.get_object('boutonUndo') + + # #Reglage du bouton Redo + boutonRedo = builder.get_object('boutonRedo') + + # #Reglage du bouton Hypothèse + boutonHypo = builder.get_object('boutonHypo') + boutonHypo.signal_connect('clicked'){ + @plateau.set_sensitive(false) + Hypothese.new(self) + } + + boutonPause.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonIndice.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonRedo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonUndo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + boutonHypo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + # #Creation de la barre d'outils en haut de la fenêtre + + $temps = builder.get_object('temps') + + + @boxJeu = builder.get_object('boxJeu') + @boxJeu.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + # @boxJeu.set_border_width(10) + $temps = builder.get_object('temps') + + # Chargement de la grille + @grid.chargeGrille() + @grid.chargeVoisins + + $tempssec = 0 + + if(@chargement==1) + $tempssec = Sauvegarde.charge(@grid,nomniv,diff) + end + + $temps.set_text($tempssec.to_s) + + @grid.expand = true + @grid.halign = Gtk::Align::CENTER + @grid.valign = Gtk::Align::CENTER + @grid.set_row_homogeneous(true) + @grid.set_column_homogeneous(true) + + + boutonUndo.signal_connect('clicked'){ + @grid.undoPrevious + } + + boutonRedo.signal_connect('clicked'){ + @grid.redoPrevious + } + + # ajoutGrille(grid) + @boxJeu.add(@grid) + @boxJeu.show_all + + #Creation et affichage de la fenêtre principale + @boxPrincipale = builder.get_object('boxPrincipale') + @boxPrincipale.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + #Gestion du temps + + @chargement = 0 + + @plateau.show + + #Thread chronomètre + lancerChrono + end + + # Retourne le plateau de jeu + def getPlateau() + return @plateau + end + + # Méthode responsable de la gestion d'une parti fini + def partiFini + + if(@grid.grilleFini?) + + sleep(0.5) # on attend 0.5 sec afin de voir le coup qu'on a effectuer avant l'affichage # + Thread.kill(@t) + @plateau.set_sensitive(false) + + main_window_res = "./Ressources/Glade/menu_win.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + window = builder.get_object('menu_gain') + window.set_title "VICTOIRE" + window.set_window_position Gtk::WindowPosition::CENTER + window.signal_connect "destroy" do + Gtk.main_quit + end + + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/menu_pause.css"); + CSS + + window.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + #Affichage du temps + texteTemps = builder.get_object('texteTemps') + texteTemps.set_markup("Votre temps : " + $tempssec.to_s + " secondes.\n") + texteTemps.set_justify(Gtk::Justification::CENTER) + + saveBox = builder.get_object('saveBox') + + # #Zone de texte pour entrer son pseudo + zonetexte= builder.get_object('zonetexte') + zonetexte.set_placeholder_text("Votre pseudo") + + # #Bouton pour sauvegarder + btnSauvegarder = builder.get_object('btnSauvegarder') + textLabel = builder.get_object("textLabel") + + btnSauvegarder.signal_connect('clicked'){ + label = zonetexte.text + " sauvegardé.\n" + Sauvegarde.saveTime(@nomniv, @diff, $tempssec.to_s, zonetexte.text) + textLabel.set_markup(label) + btnSauvegarder.hide() + + } + + # #Bouton pour recommencer la partie + btnRecommencer = builder.get_object('btnRecommencer') + btnRecommencer.signal_connect('clicked'){ + self.getPlateau().set_sensitive(true) + window.destroy + self.resetPlateau() + Gtk.main + } + + # #Bouton pour retourner au menu principal + btnRetour = builder.get_object('btnRetour') + btnRetour.signal_connect('clicked'){ + window.destroy + @plateau.destroy + MainMenu.new + Gtk.main + } + + btnRecommencer.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + btnRetour.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + btnSauvegarder.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + Sauvegarde.saveDelete(@nomniv, @diff) + + + window.show_all + end + + end + + # Cette méthode permet de gérer tous les traitements + # lors de la validation de l'hypothèse + # Elle supprime l'ancienne grille et met en place la nouvelle + # * +newGrid+ la grille du mode hypothèse qui va remplacer la grille actuelle + def hypotheseValider(newGrid) + + @boxJeu.remove(@grid) + @grid = newGrid + @grid.expand = true + @grid.halign = Gtk::Align::CENTER + @grid.valign = Gtk::Align::CENTER + @grid.set_row_homogeneous(true) + @grid.set_column_homogeneous(true) + if(@grid.grilleFini? ) + self.partiFini + end + + @grid.undoRedo.cleanAll() + @boxJeu.add(@grid) + + return self + end + + #Lance un thread pour le chronometre + def lancerChrono() + @t = Thread.new{ + loop{ + + sleep(1) + $tempssec += 1 + $temps.set_text($tempssec.to_s) + } + + Thread.exit + } + + return self + end + + + # Mis à jour du niveau + # Dans notre cas on reset le plateau + def resetPlateau() + + + Thread.kill(@t) + + @plateau.destroy + + $window = Plateau.new(@nomniv,@y,@x, @diff,@chargement) + Gtk.main + + return self + end +end diff --git a/Pont.rb b/Pont.rb new file mode 100644 index 00000000..7046c30c --- /dev/null +++ b/Pont.rb @@ -0,0 +1,99 @@ +require 'gtk3' + +load "Ile.rb" + +## +# Représentation des ponts du jeu +## +class Pont < Ile + + # @typePont -> Représente les différents types de pont. + # @directionPont -> Représente la direction du pont. + # @estDouble -> Attribut permettant de savoir si un pont est double ou non + + + # Représente les différents types de pont. (0 = aucun bord, 1 = un pont, 2 = deux pont) + attr_accessor :typePont + + # Représente la direction du pont. (0 = pas de pont, 1 = horizontal, 2 = vertical) + attr_accessor :directionPont + + # Attribut permettant de savoir si un pont est double ou non + attr_accessor :estDouble + + # Constructeur d'un pont + # * +grid+ Référence sur la grille + # * +col+ Référence sur la grille + # * +lig+ Référence sur la grille + def initialize(grid, col, lig ) + super(grid, '0', col, lig ) + @typePont = 0 + @estDouble = false + @directionPont = 0 + + self.set_name('pont') + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/plateau_style.css"); + CSS + self.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + self.set_sensitive(false) # Un pont n'est pas cliquable par défaut + self.status = 'p' + end + + # Retourne la direction du pont + def get_directionPont + return @directionPont + end + + # Modifie la direction du pont + def set_directionPont(val) + @directionPont = val + return self + end + + # Modifie le type du pont + def set_typePont(val) + if val >= 0 + @typePont = val + else + @typePont = 0 + end + + return self + end + + # Retourne le type du pont + def get_typePont + return @typePont + end + + + # Méthode responsable de la mise à jour d'un pont. + def update() + + if @typePont == 0 && @directionPont == 0 + self.image.from_file= "Ressources/Pont/0.png" + elsif @typePont == 1 + # Si le pont == 1 alors il est horizontal + # Sinon il est vertical + if @directionPont == 1 + self.image.from_file= "Ressources/Pont/h_simple.png" + else + self.image.from_file= "Ressources/Pont/v_simple.png" + end + elsif @typePont == 2 + if @directionPont == 1 + self.image.from_file= "Ressources/Pont/h_double.png" + else + self.image.from_file= "Ressources/Pont/v_double.png" + + end + end + + return self + end + + +end + diff --git a/README.md b/README.md index 0fe05830..cd5f1295 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,25 @@ # Hashi-TP4 -Projet du groupe 4 dans le cadre du Genie Logiciel du S6 de L3 Informatique - -Groupe 4 -Aaron AMANI -Axel JOURRY -Cindy CALVADOS -Clement JANVIER -Collins SOARES -Florian DREUX -Rayyan LAJNEF -Thomas MALABRY -Willhem LIBAN +Projet du groupe 4 dans le cadre du Genie Logiciel du S6 de L3 Informatique. + +# Lancer le programme +Double cliquez sur le fichier Hashi.sh contenu dans le dossier Hashi sur le bureau. + +# Mot de passe de l'image virtuelle +HashiGroupe4 + +# Lien du github +https://github.com/Nowyyy/Hashi-TP4 + +# Lien du diagramme de Gantt +https://docs.google.com/spreadsheets/d/1ex0zHt4QX2DAGEMhy0mUghw9voqo3CULaicxu2CyPyU/edit#gid=90785337 + +# Groupe 4 +Aaron AMANI +Axel JOURRY +Cindy CALVADOS +Clement JANVIER +Collins SOARES +Florian DREUX +Rayyan LAJNEF +Thomas MALABRY +Willhem LIBAN diff --git a/Ressources/Glade/hypo.glade b/Ressources/Glade/hypo.glade new file mode 100644 index 00000000..8095595a --- /dev/null +++ b/Ressources/Glade/hypo.glade @@ -0,0 +1,201 @@ + + + + + + True + False + ../Plateau/aide.png + + + True + False + ../Plateau/valider.png + + + True + False + ../Plateau/annuler.png + + + True + False + ../Plateau/redo.png + + + True + False + ../Plateau/undo.png + + + False + + + True + False + vertical + 5 + + + True + False + 0 + none + + + True + False + True + + + + True + True + True + aide + True + + + False + True + 0 + + + + + + + True + True + undo + True + True + + + False + True + 1 + + + + + + + True + True + True + redo + True + + + False + True + 2 + + + + + + + + + + + False + True + 0 + + + + + True + False + 0 + none + + + True + False + True + + + + + + + + + + + + + + + + + True + True + 1 + + + + + True + False + + + + False + True + 2 + + + + + True + False + center + center + 9 + + + valider + True + True + True + True + + + False + True + 0 + + + + + True + annuler + True + True + True + + + False + True + 1 + + + + + False + True + 3 + + + + + + + diff --git a/Ressources/Glade/menu_chargement.glade b/Ressources/Glade/menu_chargement.glade new file mode 100644 index 00000000..f09825d1 --- /dev/null +++ b/Ressources/Glade/menu_chargement.glade @@ -0,0 +1,124 @@ + + + + + + + 500 + 300 + False + popup + False + center-on-parent + 440 + 250 + True + True + False + + + True + False + 20 + 20 + 20 + 0 + none + + + 100 + 80 + True + False + vertical + + + True + False + 20 + 20 + ../flowers.svg + + + True + True + 0 + + + + + True + False + center + vertical + True + + + Nouvelle partie + True + True + True + center + + + + True + True + 0 + + + + + Charger Partie + True + True + True + center + + + + False + True + 1 + + + + + Retour + True + True + True + center + + + + False + True + 2 + + + + + True + True + 1 + + + + + + + + + + + + diff --git a/Ressources/Glade/menu_pause.glade b/Ressources/Glade/menu_pause.glade new file mode 100644 index 00000000..e4a68f22 --- /dev/null +++ b/Ressources/Glade/menu_pause.glade @@ -0,0 +1,124 @@ + + + + + + + 500 + 300 + False + popup + False + center-on-parent + 440 + 250 + True + True + True + + + True + False + 20 + 20 + 20 + 0 + none + + + 100 + 80 + True + False + vertical + + + True + False + 20 + 20 + ../Pause/pause.svg + + + False + True + 0 + + + + + True + False + center + vertical + True + + + Reprendre + True + True + True + center + + + + True + True + 0 + + + + + Recommencer + True + True + True + center + + + + False + True + 1 + + + + + Quitter + True + True + True + center + + + + False + True + 2 + + + + + True + True + 1 + + + + + + + + + + + + diff --git a/Ressources/Glade/menu_principal.glade b/Ressources/Glade/menu_principal.glade new file mode 100644 index 00000000..6c4adbc0 --- /dev/null +++ b/Ressources/Glade/menu_principal.glade @@ -0,0 +1,169 @@ + + + + + + + + 900 + 700 + False + False + + + True + False + 0 + none + + + True + False + 20 + 20 + 20 + + vertical + bottom + + + True + False + ../logo-principal.png + + + + False + False + 0 + + + + + True + False + vertical + 33 + + + Selection niveau + 222 + 56 + True + True + True + center + center + + + + False + True + 0 + + + + + Tutoriel + 222 + 56 + True + True + True + center + center + + + + False + True + 1 + + + + + Classement + 222 + 56 + True + True + True + center + center + + + + False + True + 2 + + + + + Quitter + 222 + 56 + True + True + True + center + center + + + + False + True + 3 + + + + + A propos + 117 + 50 + True + True + True + end + end + True + + + + False + True + 4 + + + + + True + False + 1 + + + + + + + + + + + + diff --git a/Ressources/Glade/menu_selection.glade b/Ressources/Glade/menu_selection.glade new file mode 100644 index 00000000..d5d65b5f --- /dev/null +++ b/Ressources/Glade/menu_selection.glade @@ -0,0 +1,309 @@ + + + + + + + True + False + center + center + ../MenuSelection/back.png + + + True + False + end + ../MenuSelection/btn_grille.png + + + True + False + ../MenuSelection/facile_star.svg + + + True + False + ../MenuSelection/moyen_star.svg + + + True + False + ../MenuSelection/difficile_star.svg + + + 900 + 700 + False + False + + + True + False + 20 + 20 + 20 + 20 + 0 + none + + + True + False + vertical + + + True + False + + + True + True + True + btn_retour_img + + + + False + True + 0 + + + + + True + False + end + center + 15 + + + True + True + True + image2 + + + + False + True + 0 + + + + + True + True + True + image3 + + + + False + True + 1 + + + + + True + True + True + image4 + + + + False + True + 2 + + + + + False + True + end + 1 + + + + + True + False + gtk-missing-image + + + True + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + bottom + + + True + False + ../MenuSelection/facile.png + + + False + True + -1 + + + + + scrolledwindow + 700 + True + True + center + + + True + False + none + center + + + True + False + vertical + True + + + True + False + + none + False + + + True + True + center + center + False + False + + + + + + + + + True + True + 0 + + + + + True + False + none + False + + + True + True + False + False + + + + + + + + + True + True + 1 + + + + + True + False + none + False + + + True + True + False + False + + + + + + + + + True + True + 2 + + + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + + + + + + + + diff --git a/Ressources/Glade/menu_win.glade b/Ressources/Glade/menu_win.glade new file mode 100644 index 00000000..d46eb26d --- /dev/null +++ b/Ressources/Glade/menu_win.glade @@ -0,0 +1,210 @@ + + + + + + + 500 + 300 + True + False + center + True + False + + + True + False + 20 + 20 + 20 + 0 + none + + + 100 + 80 + True + False + vertical + + + True + False + vertical + + + True + False + ../victoire.png + + + False + True + 0 + + + + + True + False + Vous etes vraiment trop fort ! + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + center + vertical + True + + + True + False + center + center + + + False + True + 0 + + + + + True + False + center + center + vertical + + + True + False + Votre pseudo + center + + + + + + False + True + 0 + + + + + True + True + + + True + True + 1 + + + + + Sauvegarder + True + True + True + + + + True + True + 2 + + + + + False + True + 1 + + + + + True + False + 10 + + + Rejouer + True + True + True + center + + + + False + True + 0 + + + + + Quitter + True + True + True + center + + + + False + True + 1 + + + + + False + True + 2 + + + + + True + True + 1 + + + + + + + + + + + + diff --git a/Ressources/Glade/plateau.glade b/Ressources/Glade/plateau.glade new file mode 100644 index 00000000..b51e421e --- /dev/null +++ b/Ressources/Glade/plateau.glade @@ -0,0 +1,266 @@ + + + + + + + True + False + ../Plateau/aide.png + + + True + False + ../Plateau/hypothese.png + + + True + False + center + ../Plateau/pause.png + + + True + False + ../Plateau/redo.png + + + True + False + ../Plateau/undo.png + + + 1000 + 700 + False + False + + + True + False + 50 + 50 + 0 + none + + + True + False + vertical + + + True + False + vertical + + + menu_haut + True + False + 20 + True + + + True + False + True + + + boutonPause + True + True + True + start + pause + + + + False + True + 0 + + + + + True + False + "" + + + + + + + False + True + 1 + + + + + False + True + 0 + + + + + True + False + end + center + 15 + + + + + + True + True + True + aide + + + + False + True + 1 + + + + + True + True + True + hypothese + + + + False + True + 2 + + + + + False + True + end + 1 + + + + + True + False + center + center + 15 + + + boutonUndo + True + True + True + undo + + + + False + True + 1 + + + + + boutonRedo + True + True + True + redo + + + + False + True + 2 + + + + + True + True + 2 + + + + + False + True + 0 + + + + + menu_haut + True + center + center + False + 20 + 20 + 20 + True + + + + False + True + 1 + + + + + + False + True + 0 + + + + + True + 20 + False + "" + + + + + + + + + + + + + diff --git a/Ressources/Glade/tutoriel.glade b/Ressources/Glade/tutoriel.glade new file mode 100644 index 00000000..6cfdaa93 --- /dev/null +++ b/Ressources/Glade/tutoriel.glade @@ -0,0 +1,108 @@ + + + + + + + True + False + ../Tuto/droite.svg + + + True + False + ../Tuto/gauche.svg + + + True + False + ../Tuto/home.svg + + + False + center + center + False + center + + + True + False + 10 + vertical + + + True + False + center + center + + + + True + True + True + gauche_img + + + False + True + 0 + + + + + True + False + center + center + ../Tuto/tuto_2.svg + + + True + True + 1 + + + + + True + True + True + droite_img + + + False + True + 2 + + + + + False + True + 0 + + + + + True + True + none + True + image1 + True + + + False + True + 1 + + + + + + + diff --git a/Ressources/Ile/0.png b/Ressources/Ile/0.png new file mode 100644 index 00000000..df7f43f4 Binary files /dev/null and b/Ressources/Ile/0.png differ diff --git a/Ressources/Ile/1.png b/Ressources/Ile/1.png new file mode 100644 index 00000000..e5e46e4a Binary files /dev/null and b/Ressources/Ile/1.png differ diff --git a/Ressources/Ile/1_r.png b/Ressources/Ile/1_r.png new file mode 100644 index 00000000..5b5d552a Binary files /dev/null and b/Ressources/Ile/1_r.png differ diff --git a/Ressources/Ile/1_s.png b/Ressources/Ile/1_s.png new file mode 100644 index 00000000..874958a7 Binary files /dev/null and b/Ressources/Ile/1_s.png differ diff --git a/Ressources/Ile/1_v.png b/Ressources/Ile/1_v.png new file mode 100644 index 00000000..7f4883de Binary files /dev/null and b/Ressources/Ile/1_v.png differ diff --git a/Ressources/Ile/2.png b/Ressources/Ile/2.png new file mode 100644 index 00000000..ea12c469 Binary files /dev/null and b/Ressources/Ile/2.png differ diff --git a/Ressources/Ile/2_r.png b/Ressources/Ile/2_r.png new file mode 100644 index 00000000..d8b00d3a Binary files /dev/null and b/Ressources/Ile/2_r.png differ diff --git a/Ressources/Ile/2_s.png b/Ressources/Ile/2_s.png new file mode 100644 index 00000000..61cd39eb Binary files /dev/null and b/Ressources/Ile/2_s.png differ diff --git a/Ressources/Ile/2_v.png b/Ressources/Ile/2_v.png new file mode 100644 index 00000000..7a464710 Binary files /dev/null and b/Ressources/Ile/2_v.png differ diff --git a/Ressources/Ile/3.png b/Ressources/Ile/3.png new file mode 100644 index 00000000..fdeb0b0c Binary files /dev/null and b/Ressources/Ile/3.png differ diff --git a/Ressources/Ile/3_r.png b/Ressources/Ile/3_r.png new file mode 100644 index 00000000..511295be Binary files /dev/null and b/Ressources/Ile/3_r.png differ diff --git a/Ressources/Ile/3_s.png b/Ressources/Ile/3_s.png new file mode 100644 index 00000000..b1f391f8 Binary files /dev/null and b/Ressources/Ile/3_s.png differ diff --git a/Ressources/Ile/3_v.png b/Ressources/Ile/3_v.png new file mode 100644 index 00000000..6c037d13 Binary files /dev/null and b/Ressources/Ile/3_v.png differ diff --git a/Ressources/Ile/4.png b/Ressources/Ile/4.png new file mode 100644 index 00000000..2f1c02eb Binary files /dev/null and b/Ressources/Ile/4.png differ diff --git a/Ressources/Ile/4_r.png b/Ressources/Ile/4_r.png new file mode 100644 index 00000000..1446c532 Binary files /dev/null and b/Ressources/Ile/4_r.png differ diff --git a/Ressources/Ile/4_s.png b/Ressources/Ile/4_s.png new file mode 100644 index 00000000..0780f6ea Binary files /dev/null and b/Ressources/Ile/4_s.png differ diff --git a/Ressources/Ile/4_v.png b/Ressources/Ile/4_v.png new file mode 100644 index 00000000..7c6fef68 Binary files /dev/null and b/Ressources/Ile/4_v.png differ diff --git a/Ressources/Ile/5.png b/Ressources/Ile/5.png new file mode 100644 index 00000000..896afe96 Binary files /dev/null and b/Ressources/Ile/5.png differ diff --git a/Ressources/Ile/5_r.png b/Ressources/Ile/5_r.png new file mode 100644 index 00000000..37c780a2 Binary files /dev/null and b/Ressources/Ile/5_r.png differ diff --git a/Ressources/Ile/5_s.png b/Ressources/Ile/5_s.png new file mode 100644 index 00000000..55306a84 Binary files /dev/null and b/Ressources/Ile/5_s.png differ diff --git a/Ressources/Ile/5_v.png b/Ressources/Ile/5_v.png new file mode 100644 index 00000000..a0334c3f Binary files /dev/null and b/Ressources/Ile/5_v.png differ diff --git a/Ressources/Ile/6.png b/Ressources/Ile/6.png new file mode 100644 index 00000000..4f2b2b98 Binary files /dev/null and b/Ressources/Ile/6.png differ diff --git a/Ressources/Ile/6_r.png b/Ressources/Ile/6_r.png new file mode 100644 index 00000000..8272e952 Binary files /dev/null and b/Ressources/Ile/6_r.png differ diff --git a/Ressources/Ile/6_s.png b/Ressources/Ile/6_s.png new file mode 100644 index 00000000..f572ed98 Binary files /dev/null and b/Ressources/Ile/6_s.png differ diff --git a/Ressources/Ile/6_v.png b/Ressources/Ile/6_v.png new file mode 100644 index 00000000..dbd5ed0c Binary files /dev/null and b/Ressources/Ile/6_v.png differ diff --git a/Ressources/Ile/7.png b/Ressources/Ile/7.png new file mode 100644 index 00000000..ad25aeff Binary files /dev/null and b/Ressources/Ile/7.png differ diff --git a/Ressources/Ile/7_r.png b/Ressources/Ile/7_r.png new file mode 100644 index 00000000..fbb82788 Binary files /dev/null and b/Ressources/Ile/7_r.png differ diff --git a/Ressources/Ile/7_s.png b/Ressources/Ile/7_s.png new file mode 100644 index 00000000..3fca41c7 Binary files /dev/null and b/Ressources/Ile/7_s.png differ diff --git a/Ressources/Ile/7_v.png b/Ressources/Ile/7_v.png new file mode 100644 index 00000000..de375f96 Binary files /dev/null and b/Ressources/Ile/7_v.png differ diff --git a/Ressources/Ile/8.png b/Ressources/Ile/8.png new file mode 100644 index 00000000..dfe451c5 Binary files /dev/null and b/Ressources/Ile/8.png differ diff --git a/Ressources/Ile/8_r.png b/Ressources/Ile/8_r.png new file mode 100644 index 00000000..15ae77e0 Binary files /dev/null and b/Ressources/Ile/8_r.png differ diff --git a/Ressources/Ile/8_s.png b/Ressources/Ile/8_s.png new file mode 100644 index 00000000..34d39f91 Binary files /dev/null and b/Ressources/Ile/8_s.png differ diff --git a/Ressources/Ile/8_v.png b/Ressources/Ile/8_v.png new file mode 100644 index 00000000..64fe9fb1 Binary files /dev/null and b/Ressources/Ile/8_v.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/back.png b/Ressources/MenuSelection/Nouveau dossier/back.png new file mode 100644 index 00000000..3fc323b1 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/back.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/btn_grille.png b/Ressources/MenuSelection/Nouveau dossier/btn_grille.png new file mode 100644 index 00000000..79d56509 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/btn_grille.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/btnfacile.PNG b/Ressources/MenuSelection/Nouveau dossier/btnfacile.PNG new file mode 100644 index 00000000..c69589f9 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/btnfacile.PNG differ diff --git a/Ressources/MenuSelection/Nouveau dossier/difficile.png b/Ressources/MenuSelection/Nouveau dossier/difficile.png new file mode 100644 index 00000000..80d63db8 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/difficile.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/difficile_star.svg b/Ressources/MenuSelection/Nouveau dossier/difficile_star.svg new file mode 100644 index 00000000..5ab219ad --- /dev/null +++ b/Ressources/MenuSelection/Nouveau dossier/difficile_star.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Ressources/MenuSelection/Nouveau dossier/facile.png b/Ressources/MenuSelection/Nouveau dossier/facile.png new file mode 100644 index 00000000..3bde75ee Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/facile.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/facile_star.svg b/Ressources/MenuSelection/Nouveau dossier/facile_star.svg new file mode 100644 index 00000000..b913595a --- /dev/null +++ b/Ressources/MenuSelection/Nouveau dossier/facile_star.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Ressources/MenuSelection/Nouveau dossier/menu_selection.png b/Ressources/MenuSelection/Nouveau dossier/menu_selection.png new file mode 100644 index 00000000..9bbd5625 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/menu_selection.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/moyen.png b/Ressources/MenuSelection/Nouveau dossier/moyen.png new file mode 100644 index 00000000..e47a07e3 Binary files /dev/null and b/Ressources/MenuSelection/Nouveau dossier/moyen.png differ diff --git a/Ressources/MenuSelection/Nouveau dossier/moyen_star.svg b/Ressources/MenuSelection/Nouveau dossier/moyen_star.svg new file mode 100644 index 00000000..f47991cb --- /dev/null +++ b/Ressources/MenuSelection/Nouveau dossier/moyen_star.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Ressources/MenuSelection/back.png b/Ressources/MenuSelection/back.png new file mode 100644 index 00000000..3fc323b1 Binary files /dev/null and b/Ressources/MenuSelection/back.png differ diff --git a/Ressources/MenuSelection/btn_grille.png b/Ressources/MenuSelection/btn_grille.png new file mode 100644 index 00000000..79d56509 Binary files /dev/null and b/Ressources/MenuSelection/btn_grille.png differ diff --git a/Ressources/MenuSelection/btnfacile.PNG b/Ressources/MenuSelection/btnfacile.PNG new file mode 100644 index 00000000..c69589f9 Binary files /dev/null and b/Ressources/MenuSelection/btnfacile.PNG differ diff --git a/Ressources/MenuSelection/difficile.png b/Ressources/MenuSelection/difficile.png new file mode 100644 index 00000000..eafe7433 Binary files /dev/null and b/Ressources/MenuSelection/difficile.png differ diff --git a/Ressources/MenuSelection/difficile_star.svg b/Ressources/MenuSelection/difficile_star.svg new file mode 100644 index 00000000..5ab219ad --- /dev/null +++ b/Ressources/MenuSelection/difficile_star.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Ressources/MenuSelection/facile.png b/Ressources/MenuSelection/facile.png new file mode 100644 index 00000000..eb35a0a8 Binary files /dev/null and b/Ressources/MenuSelection/facile.png differ diff --git a/Ressources/MenuSelection/facile_star.svg b/Ressources/MenuSelection/facile_star.svg new file mode 100644 index 00000000..b913595a --- /dev/null +++ b/Ressources/MenuSelection/facile_star.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Ressources/MenuSelection/menu_selection.png b/Ressources/MenuSelection/menu_selection.png new file mode 100644 index 00000000..9bbd5625 Binary files /dev/null and b/Ressources/MenuSelection/menu_selection.png differ diff --git a/Ressources/MenuSelection/moyen.png b/Ressources/MenuSelection/moyen.png new file mode 100644 index 00000000..a2a131ed Binary files /dev/null and b/Ressources/MenuSelection/moyen.png differ diff --git a/Ressources/MenuSelection/moyen_star.svg b/Ressources/MenuSelection/moyen_star.svg new file mode 100644 index 00000000..f47991cb --- /dev/null +++ b/Ressources/MenuSelection/moyen_star.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Ressources/Pause/pause.svg b/Ressources/Pause/pause.svg new file mode 100644 index 00000000..301094ad --- /dev/null +++ b/Ressources/Pause/pause.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PAUSE + + + + diff --git a/Ressources/Plateau/aide.png b/Ressources/Plateau/aide.png new file mode 100644 index 00000000..63b1ea6e Binary files /dev/null and b/Ressources/Plateau/aide.png differ diff --git a/Ressources/Plateau/annuler.png b/Ressources/Plateau/annuler.png new file mode 100644 index 00000000..53d716d8 Binary files /dev/null and b/Ressources/Plateau/annuler.png differ diff --git a/Ressources/Plateau/hypothese.png b/Ressources/Plateau/hypothese.png new file mode 100644 index 00000000..9815a7a6 Binary files /dev/null and b/Ressources/Plateau/hypothese.png differ diff --git a/Ressources/Plateau/pause.png b/Ressources/Plateau/pause.png new file mode 100644 index 00000000..e63f484c Binary files /dev/null and b/Ressources/Plateau/pause.png differ diff --git a/Ressources/Plateau/plateau - Copie.png b/Ressources/Plateau/plateau - Copie.png new file mode 100644 index 00000000..770c49db Binary files /dev/null and b/Ressources/Plateau/plateau - Copie.png differ diff --git a/Ressources/Plateau/plateau.png b/Ressources/Plateau/plateau.png new file mode 100644 index 00000000..4cb70d18 Binary files /dev/null and b/Ressources/Plateau/plateau.png differ diff --git a/Ressources/Plateau/plateau.svg b/Ressources/Plateau/plateau.svg new file mode 100644 index 00000000..99a341f2 --- /dev/null +++ b/Ressources/Plateau/plateau.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Ressources/Plateau/redo.png b/Ressources/Plateau/redo.png new file mode 100644 index 00000000..03d28d6e Binary files /dev/null and b/Ressources/Plateau/redo.png differ diff --git a/Ressources/Plateau/undo.png b/Ressources/Plateau/undo.png new file mode 100644 index 00000000..d5176a65 Binary files /dev/null and b/Ressources/Plateau/undo.png differ diff --git a/Ressources/Plateau/valider.png b/Ressources/Plateau/valider.png new file mode 100644 index 00000000..8bfc35f7 Binary files /dev/null and b/Ressources/Plateau/valider.png differ diff --git a/Ressources/Pont/0.png b/Ressources/Pont/0.png new file mode 100644 index 00000000..86c15c6c Binary files /dev/null and b/Ressources/Pont/0.png differ diff --git a/Ressources/Pont/h_double.png b/Ressources/Pont/h_double.png new file mode 100644 index 00000000..1aaa0fd5 Binary files /dev/null and b/Ressources/Pont/h_double.png differ diff --git a/Ressources/Pont/h_simple.png b/Ressources/Pont/h_simple.png new file mode 100644 index 00000000..1ef9f0bb Binary files /dev/null and b/Ressources/Pont/h_simple.png differ diff --git a/Ressources/Pont/v_double.png b/Ressources/Pont/v_double.png new file mode 100644 index 00000000..bf648698 Binary files /dev/null and b/Ressources/Pont/v_double.png differ diff --git a/Ressources/Pont/v_simple.png b/Ressources/Pont/v_simple.png new file mode 100644 index 00000000..88760c5e Binary files /dev/null and b/Ressources/Pont/v_simple.png differ diff --git a/Ressources/Tuto/droite.svg b/Ressources/Tuto/droite.svg new file mode 100644 index 00000000..e02f8fde --- /dev/null +++ b/Ressources/Tuto/droite.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Ressources/Tuto/gauche.svg b/Ressources/Tuto/gauche.svg new file mode 100644 index 00000000..3526dea6 --- /dev/null +++ b/Ressources/Tuto/gauche.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Ressources/Tuto/home.svg b/Ressources/Tuto/home.svg new file mode 100644 index 00000000..4c7700d0 --- /dev/null +++ b/Ressources/Tuto/home.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Ressources/Tuto/tuto_1.png b/Ressources/Tuto/tuto_1.png new file mode 100644 index 00000000..d8506848 Binary files /dev/null and b/Ressources/Tuto/tuto_1.png differ diff --git a/Ressources/Tuto/tuto_10.png b/Ressources/Tuto/tuto_10.png new file mode 100644 index 00000000..489e2cb2 Binary files /dev/null and b/Ressources/Tuto/tuto_10.png differ diff --git a/Ressources/Tuto/tuto_2.png b/Ressources/Tuto/tuto_2.png new file mode 100644 index 00000000..b475e014 Binary files /dev/null and b/Ressources/Tuto/tuto_2.png differ diff --git a/Ressources/Tuto/tuto_2.svg b/Ressources/Tuto/tuto_2.svg new file mode 100644 index 00000000..cecf9e23 --- /dev/null +++ b/Ressources/Tuto/tuto_2.svg @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + + + + + + + + 6 + + + + + + + + + + 1 + + + + + + + + + 2 + + + + + + + + + 2 + + + + + + + + + 3 + + + + + + + + + 3 + + + + + + + + + 4 + + + + + + + + + 4 + + + + + + + + + 4 + + + + + + + + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pour jouer, vous devez relier les îles avec des lignes + simple ou double en cliquant sur celles ci. + Les îles en bleue correspondent à celles où l’île sélectionnée peut être reliée. + + + + + + + diff --git a/Ressources/Tuto/tuto_3.png b/Ressources/Tuto/tuto_3.png new file mode 100644 index 00000000..71b00e4c Binary files /dev/null and b/Ressources/Tuto/tuto_3.png differ diff --git a/Ressources/Tuto/tuto_4.png b/Ressources/Tuto/tuto_4.png new file mode 100644 index 00000000..b2723d5e Binary files /dev/null and b/Ressources/Tuto/tuto_4.png differ diff --git a/Ressources/Tuto/tuto_5.png b/Ressources/Tuto/tuto_5.png new file mode 100644 index 00000000..0ed19bac Binary files /dev/null and b/Ressources/Tuto/tuto_5.png differ diff --git a/Ressources/Tuto/tuto_6.png b/Ressources/Tuto/tuto_6.png new file mode 100644 index 00000000..de7f1902 Binary files /dev/null and b/Ressources/Tuto/tuto_6.png differ diff --git a/Ressources/Tuto/tuto_7.png b/Ressources/Tuto/tuto_7.png new file mode 100644 index 00000000..69446ac6 Binary files /dev/null and b/Ressources/Tuto/tuto_7.png differ diff --git a/Ressources/Tuto/tuto_8.png b/Ressources/Tuto/tuto_8.png new file mode 100644 index 00000000..525532f4 Binary files /dev/null and b/Ressources/Tuto/tuto_8.png differ diff --git a/Ressources/Tuto/tuto_9.png b/Ressources/Tuto/tuto_9.png new file mode 100644 index 00000000..c3f9b244 Binary files /dev/null and b/Ressources/Tuto/tuto_9.png differ diff --git a/Ressources/flowers.svg b/Ressources/flowers.svg new file mode 100644 index 00000000..0f46272e --- /dev/null +++ b/Ressources/flowers.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CHARGEMENT + + + + diff --git a/Ressources/logo-principal.png b/Ressources/logo-principal.png new file mode 100644 index 00000000..2d41f184 Binary files /dev/null and b/Ressources/logo-principal.png differ diff --git a/Ressources/menu_back.png b/Ressources/menu_back.png new file mode 100644 index 00000000..99da9b17 Binary files /dev/null and b/Ressources/menu_back.png differ diff --git a/Ressources/victoire.png b/Ressources/victoire.png new file mode 100644 index 00000000..1286558e Binary files /dev/null and b/Ressources/victoire.png differ diff --git a/Sauvegarde.rb b/Sauvegarde.rb new file mode 100644 index 00000000..2d2a413a --- /dev/null +++ b/Sauvegarde.rb @@ -0,0 +1,119 @@ + +## +# Cette classe est responsable de la sauvegarde +# Elle gère celle du classement et également de la grille +## +class Sauvegarde + + # @nomniv -> Le nom du niveau pour enregistrer le fichier de sauvegarde + # @dif -> La difficulté du niveau pour savoir ou sauvegarder le fichier + # @path -> Le chemin d'accès pour sauvegarder + + + + # Création d'une sauvegarde + # * +nomniv+ le nom du niveau pour enregistrer le fichier de sauvegarde + # * +dif+ la difficulté du niveau pour savoir ou sauvegarder le fichier + def initialize(nomniv,dif) + @nomniv=nomniv + @dif=dif + titre = nomniv.match(/[^\/]*.txt/) + @path = "./Sauvegarde/#{dif}/save#{titre}" + end + + # Sauvegarde de l'etat de la grille + # * +grille+ la grille a sauvegarder + def sauvegarder(grille) + + f=File.open(@path, 'w') + + for x in 0..(grille.colonnes-1) + for y in 0..(grille.lignes-1) + noeud = grille.get_child_at(y,x) + if (noeud.status == "i") + f.write(noeud.degreeMax) + elsif (noeud.status == "p") + if (noeud.typePont == 1 && noeud.directionPont == 1) + f.write("-") + elsif (noeud.typePont == 1 && noeud.directionPont == 2) + f.write("I") + elsif (noeud.typePont == 2 && noeud.directionPont == 1) + f.write("=") + elsif(noeud.typePont == 2 && noeud.directionPont == 2) + f.write("H") + else + f.write("0") + end + end + f.write(":") + + end + f.write("\n") + end + f.write($tempssec) + f.close + + return self + end + + # Sauvegarde des informations du joueur pour le classement + # * +nomGrille+ le nom du niveau pour savoir comment appeler le fichier + # * +difficulte+ la difficulté du niveau pour savoir ou sauvegarder le fichier + # * +chrono+ le chrono de l'utilisateur + # * +nom+ le nom de l'utilisateur + def Sauvegarde.saveTime(nomGrille,difficulte,chrono, nom) + titre = nomGrille.match(/[^\/]*.txt/) + file = File.open("./Classement/#{difficulte}/#{titre}", 'a') + file.write("#{chrono}:#{nom}\n") + file.close + + return self + end + + # Chargement d'une sauvegarde + # * +grille+ la grille du niveau pour l'initialiser avec le contenu du fichier + # * +nomniv+ le nom du niveau pour savoir quel fichier charger + # * +dif+ la difficulté du niveau pour savoir ou charger le fichier + def Sauvegarde.charge(grille, nomniv,dif) + titre = nomniv.match(/[^\/]*.txt/) + #sauvegarde devient un tableau + saveTab = File.readlines("./Sauvegarde/#{dif}/save#{titre}").map { |str| str.split(":") } + + for x in 0..(grille.lignes-1) + for y in 0..(grille.colonnes-1) + noeud = grille.get_child_at(y,x) + if ( noeud.status == 'i') + if(noeud.eastNode != nil) + if (saveTab[x][y+1] == '-') + grille.ajoutPont(noeud, noeud.eastNode) + elsif (saveTab[x][y+1] == '=') + grille.ajoutPont(noeud, noeud.eastNode) + grille.ajoutPont(noeud, noeud.eastNode) + end + end + if(noeud.southNode != nil) + if (saveTab[x+1][y] == "I") + grille.ajoutPont(noeud, noeud.southNode) + elsif (saveTab[x+1][y] == 'H') + grille.ajoutPont(noeud, noeud.southNode) + grille.ajoutPont(noeud, noeud.southNode) + end + end + end + end + end + return saveTab[grille.lignes][0].to_i + end + + # Methode supprimant un fichier de sauvegarde, appelé lorsque le joueur termine le niveau + # * +nomniv+ le nom du niveau pour savoir comment appeler le fichier + # * +dif+ la difficulté du niveau pour savoir ou charger le fichier + def Sauvegarde.saveDelete(nomniv, dif) + titre = nomniv.match(/[^\/]*.txt/) + f = File.open("./Sauvegarde/#{dif}/save#{titre}", 'w') + f.close() + + return self + end + +end \ No newline at end of file diff --git a/Sauvegarde/Difficile/test.txt b/Sauvegarde/Difficile/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Sauvegarde/Difficile/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/Sauvegarde/Facile/test.txt b/Sauvegarde/Facile/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Sauvegarde/Facile/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/Sauvegarde/Moyen/test.txt b/Sauvegarde/Moyen/test.txt new file mode 100644 index 00000000..3b95878d --- /dev/null +++ b/Sauvegarde/Moyen/test.txt @@ -0,0 +1 @@ +Pour faire apparaitre le dossier dans git \ No newline at end of file diff --git a/Tuto.rb b/Tuto.rb new file mode 100644 index 00000000..abdcf6b1 --- /dev/null +++ b/Tuto.rb @@ -0,0 +1,87 @@ +require 'gtk3' + +$id=1 + + +## +# Cette classe représente le menu Tutoriel +class Tuto + + # @tutoriel -> Variable contenant la fenetre du tutoriel + # @box_tuto -> Variable contenant les informations d'affichage de la zone de tutoriel + # @btnGauche -> Variable contenant le bouton pour revenir en arrière dans le tutoriel + # @btnDroite -> Variable contenant le bouton pour avancer dans le tutoriel + # @img_tuto -> Variable contenant l'image affichée sur le tutoriel. + + # Constructeur du menu tutoriel + def initialize + + main_window_res = "./Ressources/Glade/tutoriel.glade" + builder = Gtk::Builder.new + builder.add_from_file(main_window_res) + + @tutoriel = builder.get_object('tutoriel') + @tutoriel.set_title "Tutoriel" + @tutoriel.signal_connect "destroy" do + @tutoriel.destroy + Gtk.main_quit + end + + @tutoriel.set_window_position Gtk::WindowPosition::CENTER + css_file = Gtk::CssProvider.new + css_file.load(data: <<-CSS) + @import url("css/tuto.css"); + CSS + + @box_tuto = builder.get_object('box_principale') + + + # Creation et ajouts des boutons <- et -> du Tutoriel # + @btnGauche = builder.get_object('btnGauche') + @btnDroite = builder.get_object('btnDroite') + + + #--------------------------------------------# + # Creation du bouton quitter du Tutoriel # + btnQuitter = builder.get_object('home') + btnQuitter.signal_connect('clicked') { + @tutoriel.destroy + MainMenu.new + Gtk.main + } + + #--------------------------------------------# + # Lien entre le fichier css et les différents composants + + @box_tuto.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + @box_tuto.style_context.add_class('tuto_1') + @btnDroite.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + btnQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + @btnGauche.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + @tutoriel.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER) + + j = 0 + @box_tuto.show_all + + @img_tuto = builder.get_object('img_tuto') + @img_tuto.from_file = "./Ressources/Tuto/tuto_1.png" + + @btnGauche.signal_connect('clicked') do + if $id > 1 && $id<=10 + $id-=1 + @img_tuto.from_file = "./Ressources/Tuto/tuto_"+$id.to_s+".png" + end + end + + @btnDroite.signal_connect('clicked') do + if $id>=1 && $id<10 + $id+=1 + @img_tuto.from_file = "./Ressources/Tuto/tuto_"+$id.to_s+".png" + end + end + + @tutoriel.show + + end + +end diff --git a/UndoRedo.rb b/UndoRedo.rb new file mode 100644 index 00000000..458784e9 --- /dev/null +++ b/UndoRedo.rb @@ -0,0 +1,51 @@ + +# Cette classe implémente les fonctionnalités Undo / Redo +class UndoRedo + + # @undoStack -> Pile contenant les action à enlever + # @reduStack -> Pile contenant les action à replacer tant que l'utilisateur n'effectue pas une autre action que le Redo + + + # Pile contenant les action à enlever + attr_accessor :undoStack + + # Pile contenant les action à replacer tant que l'utilisateur n'effectue pas une autre action + # que le Redo + attr_accessor :redoStack + + # Cette méthode est responsable de nettoyer la pile undo et redo + def cleanAll + @undoStack.clear + @redoStack.clear + + return self + end + + # Constructeur de la classe UndoRedo + # Initialise les deux tableaux + def initialize + @undoStack = Array.[] + @redoStack = Array.[] + end + + # Sauvegarde le clic de l'utilisateur + def saveUserClick(action) + @undoStack << action + + return self + end + + # Supprime et renvoi la dernière action utilisateur + def undoUserAction(action) + @undoStack.pop!() + + return self + end + + # Retourne true si la pile est vide + # Sinon false + def undoEmpty? + return @undoStack.empty? + end + +end \ No newline at end of file diff --git a/css/classement.png b/css/classement.png new file mode 100644 index 00000000..88d24f89 Binary files /dev/null and b/css/classement.png differ diff --git a/css/dark_mode.css b/css/dark_mode.css new file mode 100644 index 00000000..37b32b52 --- /dev/null +++ b/css/dark_mode.css @@ -0,0 +1,20 @@ +window{ + background-color:rgb(49,49,49); +} + +button { + background-color: rgb(34,34,34); + border-color: rgb(34,34,34); + font-size: 18px; +} + +button:hover { + background-color: rgb(22,22,22); + border-color: rgb(22,22,22); + box-shadow: 0px 0px 5px 0.8px rgb(22,22,22); +} + + +label { + color: #FFFFFF; +} diff --git a/css/logo-selection.png b/css/logo-selection.png new file mode 100644 index 00000000..905b4658 Binary files /dev/null and b/css/logo-selection.png differ diff --git a/css/menu_pause.css b/css/menu_pause.css new file mode 100644 index 00000000..5824d529 --- /dev/null +++ b/css/menu_pause.css @@ -0,0 +1,21 @@ +.menu{ + all:unset; + background-color: #020547; + border-radius: 5px; +} + +.btn-select { + all:unset; + background-color: #F8DDD7; + padding:10px 50px; + font-family: "Toledo"; + border-radius: 5px; + color: #CD4648; + font-size: 22px; +} + +.btn-select:hover { + background-color: #CD4648; + color: white; + transition: all .3s ease; +} diff --git a/css/plateau_style.css b/css/plateau_style.css new file mode 100644 index 00000000..4e496766 --- /dev/null +++ b/css/plateau_style.css @@ -0,0 +1,55 @@ + +.bg-black { + background-image: url('../Ressources/Plateau/plateau.svg'); + background-size: cover; + background-repeat: no-repeat; +} + +.bg-hypo { + background-color: #F8DDD7; +} + + +.boxJeu { + all:unset; + /* background-color: rgba(255, 255, 255, 0.1); + border-radius: 5px; */ +} + +.help { + background-image: url("../Ressources/Plateau/pause.png"); +} + + +.ile { + all:unset; + border:.2px solid #9c5503; + /* background-color: #5B3512; */ + border-radius: 5px; +} + +.label_aide { + color: #020547; + font-size: 18.7px; + font-weight: bold; + font-family: 'Toledo'; +} + +.ile:hover { + background-color:#FFFDA9; + } + + +.possibles { + background-color: rgba(136, 207, 255, .3); +} + + +.btn-menu{ + all: unset; +} + +.btn-menu:hover { + all:unset; + opacity: .6; +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 00000000..2b90db01 --- /dev/null +++ b/css/style.css @@ -0,0 +1,103 @@ + +button { + all:unset; + background-color: #CD4648; + padding-right:20px; + font-family: "Toledo"; + border-radius: 5px; + color: #FFFFFF; + font-size: 22px; +} + +.bg-menu { + background-image: url('../Ressources/menu_back.png'); + background-size: cover; + background-repeat: no-repeat; +} + +.bg-selection { + background-image: url('../Ressources/MenuSelection/menu_selection.png'); +background-size: cover; +background-repeat: no-repeat; + +} + +.listbox { + all:unset; +} + +.help { + background-image: url("../Ressources/Plateau/pause.png"); +} + + +.btn_niveau{ + padding: 10px; + background-color: white; +} + +.btn_niveau:hover { + background-color: #9EDDFF; +} + +.back { + all:unset; + +} + +.btn-blue { + all:unset; + border-radius: 5px; + background-color: #020547; + font-family: "Toledo"; + color: #FFFFFF; + font-size: 22px; +} + +box { + all:unset; +} + + + +.btn-help { + all:unset; + +} +.menu{ + all:unset; + background-color: #020547; + border-radius: 5px; +} + +.menu-ext { + background-color: #F8DDD7; +} + +#main_window{ + background-color: #051531; +} + +.btn-select { + all:unset; + background-color: #F8DDD7; + padding:10px 50px; + font-family: "Toledo"; + border-radius: 5px; + color: #CD4648; + font-size: 22px; +} +.btn-select:hover { + background-color: #CD4648; + color: white; + transition: all .3s ease; +} + + + .btn:hover { + background-color: #051531; + } + + + + \ No newline at end of file diff --git a/css/tuto.css b/css/tuto.css new file mode 100644 index 00000000..699fbd40 --- /dev/null +++ b/css/tuto.css @@ -0,0 +1,25 @@ +.bg-tuto { + all: unset; + background-image: url("../Ressources/Tuto/bg_tuto.svg"); + background-size: cover; + background-color: #F8DDD7; + background-repeat: no-repeat; +} + +.btnDroite { + background-image: url("../Ressources/Tuto/droite.svg"); + background-repeat: no-repeat; +} + +.btnGauche { + background-image: url("../Ressources/Tuto/gauche.svg"); + background-repeat: no-repeat; +} + +button{ + all:unset; +} + +button:hover { + opacity: .7; +} \ No newline at end of file diff --git a/doc/APropos.html b/doc/APropos.html new file mode 100644 index 00000000..d461c510 --- /dev/null +++ b/doc/APropos.html @@ -0,0 +1,183 @@ + + + + + + +class APropos - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class APropos +

+ +
+ +

Cette classe représente le menu A Propos

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur du menu A propos

+
+ Calls superclass method + +
+ +
+
# File APropos.rb, line 8
+    def initialize
+        super
+
+                set_title "A Propos"
+                set_resizable(true)
+                signal_connect "destroy" do 
+                        self.destroy
+                end
+
+                set_default_size 500, 400
+
+                set_window_position Gtk::WindowPosition::CENTER
+                
+                title = "<span font_desc = \"Toledo 30\">A Propos</span>\n"
+                texte = "<span font_desc = \"Toledo 15\">Créé par le groupe 4\n\n Aaron Amani \n Axel Jourry  \n Clement Janvier  \n Cindy Calvados  \n Collins Soares  \n Florian Dreux  \n Rayyan Lajnef  \n Thomas Malabry  \n Willhem Liban </span>\n"
+                
+                boxMenu = Gtk::Box.new(:vertical, 6)
+                
+                textTitle = Gtk::Label.new("A Propos")
+                textTitle.set_markup(title)
+                textTitle.set_justify(Gtk::Justification::CENTER)
+                
+                textepro = Gtk::Label.new()
+                textepro.set_markup(texte)
+                textepro.set_justify(Gtk::Justification::CENTER)
+
+                # Creation d'un nouveau fichier permettant de gérer le CSS
+                css_file = Gtk::CssProvider.new
+                css_file.load(data: <<-CSS)
+                        .about {
+                                background-color: #F8DDD7;
+                        }
+                        CSS
+
+                # Ajout de la classe CSS a la box
+                boxMenu.style_context.add_class('about')
+                # Lien entre la box et le fichier css afin que le css puisse être appliqué
+                boxMenu.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+                boxMenu.add(textTitle)
+                boxMenu.add(textepro)
+                
+                add(boxMenu)
+
+                show_all
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Aide.html b/doc/Aide.html new file mode 100644 index 00000000..019a7988 --- /dev/null +++ b/doc/Aide.html @@ -0,0 +1,705 @@ + + + + + + +class Aide - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Aide +

+ +
+ +

Cette classe correspond à l'aide du jeu

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ id[R] +
+ +
+

Identifiant correspondant a l'état dans laquelle se trouve le plateau

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(grille) + click to toggle source +
+ +
+

Constructeur du menu Aide

+
  • +

    grille grille dans laquelle l'aide doit opérer

    +
+ +
+
# File Aide.rb, line 22
+def initialize(grille)
+    @grille = grille
+    @nb_voisins = Array.new(@grille.sommets.size)
+    @id = 0
+end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ definirCas() + click to toggle source +
+ +
+

Méthode responsable de l'analyse de la grille ainsi que de ses sommets afin de déduire le cas dans lequel on se trouve.

+ +
+
# File Aide.rb, line 49
+def definirCas()
+    @grille.sommets.each_with_index do |x, i|
+      @nb_voisins[i] = x.compterVoisins()
+    end
+    if estCas1?()
+        return 1
+      elsif estCas2?()
+        return 2
+      elsif estCas3?()
+        return 3
+      elsif estCas4?()
+        return 4
+      elsif estCas5?()
+        return 5
+      elsif estCas6?()
+        return 6
+      elsif estCas7?()
+        return 7
+      elsif estCas8?()
+        return 8
+      elsif estCas9?()
+        return 9
+      elsif estCas10?()
+        return 10
+      elsif estCas11?()
+        return 11
+      elsif estCas12?()
+        return 12
+      elsif estCas13?()
+        return 13
+      elsif estCas14?()
+        return 14
+      else
+        return 0
+    end
+end
+
+
+ + +
+ +
+
+ estCas10?() + click to toggle source +
+ +
+

Cas 10 : île à 5 avec trois îles voisines restante dans la grille

+ +
+
# File Aide.rb, line 208
+def estCas10?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 5 && @nb_voisins[i] == 3 && !x.pontAvecVoisins()
+      @position =  @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas11?() + click to toggle source +
+ +
+

Cas 11 : île à 3 avec deux îles voisines restante dans la grille

+ +
+
# File Aide.rb, line 220
+def estCas11?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 3 && @nb_voisins[i] == 2 && !x.pontAvecVoisins()
+      @position =  @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas12?() + click to toggle source +
+ +
+

Cas 12 : île à 6 avec deux des îles voisines à 1

+ +
+
# File Aide.rb, line 231
+def estCas12?()
+  compteur = 0
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 6 && x.pontRestants() != x.degreeMax
+      x.getVoisins().each do |v|
+        compteur = 0
+        if v.degreeMax == 1
+          compteur += 1
+        end
+      end
+      if compteur == 2
+        @position = @grille.get_child_at(x.column, x.row)
+        return true
+      end
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas13?() + click to toggle source +
+ +
+

Cas 13 : île à 4 avec deux des îles voisines à 1

+ +
+
# File Aide.rb, line 252
+def estCas13?()
+  compteur = 0
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 4 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax
+      x.getVoisins().each do |v|
+        compteur = 0
+        if v.degreeMax == 1
+          compteur += 1
+        end
+      end
+      if compteur == 2
+        @position = @grille.get_child_at(x.column, x.row)
+        return true
+      end
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas14?() + click to toggle source +
+ +
+

Cas 14 : île à 2 avec deux îles voisines dont une île à 2 restante

+ +
+
# File Aide.rb, line 272
+def estCas14?()
+  voisinDeux = false
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 2 && @nb_voisins[i] == 2 && x.pontRestants() == 0
+      x.getVoisins().each do |v|
+        if v.degreeMax == 2
+          @position = @grille.get_child_at(x.column, x.row)
+          voisinDeux = true
+        end
+      end
+    end
+  end
+  return voisinDeux
+end
+
+
+ + +
+ +
+
+ estCas1?() + click to toggle source +
+ +
+

VALIDE

+ +
+
# File Aide.rb, line 87
+def estCas1?()
+    @grille.sommets.each_with_index do |x, i|
+      if @nb_voisins[i] == 1 && x.pontRestants() != x.degreeMax
+        @position = @grille.get_child_at(x.column, x.row)
+        return true
+      end
+    end
+    return false
+end
+
+
+ + +
+ +
+
+ estCas2?() + click to toggle source +
+ +
+

Cas 2 : île avec une seule île voisine restante dans la grille

+ +
+
# File Aide.rb, line 99
+def estCas2?()
+  @grille.sommets.each_with_index do |x, i|
+
+    if x.compterVoisinsNonComplets() == 1 && x.pontRestants() != x.degreeMax
+      @position =  @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas3?() + click to toggle source +
+ +
+

Cas 3 : île à 8 restante dans la grille

+ +
+
# File Aide.rb, line 111
+def estCas3?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 8 && x.pontRestants() != x.degreeMax
+      @position = @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas4?() + click to toggle source +
+ +
+

Cas 4 : île à 6 avec 3 îles voisines restante dans la grille

+ +
+
# File Aide.rb, line 122
+def estCas4?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 6 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax
+      @position = @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas5?() + click to toggle source +
+ +
+

Cas 5 : île à 4 avec 2 îles voisines restante dans la grille

+ +
+
# File Aide.rb, line 133
+def estCas5?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 4 && @nb_voisins[i] == 2 && x.pontRestants() != x.degreeMax
+      @position = @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas6?() + click to toggle source +
+ +
+

Cas 6 : île à 4 avec deux des îles voisines à 1

+ +
+
# File Aide.rb, line 144
+def estCas6?()
+  compteur = 0
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 4 && @nb_voisins[i] == 3 && x.pontRestants() != x.degreeMax
+      x.getVoisins().each do |v|
+        compteur = 0
+        if v.degreeMax == 1
+          compteur += 1
+        end
+      end
+      if compteur == 2
+        @position = @grille.get_child_at(x.column, x.row)
+        return true
+      end
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas7?() + click to toggle source +
+ +
+

Cas 7 : île à 5 avec trois îles voisines restante dans la grille

+ +
+
# File Aide.rb, line 164
+def estCas7?()
+  compteur = 0
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 5 && @nb_voisins[i] == 3 && !x.pontAvecVoisins()
+      @position = @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas8?() + click to toggle source +
+ +
+

Cas 8 : île à 3 avec deux îles voisines dont une à 1 restante dans la grille

+ +
+
# File Aide.rb, line 177
+def estCas8?()
+  compteur = 0
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 3 && @nb_voisins[i] == 2 && x.pontRestants() != x.degreeMax
+      x.getVoisins().each do |v|
+        if v.degreeMax == 1 && v.connexionRestantes() != 0
+          compteur += 1
+        end
+      end
+      if compteur == 1
+        @position =  @grille.get_child_at(x.column, x.row)
+        return true
+      end
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ estCas9?() + click to toggle source +
+ +
+

Cas 9 : île à 7 restante dans la grille

+ +
+
# File Aide.rb, line 197
+def estCas9?()
+  @grille.sommets.each_with_index do |x, i|
+    if x.degreeMax == 7 && !x.pontAvecVoisins()
+      @position = @grille.get_child_at(x.column, x.row)
+      return true
+    end
+  end
+  return false
+end
+
+
+ + +
+ +
+
+ getMessageAide() + click to toggle source +
+ +
+

Méthode permettant d'obtenir le message d'aide correspondant un id

+ +
+
# File Aide.rb, line 35
+def getMessageAide 
+  self.lireId()
+  file = File.readlines("AideTexte.txt")
+  file.each do |line|
+    temp = line.split(':')
+    if( temp[0] == @id.to_s )
+      return temp[1]
+    end
+  end
+end
+
+
+ + +
+ +
+
+ lireId() + click to toggle source +
+ +
+

Méthode permettant de definir un cas en fonction de l'etat du tableau

+ +
+
# File Aide.rb, line 29
+def lireId 
+    @id = definirCas()
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/AideTexte_txt.html b/doc/AideTexte_txt.html new file mode 100644 index 00000000..2aedf119 --- /dev/null +++ b/doc/AideTexte_txt.html @@ -0,0 +1,126 @@ + + + + + + +AideTexte - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

0:Une ile ne doit pas depasser son degre 1:Ile avec une seule ile voisine restante dans la grille 2:Ile avec une seule possibilite de connexion restante dans la grille 3:Ile a 8 restante dans la grille 4:Ile a 6 avec 3 iles voisines restante dans la grille 5:Ile a 4 avec 2 iles voisines restante dans la grille 6:Ile a 4 avec une ile voisine a 1 restante dans la grille 7:Ile a 5 avec trois iles voisines dont une a 1 restante dans la grille 8:Ile a 3 avec deux iles voisines dont une a 1 restante dans la grille 9:Ile a 7 restante dans la grille 10:Ile a 5 avec trois iles voisines restante dans la grille 11:Ile a 3 avec deux iles voisines restante dans la grille 12:Ile a 6 avec deux des iles voisines a 1 restante dans la grille 13:Ile a 4 avec deux des iles voisines a 1 restante dans la grille 14:Ile a 2 avec deux iles voisines dont une ile a 2 restante dans la grille

+ +
+ + + + + diff --git a/doc/BoutonChoix.html b/doc/BoutonChoix.html new file mode 100644 index 00000000..0b73c134 --- /dev/null +++ b/doc/BoutonChoix.html @@ -0,0 +1,383 @@ + + + + + + +class BoutonChoix - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class BoutonChoix +

+ +
+ +

Représentation d'un Bouton qui fait le lien entre le menu de sélection et chaque plateau qui hérite de la classe Button de Gtk

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ niveau[R] +
+ +
+

Variable qui correspond au PATH vers le niveau que redirige le bouton

+
+
+
+
+ path[RW] +
+ +
+

Variable contenant le path complet du bouton

+
+
+
+
+ x[R] +
+ +
+

Coordonnée X du plateau qui correspond au niveau renvoyer par le plateau

+
+
+
+
+ y[R] +
+ +
+

Coordonnée Y du plateau qui correspond au niveau renvoyer par le plateau

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(facile,moyen,hard,niv,x,y) + click to toggle source +
+ +
+

Constructeur du bouton

+
  • +

    facile Variable qui permet de savoir si le bouton renvoit vers un niveau facile

    +
  • +

    moyen Variable qui permet de savoir si le bouton renvoit vers un niveau moyen

    +
  • +

    hard Variable qui permet de savoir si le bouton renvoit vers un niveau difficile

    +
  • +

    niv Variable qui correspond au PATH vers le niveau que redirige le bouton

    +
  • +

    x Coordonnée X du plateau qui correspond au niveau renvoyer par le plateau

    +
  • +

    y Coordonnée Y du plateau qui correspond au niveau renvoyer par le plateau

    +
+
+ Calls superclass method + +
+ +
+
# File BoutonChoix.rb, line 37
+def initialize(facile,moyen,hard,niv,x,y)
+    super()
+    # Charge une image correspondants au noeud
+    self.image = Gtk::Image.new(:file => "./Ressources/MenuSelection/btn_grille.png") 
+    #  Retire les contours
+    self.set_relief(Gtk::ReliefStyle::NONE)
+    self.always_show_image = true
+     
+   @facile=facile  
+   @moyen=moyen
+   @hard=hard 
+   @niveau=niv
+   @x=x
+   @y=y
+   if(self.isFacile?)
+       self.set_label(@x.to_s+"x"+@y.to_s)
+   elsif(self.isMoyen?)
+       self.set_label(@x.to_s+"x"+@y.to_s)
+   else
+       self.set_label(@x.to_s+"x"+@y.to_s)
+   end
+end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ getNiveau() + click to toggle source +
+ +
+

Getter du niveau du plateau

+ +
+
# File BoutonChoix.rb, line 73
+def getNiveau
+    return @niveau
+end
+
+
+ + +
+ +
+
+ getX() + click to toggle source +
+ +
+

Getter de la coordonnée X de la grille du plateau

+ +
+
# File BoutonChoix.rb, line 77
+def getX
+    return @x
+end
+
+
+ + +
+ +
+
+ getY() + click to toggle source +
+ +
+

Getter de la coordonnée Y de la grille du plateau

+ +
+
# File BoutonChoix.rb, line 81
+def getY 
+    return @y
+end
+
+
+ + +
+ +
+
+ isFacile?() + click to toggle source +
+ +
+

Permet au bouton de savoir si le niveau qu'il renvoit est facile

+ +
+
# File BoutonChoix.rb, line 61
+def isFacile? 
+    return @facile
+end
+
+
+ + +
+ +
+
+ isHard?() + click to toggle source +
+ +
+

Permet au bouton de savoir si le niveau qu'il renvoit est difficile

+ +
+
# File BoutonChoix.rb, line 69
+def isHard?
+    return @hard
+end
+
+
+ + +
+ +
+
+ isMoyen?() + click to toggle source +
+ +
+

Permet au bouton de savoir si le niveau qu'il renvoit est Moyen

+ +
+
# File BoutonChoix.rb, line 65
+def isMoyen? 
+    return @moyen
+end
+
+
+ + +
+ +
+
+ set_path(path) + click to toggle source +
+ +
+

Méthode permettant de modifier le path d'un bouton

+
  • +

    path le nouveau path du bouton

    +
+ +
+
# File BoutonChoix.rb, line 87
+def set_path(path)
+    @path = path
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Classement.html b/doc/Classement.html new file mode 100644 index 00000000..c2bed1b5 --- /dev/null +++ b/doc/Classement.html @@ -0,0 +1,160 @@ + + + + + + +class Classement - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Classement +

+ +
+ +

Cette classe représente le Classement

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Création du Classement

+
+ Calls superclass method + MenuLayout::new +
+ +
+
# File Classement.rb, line 15
+def initialize
+            super("Classement","Classement")
+
+            image = @builder.get_object('logo-menu')
+    image.from_file = "css/classement.png"
+
+            # Lien entre le classement et chaque niveau
+    tableauBtn.each_index{|x| tableauBtn[x].signal_connect('clicked'){
+                    @menu.set_sensitive(false)
+                    File.open(tableauBtn[x].path, 'a')
+                    classement = ClassementNiveau.new(tableauBtn[x].path)
+                    
+                    classement.style_context.add_class('menu-ext')
+                    classement.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+    
+                    classement.signal_connect('destroy') {
+                                    @menu.set_sensitive(true)
+                    }
+            }   
+    }
+            
+    @menu.show
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Classement/Difficile/test_txt.html b/doc/Classement/Difficile/test_txt.html new file mode 100644 index 00000000..53a48152 --- /dev/null +++ b/doc/Classement/Difficile/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/Classement/Facile/test_txt.html b/doc/Classement/Facile/test_txt.html new file mode 100644 index 00000000..68530b81 --- /dev/null +++ b/doc/Classement/Facile/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/Classement/Moyen/test_txt.html b/doc/Classement/Moyen/test_txt.html new file mode 100644 index 00000000..32587cd8 --- /dev/null +++ b/doc/Classement/Moyen/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/ClassementNiveau.html b/doc/ClassementNiveau.html new file mode 100644 index 00000000..be2b8137 --- /dev/null +++ b/doc/ClassementNiveau.html @@ -0,0 +1,208 @@ + + + + + + +class ClassementNiveau - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class ClassementNiveau +

+ +
+ +

Cette classe représente l'affichage des résultats sur un niveau

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new(nomniv) + click to toggle source +
+ +
+

Création du Classement par Niveau

+
  • +

    nomniv Chemin du niveau

    +
+
+ Calls superclass method + +
+ +
+
# File ClassementNiveau.rb, line 12
+        def initialize(nomniv)
+        super
+                set_title "Classement Niveau " 
+                set_resizable(true)
+                signal_connect "destroy" do 
+                        self.destroy 
+                end
+
+                set_default_size 500, 400
+
+                set_window_position Gtk::WindowPosition::CENTER
+                
+                #Creation de zone de texte
+                texte = "<span font_desc = \"Toledo 20\">Resultats du Niveau :</span>\n"
+                texte1 = "<span font_desc = \"Toledo 15\">(Temps):(Joueur)</span>\n"
+                texte_0 =""
+
+                boxMenu = Gtk::Box.new(:vertical, 6)
+
+                preset = Gtk::Label.new()
+                preset.set_markup(texte1)
+                textTitle = Gtk::Label.new()
+                textTitle.set_markup(texte)
+                
+                #Tri les lignes en fonctions des temps
+                tab = File.read(nomniv).split("\n")
+                tab = tab.sort_by{ |s| s.scan(/\d+/).first.to_i }
+                
+                #Inclu toutes les lignes du tableau tab dans une variable texte_0 pour être affiché dans une box
+                tab.each.with_index do |line|
+                        texte_0 += "<span font_desc = 'Toledo 13'>#{line} </span>\n"
+                        end
+
+                score = Gtk::Label.new()
+                score.set_markup(texte_0)
+                        
+                btnQuitter = Gtk::Button.new()
+                btnQuitter.signal_connect('clicked'){self.destroy}
+                btnQuitter.image = Gtk::Image.new(:file => "./Ressources/MenuSelection/back.png") 
+                btnQuitter.halign =  Gtk::Align::CENTER
+                btnQuitter.valign =  Gtk::Align::CENTER
+                btnQuitter.always_show_image = true
+                
+                css_file = Gtk::CssProvider.new
+                css_file.load(data: <<-CSS)
+                        button {
+                                all:unset;
+                        }
+
+                        button:hover {
+                                opacity: .6;
+                        }
+                        CSS
+
+                btnQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+                
+                btnScore = Gtk::Label
+
+                #Affichage de toutes les box
+                boxMenu.add(textTitle)
+                boxMenu.add(preset)
+                boxMenu.add(score)
+                boxMenu.add(btnQuitter)
+
+                add(boxMenu)
+
+                show_all
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/HashiGrid.html b/doc/HashiGrid.html new file mode 100644 index 00000000..98833fea --- /dev/null +++ b/doc/HashiGrid.html @@ -0,0 +1,881 @@ + + + + + + +class HashiGrid - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class HashiGrid +

+ +
+ +

Cette classe représente la grille contenant les boutons ( autrement dit les noeuds , et les

+ +
ponts d'un point de vue graphique )
+ +

Il y à peu de méthode encore mais ça arrive

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ colonnes[RW] +
+ +
+

Nombre de colonnes

+
+
+
+
+ diff[R] +
+ +
+

Attribut correspondant au niveau de difficulté de la grille

+
+
+
+
+ lignes[RW] +
+ +
+

Nombre de lignes

+
+
+ +
+
+ nomniv[R] +
+ +
+

Attribut correspondant au nom du niveau

+
+
+
+
+ saveManager[RW] +
+ +
+

Attribut de type Sauvegarde

+
+
+
+
+ sommets[RW] +
+ +
+

Attribut correspondant au nombre de sommets contenus dans la grille

+
+
+
+
+ undoRedo[R] +
+ +
+

Attribut de type UndoRedo

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(nomniv,diff, x,y) + click to toggle source +
+ +
+

Constructeur de la grille

+
  • +

    nomniv Nom du niveau

    +
  • +

    diff Difficulté du niveau

    +
  • +

    x Nombre de colonnes

    +
  • +

    y Nombre de lignes

    +
+
+ Calls superclass method + +
+ +
+
# File HashiGrid.rb, line 55
+def initialize(nomniv,diff, x,y)
+    super()
+    @diff = diff
+    @nomniv=nomniv
+    @x=x
+    @y=y
+    @undoRedo = UndoRedo.new 
+    @nb_iles = 0
+    @sommets = Array.new()
+    @nodeLink = []
+    @saveManager = Sauvegarde.new(nomniv, diff)
+end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ ajoutPont(n1,n2) + click to toggle source +
+ +
+

Ajoute un pont entre deux iles

+ +
+
# File HashiGrid.rb, line 156
+def ajoutPont(n1,n2)
+
+    # incrémente le nombre de pont sur les iles
+    n1.inc()
+    n2.inc()
+
+    # Récupère les cases entre les deux iles ( le pont )
+    ponts = getPontEntre(n1,n2)
+
+    # Ile Nord
+    if n1.northNode == n2 
+                    n1.northEdge = n1.northEdge + 1
+                    n2.southEdge = n2.southEdge + 1 
+        n1.update
+        n2.update
+
+    elsif n1.eastNode == n2  #Ile droit
+        n1.eastEdge = n1.eastEdge + 1
+                    n2.westEdge = n2.westEdge + 1
+        n1.update
+        n2.update
+
+    elsif n1.westNode == n2 # Ile gauche
+
+        n1.westEdge = n1.westEdge + 1 
+                    n2.eastEdge = n2.eastEdge + 1
+        n1.update
+        n2.update
+
+    elsif n1.southNode == n2 # Ile bas
+
+        n1.southEdge = n1.southEdge + 1
+                    n2.northEdge = n2.northEdge + 1
+        n1.update
+        n2.update
+        
+    else 
+        p "Erreur: n2 n'est pas un noeud valide pour n1"
+            end
+    
+    n1.pontRestants
+    n2.pontRestants
+
+    # Ajoute le pont entre deux iles
+    ponts.each do |pont|
+        pont.set_typePont( pont.get_typePont() + 1)
+        pont.estDouble = true
+        pont.update
+    end
+       
+    return self
+end
+
+
+ + +
+ +
+
+ ajoutValid?(n1,n2) + click to toggle source +
+ +
+

Vérifie si l'ajout est valide Autrement dit :

+
  • +

    vérifie si les noeuds sont bien voisins sinon renvoi faux

    +
  • +

    vérifie si il existe un croisement d'arêtes entre les noeuds

    +
  • +

    n1 Premier pont

    +
  • +

    n2 Deuxieme pont

    +
+ +
+
# File HashiGrid.rb, line 321
+def ajoutValid?(n1,n2)
+
+        if(n1.northNode != n2 && n1.eastNode != n2 && n1.southNode != n2 && n1.westNode != n2)
+            return false;
+        end
+        
+        # Voisins NORD
+        if(n1.northNode == n2)
+            if(n1.northEdge == 2)
+                supprimePont(n1,n2)
+                return false;
+            else
+                # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds.
+                for y2 in (n1.row-1).downto(0)
+                    if(self.get_child_at(n1.column,y2) == n2) 
+                        break;
+                    else
+                        if(self.get_child_at(n1.column,y2).get_directionPont == 1)
+                            return false;
+                        end
+                    end
+                end
+            end
+        end
+    
+        # Voisins DROIT
+        if(n1.eastNode == n2)
+            if(n1.eastEdge == 2)
+                supprimePont(n1,n2)
+                return false;
+            else
+                # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds.
+                for x2 in (n1.column+1).upto(self.lignes-1)
+                    if(self.get_child_at(x2,n1.row) == n2) 
+                        break;
+                    else
+                        if(self.get_child_at(x2,n1.row).get_directionPont == 2)
+                            return false;
+                        end
+                    end
+                end
+            end
+        end
+        
+        # Voisins BAS
+        if(n1.southNode == n2)
+          
+            if(n1.southEdge == 2)
+                supprimePont(n1,n2)
+                return false;
+            else
+                # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds.
+                for y2 in (n1.row+1).upto(self.colonnes-1)
+                    if(self.get_child_at(n1.column,y2) == n2)
+                        break;
+                    else
+                        if(self.get_child_at(n1.column,y2).get_directionPont == 1)
+                            return false;
+                        end
+                    end
+                end
+            end
+           
+        end
+         # Voisins GAUCHE
+         if(n1.westNode == n2)
+            if(n1.westEdge == 2)
+                supprimePont(n1,n2)
+                return false;
+            else
+                # renvoie faux s'il existe déjà un croisement d'arêtes entre ces deux nœuds.
+                for x2 in (n1.column-1).downto(0)
+                    if(self.get_child_at(x2,n1.row) == n2) 
+                        break;
+                    else
+                        if( self.get_child_at(x2,n1.row).get_directionPont == 2)
+                            return false;
+                        end
+                    end
+                end
+            end
+        end
+    return true
+end
+
+
+ + +
+ +
+
+ chargeGrille() + click to toggle source +
+ +
+

Chargement d'une grille depuis un fichier

+ +
+
# File HashiGrid.rb, line 463
+def chargeGrille()
+    data = []
+    File.foreach(@nomniv).with_index do |line, line_no|
+        data << line.chomp
+    end
+    # Slice permet de récupérer la taille de la matrice
+    # tel que 7:7
+    num = data.slice!(0)
+    self.colonnes = @x
+    self.lignes = @y
+
+    # Parcours des données récupérés afin de charger
+    # les boutons
+    for i in 0..(data.length() - 1) 
+        data[i].split(':').each_with_index do | ch, index| 
+            # # Création d'une case
+            if ch != '0'
+                btn = Ile.new(self, ch,index,i)
+                @sommets << btn
+            else 
+                btn = Pont.new(self, index, i)
+            end
+
+            # On attache la référence de la grille
+            self.attach(btn, index,i, 1,1)
+        end
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ chargeVoisins() + click to toggle source +
+ +
+

Charge les voisins accessibles d'une case en HAUT, BAS, GAUCHE, DROITE

+ +
+
# File HashiGrid.rb, line 271
+def chargeVoisins
+    for x in 0..(self.lignes-1)
+        for y in 0..(self.colonnes-1)
+            if (self.get_child_at(x,y).status == 'i')
+
+                # DROITE
+                for x2 in (x+1).upto(self.lignes-1)
+                    if (self.get_child_at(x2, y).status == 'i')
+                        self.get_child_at(x, y).eastNode = self.get_child_at(x2,y)
+                        break
+                    end
+                end
+
+                #BAS
+                for y2 in (y+1).upto(self.colonnes-1)
+                    if (self.get_child_at(x,y2).status == 'i')
+                        self.get_child_at(x,y).southNode = self.get_child_at(x,y2)
+                        break
+                    end
+                end
+                
+                #HAUT
+                for y2 in (y-1).downto(0)
+                    if (self.get_child_at(x,y2).status == 'i')
+                        self.get_child_at(x,y).northNode = self.get_child_at(x,y2)
+                        break
+                    end
+                end
+
+                # Gauche
+                for x2 in (x-1).downto(0)
+                    if (self.get_child_at(x2,y).status == 'i')
+                        self.get_child_at(x,y).westNode = self.get_child_at(x2,y)
+                        break
+                    end
+                end
+            end
+        end        
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ getPontEntre(n1, n2) + click to toggle source +
+ +
+

Retourne un tableau contenant les cases correspondants aux pont entre deux iles

+
  • +

    n1 Premier pont

    +
  • +

    n2 Deuxieme pont

    +
+ +
+
# File HashiGrid.rb, line 409
+def getPontEntre(n1, n2)
+
+    # Tableau temporaire visant à contenir l'index des cases formant le pont
+    arr = [] 
+
+    # Cas où la case est le voisin du haut
+    if n1.northNode == n2 # Ile HAUT
+
+        for y2 in (n1.row-1).downto(0)
+            if(self.get_child_at(n1.column,y2) == n2) 
+                break;
+                            else
+                self.get_child_at(n1.column,y2).set_directionPont(2)
+                arr << self.get_child_at(n1.column,y2)
+            end
+                    end
+    # Cas où la case est le voisin de droite
+    elsif n1.eastNode == n2  #Ile droit
+
+        for x2 in (n1.column+1).upto(self.lignes-1)
+            if(self.get_child_at(x2,n1.row) == n2) 
+                break;
+                            else
+                self.get_child_at(x2,n1.row).set_directionPont(1)
+                arr << self.get_child_at(x2,n1.row)
+            end
+                    end
+    # Cas où la case est le voisin de gauche
+    elsif n1.westNode == n2 # Ile gauche
+
+        for x2 in (n1.column-1).downto(0)
+            if(self.get_child_at(x2,n1.row) == n2) 
+                break;
+            else
+                self.get_child_at(x2,n1.row).set_directionPont(1)
+                arr << self.get_child_at(x2,n1.row)
+            end
+        end
+
+    # Cas où la case est le voisin du bas
+    elsif n1.southNode == n2   # Ile bas
+        for y2 in (n1.row+1).upto(self.colonnes-1)
+            if(self.get_child_at(n1.column,y2) == n2) 
+                break;
+            else
+                self.get_child_at(n1.column,y2).set_directionPont(2)
+               arr << self.get_child_at(n1.column,y2)
+            end
+                    end
+    end 
+    return arr
+end
+
+
+ + +
+ +
+
+ grilleFini?() + click to toggle source +
+ +
+

Vérifie si la grille est fini autrement dit que tous les noeuds ont correment été remplis

+ +
+
# File HashiGrid.rb, line 135
+def grilleFini? 
+    for x in 0..(self.lignes-1)
+        for y in 0..(self.colonnes-1)
+            ile = self.get_child_at(x,y)
+            if (ile.status == 'i')
+                if !ile.estComplet
+                    return false
+                end
+            end
+        end
+    end
+    return true
+end
+
+
+ + +
+ +
+
+ handleClick() + click to toggle source +
+ +
+

Methode permettant de lancer les traitements lié aux cases

+
  • +

    Ajout d'un pont

    +
  • +

    Suppression d'un pont

    +
  • +

    Récupération des cases cliquées conservé par le SaveManager

    +
+ +
+
# File HashiGrid.rb, line 104
+def handleClick() 
+    @nodeLink.first.choixPossible()
+    if( @nodeLink.length >= 2 )
+        @nodeLink.first.enleverChoixPossible()
+        # Si l'utilisateur clique autre part que sur le bouton REDO
+        # La pile du REDO est vidé
+        if !@undoRedo.redoStack.empty?
+            @undoRedo.redoStack.clear()
+        end
+
+        p2 = @nodeLink.pop()
+        p1 = @nodeLink.pop()
+      
+        if ajoutValid?(p1,p2) == true
+           
+            #Important pour les REDOS et Undo de conserver
+            # Sauvegarde les case cliqué
+            @undoRedo.undoStack << p1 
+            @undoRedo.undoStack << p2
+            
+            ajoutPont(p1,p2)
+            saveManager.sauvegarder(self)
+            $window.partiFini
+        end
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ notify(_case) + click to toggle source +
+ +
+

Méthode permettant de notifier la grille qu'une case à été cliquée

+ +
+
# File HashiGrid.rb, line 150
+def notify(_case)
+    @nodeLink << _case
+    handleClick()
+end
+
+
+ + +
+ +
+
+ redoPrevious() + click to toggle source +
+ +
+

Active le retour en avant

+ +
+
# File HashiGrid.rb, line 85
+def redoPrevious
+    if !@undoRedo.redoStack.empty?
+        n2 = @undoRedo.redoStack.pop()
+        n1 = @undoRedo.redoStack.pop()
+
+        @undoRedo.undoStack << n2
+        @undoRedo.undoStack << n1
+        
+        
+        ajoutPont(n2,n1)
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ supprimePont(n1, n2, undo = false) + click to toggle source +
+ +
+
Supprime le pont entre deux iles
+
+
  • +

    n1 Premier pont

    +
  • +

    n2 Deuxieme pont

    +
  • +

    undo Attribut par défaut à false permettant permettant d'adapter le traitement de suppression au besoin

    +
+ +
+
# File HashiGrid.rb, line 214
+def supprimePont(n1, n2, undo = false)
+   
+
+     # Récupère les cases entre les deux iles ( le pont )
+     ponts = getPontEntre(n1,n2)
+
+    # Mis à jour des pont ( tout du moins de leurs edges )
+    if n1.northNode == n2 
+                    n1.northEdge = 0
+                    n2.southEdge = 0
+
+    elsif n1.eastNode == n2  #Ile droit
+        n1.eastEdge = 0
+                    n2.westEdge = 0
+
+    elsif n1.westNode == n2 # Ile gauche
+
+        n1.westEdge = 0
+                    n2.eastEdge = 0
+
+    elsif n1.southNode == n2 # Ile bas
+
+        n1.southEdge = 0
+                    n2.northEdge = 0
+        
+    else 
+        p "Erreur: n2 n'est pas un noeud valide pour n1"
+            end
+
+    # Supprime le pont
+    ponts.each do |pont|
+        
+        if undo 
+            pont.set_typePont( pont.get_typePont -  1 )
+        else 
+            pont.set_typePont( pont.get_typePont -  ( pont.estDouble ? 2 : 1 ) )
+        end
+        pont.estDouble = false
+
+        if pont.get_typePont == 0
+            pont.set_directionPont(0)
+        end
+        pont.update
+    end
+
+    n1.set_degree( n1.pontRestants )
+    n2.set_degree ( n2.pontRestants )
+    n1.update
+    n2.update
+      
+    saveManager.sauvegarder(self)
+        $window.partiFini
+
+    return self
+end
+
+
+ + +
+ +
+
+ undoPrevious() + click to toggle source +
+ +
+

Active le retour en arrière

+ +
+
# File HashiGrid.rb, line 69
+def undoPrevious 
+    if !@undoRedo.undoStack.empty?
+      
+        n2 = @undoRedo.undoStack.pop()
+        n1 = @undoRedo.undoStack.pop()
+        
+        @undoRedo.redoStack << n2
+        @undoRedo.redoStack << n1
+        
+        supprimePont(n2,n1, true)
+    end
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Hypothese.html b/doc/Hypothese.html new file mode 100644 index 00000000..e1f25ac2 --- /dev/null +++ b/doc/Hypothese.html @@ -0,0 +1,267 @@ + + + + + + +class Hypothese - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Hypothese +

+ +
+ +

Cette classe représente le mode Hypothèse Elle est responsable de la création du mode hypothèse

+ +
- Créer une copie du plateau courant
+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new(plateau) + click to toggle source +
+ +
+

Constructeur du mode hypothèse

+
  • +

    plateau Référence sur le plateau de jeu

    +
+ +
+
# File Hypothese.rb, line 15
+    def initialize(plateau)
+                
+        main_window_res = "./Ressources/Glade/hypo.glade"
+        builder = Gtk::Builder.new
+        builder.add_from_file(main_window_res)
+
+        hypo = builder.get_object('hypo')
+        hypo.set_title "Hypothèse"
+        hypo.signal_connect "destroy" do 
+            hypo.destroy
+            plateau.getPlateau().set_sensitive(true)
+            
+        end
+        hypo.set_window_position Gtk::WindowPosition::CENTER
+        css_file = Gtk::CssProvider.new
+    
+        css_file.load(data: <<-CSS)
+            button {
+                all:unset;
+            }
+
+            button:hover {
+                opacity: .6;
+            }
+            
+            .bg-hypo {
+                background-color: #F8DDD7;
+            }
+
+                CSS
+
+       
+
+        # #Reglage du bouton Undo
+        boutonUndo = builder.get_object('btnUndo')
+      
+        # #Reglage du bouton Redo
+        boutonRedo = builder.get_object('btnRedo')
+
+        # #Initialisation de la grille
+        # # Copie des noeuds contenus dans la grille
+        copy_grille = plateau.grid.collect(&:dup)
+        
+        
+        # # Création d'une nouvelle grille
+        @hypoGrille = HashiGrid.new(plateau.grid.nomniv, @diff, plateau.grid.lignes, plateau.grid.colonnes)
+        @hypoGrille.set_column_homogeneous(true)
+        @hypoGrille.set_row_homogeneous(true)
+        @hypoGrille.colonnes = plateau.grid.colonnes
+        @hypoGrille.lignes = plateau.grid.lignes
+        @hypoGrille.sommets = plateau.grid.sommets
+
+        # # On parcourt le tableau des iles/ponts copiés
+        copy_grille.each do |x| 
+            # Si c'est une ile
+            # On copie les attributs de l'ile
+            if x.status != 'p'
+                btn = Ile.new(@hypoGrille,x.degreeMax.to_s,x.column,x.row)
+                btn.degree = x.degree
+                btn.estComplet = x.estComplet
+                btn.northEdge = x.northEdge
+                btn.southEdge = x.southEdge
+                btn.westEdge = x.westEdge
+                btn.eastEdge = x.eastEdge
+                btn.update
+            else 
+                # Si c'est un pont on copie les attributs
+                # et on met à jour le pont
+                btn = Pont.new(@hypoGrille,x.column,x.row)
+                btn.set_typePont( x.get_typePont )
+                btn.estDouble = x.estDouble
+                btn.set_directionPont ( x.get_directionPont )
+                btn.update
+            end
+                # On attache la référence de la grille
+                @hypoGrille.attach(btn, x.column,x.row, 1,1)
+        end
+        # # Chargement des voisins
+        @hypoGrille.chargeVoisins
+
+        boxJeu = builder.get_object('boxJeu')
+        boxJeu.add(@hypoGrille)
+
+      
+        #Creation et affichage de la fenêtre principale
+        boxPrincipale = builder.get_object('boxPrincipale')
+
+        aide = Aide.new(@hypoGrille)
+        label_aide = builder.get_object('label_indice')
+        
+        boutonIndice = builder.get_object('btnIndice')
+        boutonIndice.signal_connect('clicked'){
+            label_aide.set_label(aide.getMessageAide)
+            boxPrincipale.show_all
+        }
+
+      
+        btnValider = builder.get_object('btnValider')
+        btnValider.signal_connect('clicked'){
+            boxJeu.remove(@hypoGrille)
+            plateau.hypotheseValider(@hypoGrille)
+            hypo.destroy
+            $window.getPlateau().set_sensitive(true)
+        }
+
+        btnAnnuler =  builder.get_object('btnAnnuler')
+        btnAnnuler.signal_connect('clicked'){
+            hypo.destroy
+            $window.getPlateau().set_sensitive(true)
+        }
+
+        boutonUndo.signal_connect('clicked'){
+            @hypoGrille.undoPrevious
+        }
+
+        boutonRedo.signal_connect('clicked'){
+            @hypoGrille.redoPrevious
+        }
+
+        btnAnnuler.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        btnValider.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonUndo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonIndice.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonRedo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        hypo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+       
+
+        hypo.show_all
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Ile.html b/doc/Ile.html new file mode 100644 index 00000000..36ad6e89 --- /dev/null +++ b/doc/Ile.html @@ -0,0 +1,760 @@ + + + + + + +class Ile - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Ile +

+ +
+ +

Cette classe représente les îles

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ column[RW] +
+ +
+

Numéro de colonne

+
+
+
+
+ degree[RW] +
+ +
+

Représente le nombre de degrée restant à connecter avant d'atteindre le degree max

+
+
+
+
+ degreeMax[R] +
+ +
+

Représente le degrée max autorisé sur le noeud

+
+
+
+
+ eastEdge[RW] +
+ +
+

Représente le statut d'une arête entre deux noeuds. 0 = pas d'arête, 1 = simple, 2 = double

+
+
+
+
+ eastNode[RW] +
+ +
+

Représente les nœuds auxquels ce nœud peut être connecté

+
+
+
+
+ estComplet[RW] +
+ +
+

Attribut permettant de savoir si l'ile est complète ou non

+
+
+
+
+ gridRef[RW] +
+ +
+

Référence sur la grille

+
+
+
+
+ northEdge[RW] +
+ +
+

Représente le statut d'une arête entre deux noeuds. 0 = pas d'arête, 1 = simple, 2 = double

+
+
+
+
+ northNode[RW] +
+ +
+

Représente les nœuds auxquels ce nœud peut être connecté

+
+
+
+
+ row[RW] +
+ +
+

Numéro de ligne

+
+
+
+
+ southEdge[RW] +
+ +
+

Représente le statut d'une arête entre deux noeuds. 0 = pas d'arête, 1 = simple, 2 = double

+
+
+
+
+ southNode[RW] +
+ +
+

Représente les nœuds auxquels ce nœud peut être connecté

+
+
+
+
+ status[RW] +
+ +
+

Remplace le label du GTK::Button Identifie une case comme étant un pont 'p' ou une ile 'i'

+
+
+
+
+ westEdge[RW] +
+ +
+

Représente le statut d'une arête entre deux noeuds. 0 = pas d'arête, 1 = simple, 2 = double

+
+
+
+
+ westNode[RW] +
+ +
+

Représente les nœuds auxquels ce nœud peut être connecté

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(grid, degreeMax, col, lig ) + click to toggle source +
+ +
+

Construction d'une île

+
  • +

    grid Référence sur la grille

    +
  • +

    degreeMax Degree maximum de l'ile ( nombres de ponts attendus )

    +
  • +

    col Numéro de colonne

    +
  • +

    lig Numéro de ligne

    +
+
+ Calls superclass method + +
+ +
+
# File Ile.rb, line 57
+    def initialize(grid, degreeMax, col, lig )
+        super()
+        @gridRef = grid
+        @degreeMax = degreeMax.to_i
+        @degree = 0
+        @row = lig
+        @estComplet = false
+        @column = col
+
+        # Noeuds voisins permet de conserver la reference sur les voisins
+        @northNode = nil
+        @southNode = nil
+        @eastNode = nil
+        @westNode = nil
+
+        # Permet de représenter le statut d'une arête entre chaque voisin
+        @northEdge = 0;
+                @eastEdge = 0;
+                @southEdge = 0;
+                @westEdge = 0;
+
+        self.style_context.add_class('ile') 
+        self.set_name("ile")
+        # Status représente une ile
+        self.status = 'i'
+        css_file = Gtk::CssProvider.new
+        css_file.load(data: <<-CSS)
+             @import url("css/plateau_style.css");
+                CSS
+        self.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        # Charge une image correspondants au noeud
+        self.image = Gtk::Image.new(:file => "Ressources/Ile/"+degreeMax+".png") 
+       
+        #  Retire les contours
+        self.set_relief(Gtk::ReliefStyle::NONE)
+        self.always_show_image = false
+        self.signal_connect('clicked') { self.click() }
+    end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ choixPossible() + click to toggle source +
+ +
+

Affiche les voisins auxquelles l'île peut-être relié

+ +
+
# File Ile.rb, line 216
+def choixPossible()
+            voisins = self.getVoisins
+            for voisin in voisins
+                    if voisin != nil
+                            if voisin.estComplet == false 
+                voisin.style_context.add_class('possibles')
+                                    voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}_s.png"
+                            end
+                    end      
+            end
+
+    return self
+    end
+
+
+ + +
+ +
+
+ click() + click to toggle source +
+ +
+

Méthode de test afin de s'assurer du bon fonctionnement des clics

+ +
+
# File Ile.rb, line 256
+def click()
+    @gridRef.notify(self)
+    return self
+end
+
+
+ + +
+ +
+
+ compterVoisins() + click to toggle source +
+ +
+

Retourne le nombre de voisins

+ +
+
# File Ile.rb, line 123
+def compterVoisins() 
+    return self.getVoisins().size
+end
+
+
+ + +
+ +
+
+ compterVoisinsNonComplets() + click to toggle source +
+ +
+

Renvoi le nombre de voisins non complets

+ +
+
# File Ile.rb, line 172
+def compterVoisinsNonComplets
+    return self.voisinsNonComplets().size
+end
+
+
+ + +
+ +
+
+ connexionRestantes() + click to toggle source +
+ +
+

Retourne le nombre de connexions restantes avant que l'île soit complète. Si le nombre est négatif - il y à trop de pont Si le nombre est positif - Nombre de ponts manquants Si le nombre == 0 - Le pont est complet

+ +
+
# File Ile.rb, line 132
+def connexionRestantes 
+    return @degreeMax - self.pontRestants()
+end
+
+
+ + +
+ +
+
+ dec() + click to toggle source +
+ +
+

Décrémente le nombre de pont sur la case

+ +
+
# File Ile.rb, line 177
+def dec
+    @degree -= 1
+    return self
+end
+
+
+ + +
+ +
+
+ enleverChoixPossible() + click to toggle source +
+ +
+

Supprime l'affichage des voisins possibles

+ +
+
# File Ile.rb, line 231
+def enleverChoixPossible()
+        voisins = self.getVoisins
+        for voisin in voisins
+                if voisin != nil
+                        if voisin.estComplet == false
+            voisin.style_context.remove_class('possibles')
+            if voisin.degree > voisin.degreeMax
+                voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}_r.png"
+            else
+                voisin.image.from_file = "Ressources/Ile/#{voisin.degreeMax}.png"
+            end
+                        end
+                end
+        end
+
+return self
+end
+
+
+ + +
+ +
+
+ getVoisins() + click to toggle source +
+ +
+

Retourne un tableau contenant les voisins d'une ile Un noeud à nil équivaut à une absence de voisin dans cette direction On ne retourne donc que les voisins valides

+ +
+
# File Ile.rb, line 140
+def getVoisins
+    arr = Array.new 
+    if( @northNode != nil )
+        arr.push(@northNode)
+    end
+    if( @eastNode != nil )
+        arr.push(@eastNode)
+    end
+    if( @southNode != nil )
+        arr.push(@southNode)
+    end
+    if( @westNode != nil )
+        arr.push(@westNode)
+    end
+    return arr
+end
+
+
+ + +
+ +
+
+ inc() + click to toggle source +
+ +
+

Incrément le nombre de pont sur la case

+ +
+
# File Ile.rb, line 189
+def inc
+    @degree += 1
+    return self
+end
+
+
+ + +
+ +
+
+ pontAvecVoisins() + click to toggle source +
+ +
+

Renvoi vrai si l'ile est relie a chacun de ses voisins sinon faux

+ +
+
# File Ile.rb, line 118
+def pontAvecVoisins
+   return self.pontRestants() >= self.compterVoisins()
+end
+
+
+ + +
+ +
+
+ pontRestants() + click to toggle source +
+ +
+

Calcule le nombres de ponts restants sur une ile

+ +
+
# File Ile.rb, line 97
+def pontRestants
+    compteur = 0
+   
+    if( @northNode != nil )
+        compteur += @northEdge
+    end
+    if( @eastNode != nil )
+        compteur += @eastEdge
+    end
+    if( @southNode != nil )
+        compteur += @southEdge
+    end
+    if( @westNode != nil )
+        compteur += @westEdge
+    end
+    return compteur
+end
+
+
+ + +
+ +
+
+ set_degree(val) + click to toggle source +
+ +
+

Modifie le nombre de ponts relie à l'ile

+ +
+
# File Ile.rb, line 183
+def set_degree val
+    @degree = val
+    return self
+end
+
+
+ + +
+ +
+
+ to_s() + click to toggle source +
+ +
+

Affiche la ligne et la colonne

+ +
+
# File Ile.rb, line 251
+def to_s
+    return "[#{@row}-#{@column}]"
+end
+
+
+ + +
+ +
+
+ update() + click to toggle source +
+ +
+

Met à jour le noeud

+
  • +

    Si le noeud à un nombre de pont supérieur a son degree max, il est affiché en rouge

    +
  • +

    Si le noeud comporte le bon nombre il s'affiche en vert

    +
  • +

    Sinon il est blanc par défaut

    +
+ +
+
# File Ile.rb, line 198
+def update 
+    if @degree > @degreeMax
+        self.estComplet = false
+        self.image.from_file = "Ressources/Ile/#{degreeMax}_r.png"
+    elsif @degree == @degreeMax
+        self.estComplet = true
+        self.image.from_file = "Ressources/Ile/#{degreeMax}_v.png"
+    else
+        self.image.from_file = "Ressources/Ile/#{degreeMax}.png"
+        self.estComplet = false
+        self.style_context.remove_class('complet')
+        self.style_context.remove_class('incorrect')
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ voisinsNonComplets() + click to toggle source +
+ +
+

Retourne la liste des voisins non complets d'une ile

+ +
+
# File Ile.rb, line 159
+def voisinsNonComplets()
+    liste = self.getVoisins()
+    array = Array.new()
+
+    liste.each do |voisin|
+        if voisin.pontRestants() != 0
+            array.push(voisin)
+        end
+    end
+    return array
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/ListeNiveau/Difficile/10x10_2_txt.html b/doc/ListeNiveau/Difficile/10x10_2_txt.html new file mode 100644 index 00000000..d420c10b --- /dev/null +++ b/doc/ListeNiveau/Difficile/10x10_2_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x10_2 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:10 0:1:0:3:0:0:0:0:0:0 2:0:2:0:2:0:0:4:0:3 0:0:0:0:0:0:0:0:0:0 0:0:0:0:1:0:0:1:0:0 1:0:0:3:0:0:0:0:0:3 0:0:0:0:0:0:0:0:0:0 4:0:4:0:0:0:0:0:0:3 0:0:0:0:0:0:0:0:0:0 0:1:0:0:2:0:3:0:0:3 4:0:4:0:0:0:0:2:0:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/10x10_txt.html b/doc/ListeNiveau/Difficile/10x10_txt.html new file mode 100644 index 00000000..f90299cb --- /dev/null +++ b/doc/ListeNiveau/Difficile/10x10_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x10 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:10 4:0:0:0:3:0:2:0:1:0 0:0:1:0:0:3:0:3:0:2 6:0:0:0:5:0:3:0:1:0 0:3:0:1:0:1:0:2:0:3 3:0:0:0:0:0:0:0:0:0 0:5:0:0:3:0:2:0:0:3 2:0:2:0:0:4:0:0:2:0 0:3:0:1:0:0:0:0:0:0 1:0:1:0:0:3:0:0:0:3 0:2:0:3:0:0:0:1:0:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/10x7_txt.html b/doc/ListeNiveau/Difficile/10x7_txt.html new file mode 100644 index 00000000..306fafdc --- /dev/null +++ b/doc/ListeNiveau/Difficile/10x7_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x7 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:7 4:0:4:0:0:2:0:0:1:0 0:0:0:0:3:0:0:3:0:3 3:0:2:0:0:0:2:0:1:0 0:0:0:0:0:0:0:3:0:3 4:0:3:0:3:0:3:0:1:0 0:0:0:0:0:0:0:2:0:1 3:0:2:0:3:0:5:0:2:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/12x12_txt.html b/doc/ListeNiveau/Difficile/12x12_txt.html new file mode 100644 index 00000000..fa0988cd --- /dev/null +++ b/doc/ListeNiveau/Difficile/12x12_txt.html @@ -0,0 +1,126 @@ + + + + + + +12x12 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

12:12 0:2:0:0:3:0:0:4:0:3:0:0 0:0:0:1:0:1:0:0:2:0:0:1 1:0:0:0:1:0:0:2:0:2:0:0 0:3:0:3:0:4:0:0:5:0:3:0 3:0:0:0:0:0:2:0:0:0:0:2 0:0:1:0:0:2:0:0:4:0:4:0 0:3:0:4:0:0:4:0:0:0:0:0 3:0:2:0:2:0:0:0:3:0:0:2 0:2:0:1:0:0:0:0:0:0:0:0 2:0:3:0:4:0:3:0:2:0:0:2 0:2:0:3:0:0:0:2:0:0:0:0 2:0:2:0:0:2:0:0:4:0:0:4

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/15x5_txt.html b/doc/ListeNiveau/Difficile/15x5_txt.html new file mode 100644 index 00000000..d22d69ca --- /dev/null +++ b/doc/ListeNiveau/Difficile/15x5_txt.html @@ -0,0 +1,126 @@ + + + + + + +15x5 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

15:5 3:0:4:0:3:0:2:0:3:0:4:0:0:2:0 0:2:0:2:0:3:0:3:0:3:0:0:3:0:3 3:0:1:0:2:0:1:0:0:0:0:3:0:1:0 0:3:0:2:0:3:0:0:3:0:1:0:0:0:0 3:0:2:0:3:0:0:2:0:2:0:3:0:0:2

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/7x7_txt.html b/doc/ListeNiveau/Difficile/7x7_txt.html new file mode 100644 index 00000000..5e88a85f --- /dev/null +++ b/doc/ListeNiveau/Difficile/7x7_txt.html @@ -0,0 +1,126 @@ + + + + + + +7x7 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

7:7 3:0:4:0:0:0:3 0:1:0:3:0:2:0 0:0:0:0:0:0:0 0:0:0:2:0:0:5 0:0:0:0:0:0:0 2:0:3:0:0:1:0 0:2:0:0:0:0:3

+ +
+ + + + + diff --git a/doc/ListeNiveau/Difficile/8x8_txt.html b/doc/ListeNiveau/Difficile/8x8_txt.html new file mode 100644 index 00000000..039d8e67 --- /dev/null +++ b/doc/ListeNiveau/Difficile/8x8_txt.html @@ -0,0 +1,126 @@ + + + + + + +8x8 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

8:8 1:0:2:0:4:0:0:3 0:0:0:0:0:0:2:0 1:0:3:0:3:0:0:1 0:0:0:0:0:0:0:0 0:0:3:0:3:0:6:0 1:0:0:0:0:0:0:1 0:0:0:0:1:0:3:0 3:0:5:0:0:2:0:2

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/10x10_txt.html b/doc/ListeNiveau/Facile/10x10_txt.html new file mode 100644 index 00000000..cd05aa38 --- /dev/null +++ b/doc/ListeNiveau/Facile/10x10_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x10 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:10 0:4:0:6:0:0:3:0:1:0 2:0:0:0:0:2:0:5:0:3 0:4:0:0:1:0:0:0:0:0 3:0:0:3:0:2:0:0:0:3 0:4:0:0:3:0:0:4:0:0 3:0:0:1:0:1:0:0:0:3 0:6:0:0:7:0:0:5:0:0 3:0:2:0:0:0:0:0:0:0 0:2:0:0:3:0:1:0:0:1 2:0:4:0:0:3:0:4:0:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/10x7_txt.html b/doc/ListeNiveau/Facile/10x7_txt.html new file mode 100644 index 00000000..af5fbd62 --- /dev/null +++ b/doc/ListeNiveau/Facile/10x7_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x7 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:7 0:1:0:2:0:0:4:0:2:0 3:0:3:0:3:0:0:0:0:0 0:0:0:0:0:0:0:3:0:3 0:0:0:0:6:0:5:0:0:0 5:0:4:0:0:0:0:1:0:0 0:0:0:0:4:0:5:0:0:2 1:0:2:0:0:3:0:0:2:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/12x12_1_txt.html b/doc/ListeNiveau/Facile/12x12_1_txt.html new file mode 100644 index 00000000..c560af0d --- /dev/null +++ b/doc/ListeNiveau/Facile/12x12_1_txt.html @@ -0,0 +1,126 @@ + + + + + + +12x12_1 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

12:12 3:0:0:0:0:3:0:5:0:2:0:1 0:0:1:0:3:0:1:0:0:0:0:0 0:1:0:3:0:0:0:2:0:0:1:0 5:0:1:0:0:3:0:0:4:0:0:3 0:0:0:0:2:0:0:0:0:0:2:0 0:3:0:4:0:0:1:0:2:0:0:0 0:0:0:0:0:2:0:0:0:0:5:0 0:2:0:0:2:0:0:3:0:1:0:0 0:0:0:0:0:0:0:0:0:0:0:3 4:0:0:3:0:2:0:5:0:0:3:0 0:0:0:0:0:0:0:0:0:1:0:3 1:0:1:0:0:0:0:5:0:0:2:0

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/12x12_txt.html b/doc/ListeNiveau/Facile/12x12_txt.html new file mode 100644 index 00000000..d996b337 --- /dev/null +++ b/doc/ListeNiveau/Facile/12x12_txt.html @@ -0,0 +1,126 @@ + + + + + + +12x12 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

12:12 3:0:3:0:3:0:3:0:4:0:4:0 0:1:0:2:0:4:0:3:0:3:0:0 0:0:0:0:3:0:0:0:0:0:0:1 4:0:0:2:0:3:0:0:1:0:3:0 0:2:0:0:7:0:0:6:0:6:0:0 4:0:0:0:0:0:0:0:0:0:0:2 0:0:1:0:4:0:0:5:0:5:0:0 0:3:0:2:0:0:0:0:0:0:1:0 0:0:0:0:3:0:0:6:0:5:0:3 3:0:0:2:0:0:1:0:0:0:0:0 0:2:0:0:0:2:0:0:3:0:2:0 3:0:3:0:2:0:3:0:0:3:0:2

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/15x5_txt.html b/doc/ListeNiveau/Facile/15x5_txt.html new file mode 100644 index 00000000..b11ecd0f --- /dev/null +++ b/doc/ListeNiveau/Facile/15x5_txt.html @@ -0,0 +1,126 @@ + + + + + + +15x5 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

15:5 0:3:0:0:0:4:0:4:0:3:0:0:3:0:3 1:0:0:3:0:0:3:0:3:0:0:3:0:0:0 0:1:0:0:1:0:0:2:0:0:3:0:4:0:6 0:0:0:0:0:0:0:0:0:0:0:1:0:0:0 2:0:0:4:0:0:4:0:3:0:4:0:4:0:4

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/7x7_1_txt.html b/doc/ListeNiveau/Facile/7x7_1_txt.html new file mode 100644 index 00000000..3dd3849a --- /dev/null +++ b/doc/ListeNiveau/Facile/7x7_1_txt.html @@ -0,0 +1,126 @@ + + + + + + +7x7_1 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

7:7 4:0:4:0:0:1:0 0:0:0:2:0:0:3 0:0:3:0:0:2:0 6:0:0:0:0:0:5 0:0:0:0:0:0:0 0:0:0:0:0:0:0 4:0:0:0:0:0:4

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/7x7_2_txt.html b/doc/ListeNiveau/Facile/7x7_2_txt.html new file mode 100644 index 00000000..7b4e45f2 --- /dev/null +++ b/doc/ListeNiveau/Facile/7x7_2_txt.html @@ -0,0 +1,126 @@ + + + + + + +7x7_2 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

7:7 4:0:0:3:0:0:2 0:0:0:0:0:0:0 0:0:0:0:0:0:0 5:0:0:0:0:0:5 0:1:0:3:0:1:0 0:0:0:0:0:0:0 3:0:0:5:0:0:4

+ +
+ + + + + diff --git a/doc/ListeNiveau/Facile/7x7_3_txt.html b/doc/ListeNiveau/Facile/7x7_3_txt.html new file mode 100644 index 00000000..ced98944 --- /dev/null +++ b/doc/ListeNiveau/Facile/7x7_3_txt.html @@ -0,0 +1,126 @@ + + + + + + +7x7_3 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

7:7 0:1:0:0:4:0:4 3:0:1:0:0:0:0 0:0:0:0:0:0:4 6:0:0:0:5:0:0 0:0:1:0:0:0:4 0:0:0:0:0:0:0 2:0:3:0:6:0:4

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/10x10_2_txt.html b/doc/ListeNiveau/Moyen/10x10_2_txt.html new file mode 100644 index 00000000..e0e71ba3 --- /dev/null +++ b/doc/ListeNiveau/Moyen/10x10_2_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x10_2 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:10 4:0:0:0:4:0:1:0:0:1 0:0:0:0:0:0:0:0:0:0 0:0:0:0:0:0:4:0:0:4 4:0:2:0:0:0:0:1:0:0 0:1:0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:2:0:2 0:0:0:0:0:0:0:0:0:0 0:3:0:0:5:0:3:0:0:1

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/10x10_txt.html b/doc/ListeNiveau/Moyen/10x10_txt.html new file mode 100644 index 00000000..31509b2a --- /dev/null +++ b/doc/ListeNiveau/Moyen/10x10_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x10 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:10 3:0:0:2:0:2:0:5:0:3 0:2:0:0:3:0:3:0:0:0 4:0:2:0:0:0:0:3:0:3 0:2:0:0:1:0:0:0:0:0 3:0:3:0:0:0:4:0:1:0 0:3:0:4:0:3:0:1:0:2 2:0:0:0:0:0:0:0:0:0 0:2:0:0:0:0:0:0:0:2 1:0:0:4:0:4:0:1:0:0 0:2:0:0:3:0:4:0:0:3

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/10x7_txt.html b/doc/ListeNiveau/Moyen/10x7_txt.html new file mode 100644 index 00000000..e0d1259b --- /dev/null +++ b/doc/ListeNiveau/Moyen/10x7_txt.html @@ -0,0 +1,126 @@ + + + + + + +10x7 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

10:7 0:1:0:0:2:0:3:0:3:0 2:0:0:3:0:3:0:2:0:0 0:0:2:0:1:0:0:0:0:1 2:0:0:1:0:3:0:0:2:0 0:0:4:0:2:0:0:1:0:2 0:0:0:1:0:4:0:0:2:0 3:0:4:0:2:0:0:2:0:2

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/12x12_txt.html b/doc/ListeNiveau/Moyen/12x12_txt.html new file mode 100644 index 00000000..93144675 --- /dev/null +++ b/doc/ListeNiveau/Moyen/12x12_txt.html @@ -0,0 +1,126 @@ + + + + + + +12x12 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

12:12 0:2:0:0:3:0:3:0:2:0:1:0 2:0:2:0:0:0:0:0:0:3:0:2 0:4:0:5:0:3:0:2:0:0:2:0 3:0:0:0:0:0:1:0:0:2:0:2 0:0:0:3:0:3:0:0:2:0:1:0 0:4:0:0:0:0:0:2:0:3:0:4 3:0:2:0:4:0:3:0:3:0:1:0 0:3:0:0:0:2:0:4:0:1:0:0 3:0:0:0:4:0:0:0:2:0:0:4 0:0:1:0:0:1:0:0:0:0:0:0 0:3:0:0:5:0:0:4:0:0:0:0 3:0:0:3:0:0:3:0:3:0:0:1

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/15x5_txt.html b/doc/ListeNiveau/Moyen/15x5_txt.html new file mode 100644 index 00000000..0b2b0904 --- /dev/null +++ b/doc/ListeNiveau/Moyen/15x5_txt.html @@ -0,0 +1,126 @@ + + + + + + +15x5 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

15:5 0:3:0:0:4:0:3:0:2:0:0:2:0:1:0 0:0:0:1:0:1:0:3:0:2:0:0:2:0:3 1:0:0:0:3:0:2:0:0:0:0:0:0:0:0 0:3:0:4:0:3:0:3:0:2:0:0:1:0:0 2:0:2:0:2:0:2:0:2:0:2:0:0:0:3

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/7x7_txt.html b/doc/ListeNiveau/Moyen/7x7_txt.html new file mode 100644 index 00000000..3dda6bfb --- /dev/null +++ b/doc/ListeNiveau/Moyen/7x7_txt.html @@ -0,0 +1,126 @@ + + + + + + +7x7 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

7:7 2:0:5:0:0:0:4 0:0:0:0:0:0:0 0:0:0:0:1:0:0 1:0:0:0:0:0:0 0:0:0:0:0:0:3 0:0:0:0:0:0:0 2:0:4:0:3:0:1

+ +
+ + + + + diff --git a/doc/ListeNiveau/Moyen/8x8_txt.html b/doc/ListeNiveau/Moyen/8x8_txt.html new file mode 100644 index 00000000..7eff4a78 --- /dev/null +++ b/doc/ListeNiveau/Moyen/8x8_txt.html @@ -0,0 +1,126 @@ + + + + + + +8x8 - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

8:8 2:0:3:0:3:0:1:0 0:0:0:0:0:0:0:0 3:0:0:0:3:0:0:2 0:0:0:0:0:0:0:0 4:0:0:0:4:0:3:0 0:0:1:0:0:0:0:0 1:0:0:0:1:0:0:1 0:0:3:0:0:0:3:0

+ +
+ + + + + diff --git a/doc/MainMenu.html b/doc/MainMenu.html new file mode 100644 index 00000000..432be0cc --- /dev/null +++ b/doc/MainMenu.html @@ -0,0 +1,199 @@ + + + + + + +class MainMenu - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class MainMenu +

+ +
+ +

Cette classe représente le menu Principal du jeu HASHI

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur du menu principal

+ +
+
# File MainMenu.rb, line 9
+    def initialize
+                
+                
+                main_window_res = "./Ressources/Glade/menu_principal.glade"
+                builder = Gtk::Builder.new
+                builder.add_from_file(main_window_res)
+
+                main_menu = builder.get_object('main_window')
+                main_menu.set_title "Menu principal"
+                main_menu.signal_connect "destroy" do 
+                        Gtk.main_quit 
+                end
+
+                main_menu.set_window_position Gtk::WindowPosition::CENTER
+                main_menu_CSS = Gtk::CssProvider.new
+        main_menu_CSS.load(data: <<-CSS)
+                        @import url("css/style.css");
+        CSS
+
+                main_menu.set_title "Hashi Game"
+                main_menu.style_context.add_provider(main_menu_CSS, Gtk::StyleProvider::PRIORITY_USER)
+
+                
+                btnSelection = builder.get_object('btn-selection-menu')
+                btnSelection.signal_connect('clicked'){
+                
+                        MenuSelection.new
+                        main_menu.destroy
+                        Gtk.main
+                }
+
+                btnTuto = builder.get_object('btn-tutoriel')
+                btnTuto.signal_connect('clicked'){
+                        Tuto.new
+                        main_menu.destroy
+                        Gtk.main
+                }
+
+                btnClassement = builder.get_object('btn-classement')
+                btnClassement.signal_connect('clicked'){
+                        Classement.new
+                        main_menu.destroy
+                        Gtk.main
+                }
+
+                btnAPropos =builder.get_object('btn-about')
+                btnAPropos.signal_connect('clicked'){
+                        APropos.new
+                }
+                
+
+                btnQuitter = builder.get_object('btn-quitter')
+                btnQuitter.signal_connect('clicked'){Gtk.main_quit}
+
+                bouton_css = Gtk::CssProvider.new
+                bouton_css.load(data: <<-CSS)
+                        @import url("css/style.css");
+        CSS
+                btnSelection.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnTuto.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnClassement.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnQuitter.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnAPropos.style_context.add_provider(bouton_css, Gtk::StyleProvider::PRIORITY_USER)
+
+                main_menu.show_all
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/MenuLayout.html b/doc/MenuLayout.html new file mode 100644 index 00000000..f6d2e933 --- /dev/null +++ b/doc/MenuLayout.html @@ -0,0 +1,338 @@ + + + + + + +class MenuLayout - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class MenuLayout +

+ +
+ +

Cette classe sert de layout de base pour la création de Menu.

+ +
Les classes héritantes peuvent ainsi implémenter les attributs en fonction de leurs besoins.
+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ btn_difficile[RW] +
+ +
+

Bouton du mode Difficile

+
+
+
+
+ btn_facile[RW] +
+ +
+

Bouton du mode Facile

+
+
+
+
+ btn_moyen[RW] +
+ +
+

Bouton du mode Moyen

+
+
+
+
+ css_file[RW] +
+ +
+

Attribut correspondant au fichier CSS

+
+
+
+
+ menu[R] +
+ +
+

Attribut correspondant au menu

+
+
+
+
+ tableauBtn[RW] +
+ +
+

Tableau de bouton

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(path, title) + click to toggle source +
+ +
+

Constructeur du MenuLayout

+
  • +

    path Chemin du fichier

    +
  • +

    title Titre du menu

    +
+ +
+
# File MenuLayout.rb, line 48
+    def initialize(path, title)
+
+        main_window_res = "./Ressources/Glade/menu_selection.glade"
+        @builder = Gtk::Builder.new
+        @builder.add_from_file(main_window_res)
+
+        @menu = @builder.get_object('main_window')
+        @menu.set_title title
+        @menu.signal_connect "destroy" do 
+            Gtk.main_quit 
+        end
+        @menu.set_window_position Gtk::WindowPosition::CENTER
+
+        allbtn = @builder.get_object('listbox')
+
+        facile_box = @builder.get_object('facile_box')
+        moyen_box= @builder.get_object('moyen_box')
+        difficile_box= @builder.get_object('difficile_box')
+
+        niveau = @builder.get_object('niveau')
+
+        @btn_retour = @builder.get_object('btn_retour')
+        @css_file = Gtk::CssProvider.new
+        @css_file.load(data: <<-CSS)
+                    @import url("css/style.css");
+                CSS
+
+         # #Bouton Retour cliqué
+         @btn_retour.signal_connect('clicked'){
+                @menu.destroy
+            MainMenu.new
+            Gtk.main
+        }
+
+        @btn_facile = @builder.get_object('btn_facile')
+        @btn_moyen = @builder.get_object('btn_moyen')
+        @btn_difficile = @builder.get_object('btn_difficile')
+
+        @btn_retour.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        @menu.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        @btn_facile.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        @btn_moyen.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        @btn_difficile.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+        
+        facile_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        moyen_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+        difficile_box.style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+
+        @tableauBtn=Array.new(22)
+        # "ListeNiveau"
+        #Initialisation des boutons de niveau
+        @tabfacile=[path+"/Facile/7x7_1.txt",path+"/Facile/7x7_2.txt",path+"/Facile/7x7_3.txt",path+"/Facile/10x7.txt",path+"/Facile/10x10.txt",path+"/Facile/12x12.txt",path+"/Facile/15x5.txt",path+"/Facile/12x12_1.txt"]
+        @tabdimfacile=[7,7,7,7,7,7,10,7,10,10,12,12,15,5,12,12]
+        @tabmoyen=[path+"/Moyen/7x7.txt",path+"/Moyen/8x8.txt",path+"/Moyen/10x7.txt",path+"/Moyen/10x10_2.txt",path+"/Moyen/10x10.txt",path+"/Moyen/12x12.txt",path+"/Moyen/15x5.txt"]
+        @tabdimmoyen=[7,7,8,8,10,7,10,10,10,10,12,12,15,5]
+        @tabdifficile=[path+"/Difficile/7x7.txt",path+"/Difficile/8x8.txt",path+"/Difficile/10x7.txt",path+"/Difficile/10x10.txt",path+"/Difficile/10X10_2.txt",path+"/Difficile/12x12.txt",path+"/Difficile/15x5.txt"]
+        @tabdimdifficile=[7,7,8,8,10,7,10,10,10,10,12,12,15,5]
+        dimfacile=0
+        facile=0
+        moyen=0
+        dimmoyen=0
+        difficile=0
+        dimdifficile=0
+        @tableauBtn.each_index{|z|
+            if (z<8)
+                x=@tabdimfacile[dimfacile]
+                dimfacile+=1
+                y=@tabdimfacile[dimfacile]
+                dimfacile+=1
+                niveaufacile=@tabfacile[facile]
+                facile+=1
+                @tableauBtn[z]= BoutonChoix.new(true,false,false,niveaufacile,x,y)
+                @tableauBtn[z].set_path(niveaufacile)
+                facile_box.add(@tableauBtn[z])
+            elsif(z<15)
+                x=@tabdimmoyen[dimmoyen]
+                dimmoyen+=1
+                y=@tabdimmoyen[dimmoyen]
+                dimmoyen+=1
+                niveaumoyen=@tabmoyen[moyen]
+                moyen+=1
+                @tableauBtn[z]= BoutonChoix.new(false,true,false,niveaumoyen,x,y)
+                @tableauBtn[z].set_path(niveaumoyen)
+                moyen_box.add(@tableauBtn[z])
+            elsif(z<22)
+                x=@tabdimdifficile[dimdifficile]
+                dimdifficile+=1
+                y=@tabdimdifficile[dimdifficile]
+                dimdifficile+=1
+                niveaudifficile=@tabdifficile[difficile]
+                difficile+=1
+                @tableauBtn[z]= BoutonChoix.new(false,false,true,niveaudifficile,x,y)
+                @tableauBtn[z].set_path(niveaudifficile)
+                difficile_box.add(@tableauBtn[z])
+            end
+            
+            @tableauBtn[z].style_context.add_provider(@css_file, Gtk::StyleProvider::PRIORITY_USER)
+            # allbtn.add(@tableauBtn[z])
+        }
+
+        facile_box.show_all
+        moyen_box.show_all
+        difficile_box.show_all
+        
+        moyen_box.visible = false
+        difficile_box.visible = false
+        
+        
+        @btn_facile = @builder.get_object('btn_facile').signal_connect('clicked'){
+          facile_box.visible = true
+          moyen_box.visible = false
+          difficile_box.visible = false
+          niveau.from_file= "./Ressources/MenuSelection/facile.png"
+        
+        }
+        @btn_moyen = @builder.get_object('btn_moyen').signal_connect('clicked'){
+          facile_box.visible = false
+          moyen_box.visible = true
+          difficile_box.visible = false
+          niveau.from_file= "./Ressources/MenuSelection/moyen.png"
+        }
+        @btn_difficile = @builder.get_object('btn_difficile').signal_connect('clicked'){
+          facile_box.visible = false
+          moyen_box.visible = false
+          difficile_box.visible = true
+          niveau.from_file= "./Ressources/MenuSelection/difficile.png"
+          
+        }
+
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/MenuSelection.html b/doc/MenuSelection.html new file mode 100644 index 00000000..9ec6e04f --- /dev/null +++ b/doc/MenuSelection.html @@ -0,0 +1,214 @@ + + + + + + +class MenuSelection - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class MenuSelection +

+ +
+ +

Représentation du Menu de Selection de Niveau qui hérite de la classe MenuLayout Le Menu de Selection implémente la logique permettant d'accéder à une grille spécifique

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur du Menu de selection

+
+ Calls superclass method + MenuLayout::new +
+ +
+
# File MenuSelection.rb, line 15
+    def initialize
+        super("ListeNiveau","Menu Selection")
+       
+        image = @builder.get_object('logo-menu')
+        image.from_file = "css/logo-selection.png"
+
+        #Lien entre Menu Selection et chaque plateau
+        tableauBtn.each_index{|x| tableauBtn[x].signal_connect('clicked'){
+              
+                @menu.set_sensitive(false)
+                main_window_res = "./Ressources/Glade/menu_chargement.glade"
+                builder = Gtk::Builder.new
+                builder.add_from_file(main_window_res)
+          
+                window = builder.get_object('main_window')
+                window.style_context.add_provider(css_file,  Gtk::StyleProvider::PRIORITY_USER)
+                window.signal_connect "destroy" do 
+                    @menu.set_sensitive(true)
+                    window.destroy
+                end
+                window.set_window_position Gtk::WindowPosition::CENTER
+
+                btnLancer = builder.get_object('btnLancer')
+                btnSave = builder.get_object('btnSave')
+                #Recuperer la difficulté en variable
+                if(tableauBtn[x].isFacile?)
+                        diff = "Facile"
+                elsif(tableauBtn[x].isMoyen?)
+                        diff = "Moyen"
+                else
+                        diff = "Hard"
+                end
+                titre = tableauBtn[x].getNiveau.match(/[^\/]*.txt/)
+                if ((!(File.file?("./Sauvegarde/#{diff}/save#{titre}"))) || File.zero?("./Sauvegarde/#{diff}/save#{titre}"))
+                        btnSave.sensitive = false
+                end
+                btnSave.signal_connect('clicked'){
+                    chargement=1
+                   
+                    window.destroy
+                    @menu.destroy
+                    $window = Plateau.new(tableauBtn[x].getNiveau,tableauBtn[x].getY,tableauBtn[x].getX, diff,chargement)
+                    Gtk.main
+                }
+                btnLancer.signal_connect('clicked'){
+                    chargement =0
+                    window.destroy
+                    @menu.destroy
+                    $window = Plateau.new(tableauBtn[x].getNiveau,tableauBtn[x].getY,tableauBtn[x].getX, diff,chargement)
+                    Gtk.main
+                }
+                btnRetourcharg =  builder.get_object('btnRetourcharg')
+                btnRetourcharg.signal_connect('clicked'){
+                    @menu.set_sensitive(true)
+                    window.destroy
+                }
+
+                #---- Création du style CSS ----
+                btn_css = Gtk::CssProvider.new
+                btn_css.load(data: <<-CSS)
+                @import url("css/style.css");
+                  CSS
+
+                #---- Affectation du style  CSS ----
+                btnLancer.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnSave.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER)
+                btnRetourcharg.style_context.add_provider(btn_css, Gtk::StyleProvider::PRIORITY_USER)
+           
+
+                window.show_all
+            }   
+        
+        }
+        
+        
+        @menu.show
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Pause.html b/doc/Pause.html new file mode 100644 index 00000000..08359569 --- /dev/null +++ b/doc/Pause.html @@ -0,0 +1,184 @@ + + + + + + +class Pause - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Pause +

+ +
+ +

Représentation du Menu Pause

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur du Menu Pause

+ +
+
# File Pause.rb, line 11
+    def initialize()
+       
+        file_import = "./Ressources/Glade/menu_pause.glade"
+        builder = Gtk::Builder.new
+        builder.add_from_file(file_import)
+
+        
+        menu_pause = builder.get_object('menu_pause')
+
+        menu_pause.signal_connect "destroy" do
+            $window.getPlateau().set_sensitive(true)
+            menu_pause.destroy
+        end
+
+        menu_pause.set_window_position Gtk::WindowPosition::CENTER
+
+       
+        boutonReprendre = builder.get_object('boutonReprendre')
+        boutonReprendre.signal_connect('clicked'){
+            $window.getPlateau().set_sensitive(true)
+            menu_pause.destroy
+            $window.lancerChrono
+        }
+
+        boutonRecommencer = builder.get_object('boutonRecommencer')
+        boutonRecommencer.signal_connect('clicked'){
+            $window.getPlateau().set_sensitive(true)
+            menu_pause.destroy
+            $window.resetPlateau()
+        }
+        
+        boutonQuitter = builder.get_object('boutonQuitter')
+            boutonQuitter.signal_connect('clicked'){
+            menu_pause.destroy
+            $window.getPlateau().destroy
+            MainMenu.new
+            Gtk.main
+            }
+
+        css_file = Gtk::CssProvider.new
+        css_file.load(data: <<-CSS)
+             @import url("css/style.css");
+                CSS
+        
+        menu_pause.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonReprendre.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonRecommencer.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+        menu_pause.show_all
+    end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Plateau.html b/doc/Plateau.html new file mode 100644 index 00000000..325ebeab --- /dev/null +++ b/doc/Plateau.html @@ -0,0 +1,513 @@ + + + + + + +class Plateau - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Plateau +

+ +
+ +

Cette classe représente le plateau du plateau du jeu

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ grid[RW] +
+ +
+

Référence sur la grille

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(nomniv, x, y, diff, chargement) + click to toggle source +
+ +
+

Constructeur du plateau

+
  • +

    nomniv nom du niveau lancé

    +
  • +

    x nombre de colonnes

    +
  • +

    y nombre de lignes

    +
  • +

    diff difficulté du niveau lancé

    +
  • +

    chargement variable indiquand si le niveau créé est un nouveau niveau ou un niveau chargé

    +
+ +
+
# File Plateau.rb, line 41
+    def initialize(nomniv, x, y, diff, chargement)
+        @nomniv=nomniv
+        @x=x
+        @y=y
+        @diff = diff
+        @chargement=chargement #0 ou 1 si 1 ils s'agit d'un chargement
+
+        # Initialisation de la grille
+        @grid = HashiGrid.new(@nomniv, @diff, @x,@y)
+       
+         #Creation de la fenêtre
+        main_window_res = "./Ressources/Glade/plateau.glade"
+        builder = Gtk::Builder.new
+        builder.add_from_file(main_window_res)
+
+        @plateau = builder.get_object('plateau')
+        @plateau.set_title "Hashi Game"
+        @plateau.signal_connect "destroy" do 
+            Thread.kill(@t)
+            Gtk.main_quit 
+        end
+
+        @plateau.set_window_position Gtk::WindowPosition::CENTER
+        css_file = Gtk::CssProvider.new
+        css_file.load(data: <<-CSS)
+            @import url("css/plateau_style.css");
+        CSS
+
+        #Reglage bouton pause
+        boutonPause = builder.get_object('boutonPause')
+        boutonPause.signal_connect('clicked'){
+            @plateau.set_sensitive(false)
+            Thread.kill(@t)
+            pause = Pause.new()
+        }
+        @plateau.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        @label_aide = builder.get_object('label_aide')
+        @label_aide.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        
+
+        @aide = Aide.new(@grid)
+        @label_aide.set_label("")
+      
+
+        # #Reglage du bouton indice
+        boutonIndice = builder.get_object('boutonIndice')
+        boutonIndice.signal_connect('clicked'){
+            @label_aide.set_label(@aide.getMessageAide)
+            @boxPrincipale.show_all
+        }
+
+        # #Reglage du bouton Undo
+        boutonUndo = builder.get_object('boutonUndo')
+       
+        # #Reglage du bouton Redo
+        boutonRedo = builder.get_object('boutonRedo')
+
+        # #Reglage du bouton Hypothèse
+        boutonHypo = builder.get_object('boutonHypo')
+        boutonHypo.signal_connect('clicked'){
+            @plateau.set_sensitive(false)
+            Hypothese.new(self)
+        }
+        
+        boutonPause.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonIndice.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonRedo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonUndo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        boutonHypo.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        # #Creation de la barre d'outils en haut de la fenêtre
+    
+        $temps = builder.get_object('temps')
+        
+
+        @boxJeu = builder.get_object('boxJeu')
+        @boxJeu.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        
+        # @boxJeu.set_border_width(10)
+        $temps = builder.get_object('temps')
+       
+        #  Chargement de la grille
+        @grid.chargeGrille()
+        @grid.chargeVoisins
+
+        $tempssec = 0
+
+        if(@chargement==1)
+           $tempssec = Sauvegarde.charge(@grid,nomniv,diff)
+        end
+
+        $temps.set_text($tempssec.to_s)
+
+        @grid.expand = true 
+        @grid.halign =  Gtk::Align::CENTER
+        @grid.valign =  Gtk::Align::CENTER
+        @grid.set_row_homogeneous(true)
+        @grid.set_column_homogeneous(true)
+      
+
+        boutonUndo.signal_connect('clicked'){
+           @grid.undoPrevious
+        }
+
+        boutonRedo.signal_connect('clicked'){
+            @grid.redoPrevious
+        }
+
+        # ajoutGrille(grid)
+        @boxJeu.add(@grid)
+        @boxJeu.show_all
+
+        #Creation et affichage de la fenêtre principale
+        @boxPrincipale = builder.get_object('boxPrincipale')
+        @boxPrincipale.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+        #Gestion du temps
+        
+        @chargement = 0
+
+        @plateau.show
+
+        #Thread chronomètre
+        lancerChrono
+    end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ getPlateau() + click to toggle source +
+ +
+

Retourne le plateau de jeu

+ +
+
# File Plateau.rb, line 167
+def getPlateau()
+    return @plateau
+end
+
+
+ + +
+ +
+
+ hypotheseValider(newGrid) + click to toggle source +
+ +
+

Cette méthode permet de gérer tous les traitements lors de la validation de l'hypothèse Elle supprime l'ancienne grille et met en place la nouvelle

+
  • +

    newGrid la grille du mode hypothèse qui va remplacer la grille actuelle

    +
+ +
+
# File Plateau.rb, line 255
+def hypotheseValider(newGrid)
+    
+    @boxJeu.remove(@grid)
+    @grid = newGrid
+    @grid.expand = true 
+    @grid.halign =  Gtk::Align::CENTER
+    @grid.valign =  Gtk::Align::CENTER
+    @grid.set_row_homogeneous(true)
+    @grid.set_column_homogeneous(true)
+    if(@grid.grilleFini? )
+        self.partiFini
+    end 
+    @grid.undoRedo.cleanAll()
+    @boxJeu.add(@grid)
+
+    return self
+end
+
+
+ + +
+ +
+
+ lancerChrono() + click to toggle source +
+ +
+

Lance un thread pour le chronometre

+ +
+
# File Plateau.rb, line 274
+def lancerChrono()
+    @t = Thread.new{
+        loop{
+            
+            sleep(1)
+            $tempssec += 1
+            $temps.set_text($tempssec.to_s)
+        }
+
+        Thread.exit
+    }
+
+    return self
+end
+
+
+ + +
+ +
+
+ partiFini() + click to toggle source +
+ +
+

Méthode responsable de la gestion d'une parti fini

+ +
+
# File Plateau.rb, line 172
+    def partiFini
+
+        if(@grid.grilleFini?)
+        
+            sleep(0.5) # on attend 0.5 sec afin de voir le coup qu'on a effectuer avant l'affichage #
+            Thread.kill(@t)
+            @plateau.set_sensitive(false)
+        
+            main_window_res = "./Ressources/Glade/menu_win.glade"
+            builder = Gtk::Builder.new
+            builder.add_from_file(main_window_res)
+
+            window = builder.get_object('menu_gain')
+            window.set_title "VICTOIRE"
+            window.set_window_position Gtk::WindowPosition::CENTER
+            window.signal_connect "destroy" do 
+                Gtk.main_quit 
+            end
+
+            css_file = Gtk::CssProvider.new
+            css_file.load(data: <<-CSS)
+                @import url("css/menu_pause.css");
+            CSS
+
+            window.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+         
+            #Affichage du temps
+            texteTemps = builder.get_object('texteTemps')
+            texteTemps.set_markup("<span font_desc = \"Toledo 15\">Votre temps : " +  $tempssec.to_s + " secondes.</span>\n")
+            texteTemps.set_justify(Gtk::Justification::CENTER)
+            
+            saveBox = builder.get_object('saveBox')
+    
+            # #Zone de texte pour entrer son pseudo
+            zonetexte= builder.get_object('zonetexte')
+            zonetexte.set_placeholder_text("Votre pseudo")
+
+            # #Bouton pour sauvegarder
+            btnSauvegarder = builder.get_object('btnSauvegarder')
+            textLabel = builder.get_object("textLabel")
+
+            btnSauvegarder.signal_connect('clicked'){
+                label = zonetexte.text + "<span font_desc = \"Calibri 10\"> sauvegardé.</span>\n"
+                Sauvegarde.saveTime(@nomniv, @diff, $tempssec.to_s, zonetexte.text)
+                textLabel.set_markup(label)
+                btnSauvegarder.hide()
+               
+            }
+
+            # #Bouton pour recommencer la partie
+            btnRecommencer = builder.get_object('btnRecommencer')
+            btnRecommencer.signal_connect('clicked'){
+                self.getPlateau().set_sensitive(true)
+                window.destroy
+                self.resetPlateau()
+                Gtk.main
+            }
+    
+            # #Bouton pour retourner au menu principal
+            btnRetour =  builder.get_object('btnRetour')
+            btnRetour.signal_connect('clicked'){
+                window.destroy
+                @plateau.destroy
+                MainMenu.new
+                Gtk.main
+            }
+            
+            btnRecommencer.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+            btnRetour.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+            btnSauvegarder.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+            Sauvegarde.saveDelete(@nomniv, @diff)
+         
+
+            window.show_all
+        end
+        
+    end
+
+
+ + +
+ +
+
+ resetPlateau() + click to toggle source +
+ +
+

Mis à jour du niveau Dans notre cas on reset le plateau

+ +
+
# File Plateau.rb, line 292
+def resetPlateau()
+
+
+    Thread.kill(@t)
+
+    @plateau.destroy
+
+    $window = Plateau.new(@nomniv,@y,@x, @diff,@chargement)
+    Gtk.main
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Pont.html b/doc/Pont.html new file mode 100644 index 00000000..814e7763 --- /dev/null +++ b/doc/Pont.html @@ -0,0 +1,339 @@ + + + + + + +class Pont - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Pont +

+ +
+ +

Représentation des ponts du jeu

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ directionPont[RW] +
+ +
+

Représente la direction du pont. (0 = pas de pont, 1 = horizontal, 2 = vertical)

+
+
+
+
+ estDouble[RW] +
+ +
+

Attribut permettant de savoir si un pont est double ou non

+
+
+
+
+ typePont[RW] +
+ +
+

Représente les différents types de pont. (0 = aucun bord, 1 = un pont, 2 = deux pont)

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new(grid, col, lig ) + click to toggle source +
+ +
+

Constructeur d'un pont

+
  • +

    grid Référence sur la grille

    +
  • +

    col Référence sur la grille

    +
  • +

    lig Référence sur la grille

    +
+
+ Calls superclass method + Ile::new +
+ +
+
# File Pont.rb, line 28
+    def initialize(grid, col, lig ) 
+        super(grid, '0', col, lig )
+        @typePont = 0
+        @estDouble = false
+        @directionPont = 0
+
+        self.set_name('pont')
+        css_file = Gtk::CssProvider.new
+        css_file.load(data: <<-CSS)
+                @import url("css/plateau_style.css");
+                CSS
+        self.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+        self.set_sensitive(false)  # Un pont n'est pas cliquable par défaut
+        self.status = 'p'
+    end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ get_directionPont() + click to toggle source +
+ +
+

Retourne la direction du pont

+ +
+
# File Pont.rb, line 45
+def get_directionPont
+    return @directionPont
+end
+
+
+ + +
+ +
+
+ get_typePont() + click to toggle source +
+ +
+

Retourne le type du pont

+ +
+
# File Pont.rb, line 67
+def get_typePont
+    return @typePont
+end
+
+
+ + +
+ +
+
+ set_directionPont(val) + click to toggle source +
+ +
+

Modifie la direction du pont

+ +
+
# File Pont.rb, line 50
+def set_directionPont(val)
+    @directionPont = val
+    return self
+end
+
+
+ + +
+ +
+
+ set_typePont(val) + click to toggle source +
+ +
+

Modifie le type du pont

+ +
+
# File Pont.rb, line 56
+def set_typePont(val)
+    if val >= 0
+        @typePont = val
+    else 
+        @typePont = 0
+    end
+
+    return self
+end
+
+
+ + +
+ +
+
+ update() + click to toggle source +
+ +
+

Méthode responsable de la mise à jour d'un pont.

+ +
+
# File Pont.rb, line 73
+def update()
+    
+    if @typePont == 0 && @directionPont == 0
+        self.image.from_file= "Ressources/Pont/0.png"
+    elsif @typePont == 1
+        # Si le pont == 1 alors il est horizontal
+        # Sinon il est vertical
+        if @directionPont == 1
+             self.image.from_file= "Ressources/Pont/h_simple.png"
+        else
+            self.image.from_file= "Ressources/Pont/v_simple.png"
+        end
+    elsif @typePont == 2 
+        if @directionPont == 1
+            self.image.from_file= "Ressources/Pont/h_double.png"
+        else
+            self.image.from_file= "Ressources/Pont/v_double.png"
+           
+        end
+    end
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/README_md.html b/doc/README_md.html new file mode 100644 index 00000000..9a7ffdde --- /dev/null +++ b/doc/README_md.html @@ -0,0 +1,130 @@ + + + + + + +README - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Hashi-TP4

+ +

Projet du groupe 4 dans le cadre du Genie Logiciel du S6 de L3 Informatique

+ +

Groupe 4 Aaron AMANI Axel JOURRY Cindy CALVADOS Clement JANVIER Collins SOARES Florian DREUX Rayyan LAJNEF Thomas MALABRY Willhem LIBAN

+ +
+ + + + + diff --git a/doc/Ressources/Glade/hypo_glade.html b/doc/Ressources/Glade/hypo_glade.html new file mode 100644 index 00000000..5162b84b --- /dev/null +++ b/doc/Ressources/Glade/hypo_glade.html @@ -0,0 +1,326 @@ + + + + + + +hypo.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+ <object class="GtkImage" id="aide">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/aide.png</property>
+</object>
+ <object class="GtkImage" id="valider">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/valider.png</property>
+</object>
+ <object class="GtkImage" id="annuler">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/annuler.png</property>
+</object>
+<object class="GtkImage" id="redo">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/redo.png</property>
+</object>
+<object class="GtkImage" id="undo">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/undo.png</property>
+</object>
+<object class="GtkWindow" id="hypo">
+  <property name="can-focus">False</property>
+  <child>
+    <object class="GtkBox" id="boxPrincipale">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="orientation">vertical</property>
+      <property name="spacing">5</property>
+      <child>
+        <object class="GtkFrame" id="boxBarreFrame">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="label-xalign">0</property>
+          <property name="shadow-type">none</property>
+          <child>
+            <object class="GtkBox" id="boxBarre">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="homogeneous">True</property>
+              <child>
+                <object class="GtkButton" id="btnIndice">
+                  <property name="label" translatable="yes"></property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="always-show-image">True</property>
+                    <property name="image">aide</property>
+                  <property name="receives-default">True</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btnUndo">
+                  <property name="label" translatable="yes"></property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="image">undo</property>
+                  <property name="always-show-image">True</property>
+                  <property name="receives-default">True</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btnRedo">
+                  <property name="label" translatable="yes"></property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="always-show-image">True</property>
+                     <property name="image">redo</property>
+                  <property name="receives-default">True</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+
+                </packing>
+              </child>
+            </object>
+          </child>
+          <child type="label_item">
+            <placeholder/>
+          </child>
+        </object>
+        <packing>
+          <property name="expand">False</property>
+          <property name="fill">True</property>
+          <property name="position">0</property>
+        </packing>
+      </child>
+      <child>
+        <object class="GtkFrame" id="boxJeuFrame">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="label-xalign">0</property>
+          <property name="shadow-type">none</property>
+          <child>
+            <object class="GtkBox" id="boxJeu">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="homogeneous">True</property>
+              <child>
+                <placeholder/>
+              </child>
+              <child>
+                <placeholder/>
+              </child>
+              <child>
+                <placeholder/>
+              </child>
+            </object>
+          </child>
+          <child type="label_item">
+            <placeholder/>
+          </child>
+        </object>
+        <packing>
+          <property name="expand">True</property>
+          <property name="fill">True</property>
+          <property name="position">1</property>
+        </packing>
+      </child>
+      <child>
+        <object class="GtkLabel" id="label_indice">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="label" translatable="yes"></property>
+        </object>
+        <packing>
+          <property name="expand">False</property>
+          <property name="fill">True</property>
+          <property name="position">2</property>
+        </packing>
+      </child>
+      <child>
+        <object class="GtkBox">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+            <property name="halign">center</property>
+              <property name="valign">center</property>
+              <property name="spacing">9</property>
+          <child>
+            <object class="GtkButton" id="btnValider">
+                <property name="image">valider</property>
+              <property name="visible">True</property>
+              <property name="can-focus">True</property>
+              <property name="receives-default">True</property>
+              <property name="always-show-image">True</property>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkButton" id="btnAnnuler">
+              <property name="visible">True</property>
+              <property name="image">annuler</property>
+              <property name="can-focus">True</property>
+              <property name="receives-default">True</property>
+              <property name="always-show-image">True</property>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+        <packing>
+          <property name="expand">False</property>
+          <property name="fill">True</property>
+          <property name="position">3</property>
+        </packing>
+      </child>
+    </object>
+  </child>
+   <style>
+    <class name="bg-hypo"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/menu_chargement_glade.html b/doc/Ressources/Glade/menu_chargement_glade.html new file mode 100644 index 00000000..c59c7a71 --- /dev/null +++ b/doc/Ressources/Glade/menu_chargement_glade.html @@ -0,0 +1,249 @@ + + + + + + +menu_chargement.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path css\\styleMENU.css -->
+<object class="GtkWindow" id="main_window"  >
+  <property name="width-request">500</property>
+  <property name="height-request">300</property>
+  <property name="can-focus">False</property>
+  <property name="type">popup</property>
+  <property name="resizable">False</property>
+  <property name="window-position">center-on-parent</property>
+  <property name="default-width">440</property>
+  <property name="default-height">250</property>
+     <property name="destroy-with-parent">True</property>
+  <property name="skip-taskbar-hint">True</property>
+     <property name="decorated">False</property>
+  <child>
+    <object class="GtkFrame" id="frame">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-start">20</property>
+      <property name="margin-end">20</property>
+      <property name="margin-bottom">20</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox" >
+          <property name="width-request">100</property>
+          <property name="height-request">80</property>
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="orientation">vertical</property>
+          <child>
+            <object class="GtkImage">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="margin-top">20</property>
+              <property name="margin-bottom">20</property>
+              <property name="pixbuf">../flowers.svg</property>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkBox" >
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="halign">center</property>
+              <property name="orientation">vertical</property>
+              <property name="homogeneous">True</property>
+              <child>
+                <object class="GtkButton" id="btnLancer">
+                  <property name="label" translatable="yes">Nouvelle partie</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">True</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btnSave">
+                  <property name="label" translatable="yes">Charger Partie</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btnRetourcharg">
+                  <property name="label" translatable="yes">Retour</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="menu"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/menu_pause_glade.html b/doc/Ressources/Glade/menu_pause_glade.html new file mode 100644 index 00000000..40952c8d --- /dev/null +++ b/doc/Ressources/Glade/menu_pause_glade.html @@ -0,0 +1,249 @@ + + + + + + +menu_pause.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path css\\styleMENU.css -->
+<object class="GtkWindow" id="menu_pause">
+  <property name="width-request">500</property>
+  <property name="height-request">300</property>
+  <property name="can-focus">False</property>
+  <property name="type">popup</property>
+  <property name="resizable">False</property>
+  <property name="window-position">center-on-parent</property>
+  <property name="default-width">440</property>
+  <property name="default-height">250</property>
+   <property name="destroy-with-parent">True</property>
+  <property name="skip-taskbar-hint">True</property>
+     <property name="decorated">True</property>
+  <child>
+    <object class="GtkFrame">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-start">20</property>
+      <property name="margin-end">20</property>
+      <property name="margin-bottom">20</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox">
+          <property name="width-request">100</property>
+          <property name="height-request">80</property>
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="orientation">vertical</property>
+          <child>
+            <object class="GtkImage">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="margin-top">20</property>
+              <property name="margin-bottom">20</property>
+              <property name="pixbuf">../Pause/pause.svg</property>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkBox">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="halign">center</property>
+              <property name="orientation">vertical</property>
+              <property name="homogeneous">True</property>
+              <child>
+                <object class="GtkButton" id="boutonReprendre">
+                  <property name="label" translatable="yes">Reprendre</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">True</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="boutonRecommencer">
+                  <property name="label" translatable="yes">Recommencer</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="boutonQuitter">
+                  <property name="label" translatable="yes">Quitter</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-select"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="menu"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/menu_principal_glade.html b/doc/Ressources/Glade/menu_principal_glade.html new file mode 100644 index 00000000..48d9f3be --- /dev/null +++ b/doc/Ressources/Glade/menu_principal_glade.html @@ -0,0 +1,294 @@ + + + + + + +menu_principal.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path css\\style.css -->
+<object class="GtkWindow" id="main_window">
+  <signal name="destroy" handler="on_main_window_destroy" swapped="no"/>
+  <property name="width-request">900</property>
+  <property name="height-request">700</property>
+  <property name="can-focus">False</property>
+  <property name="resizable">False</property>
+  <child>
+    <object class="GtkFrame" id="Plateau">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="margin-start">20</property>
+          <property name="margin-end">20</property>
+          <property name="margin-top">20</property>
+          <!-- <property name="margin-bottom">10</property> -->
+          <property name="orientation">vertical</property>
+          <property name="baseline-position">bottom</property>
+          <child>
+            <object class="GtkImage">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="pixbuf">../logo-principal.png</property>
+              <style>
+                <class name="hashi_img"/>
+              </style>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">False</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkBox">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="orientation">vertical</property>
+              <property name="spacing">33</property>
+              <child>
+                <object class="GtkButton" id="btn-selection-menu">
+                  <property name="label" translatable="yes">Selection niveau</property>
+                  <property name="width-request">222</property>
+                  <property name="height-request">56</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-blue"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btn-tutoriel">
+                  <property name="label" translatable="yes">Tutoriel</property>
+                  <property name="width-request">222</property>
+                  <property name="height-request">56</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-blue"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btn-classement">
+                  <property name="label" translatable="yes">Classement</property>
+                  <property name="width-request">222</property>
+                  <property name="height-request">56</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-blue"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btn-quitter">
+                  <property name="label" translatable="yes">Quitter</property>
+                  <property name="width-request">222</property>
+                  <property name="height-request">56</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                  <style>
+                    <class name="btn-blue"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">3</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkButton" id="btn-about">
+                  <property name="label" translatable="yes">A propos</property>
+                  <property name="width-request">117</property>
+                  <property name="height-request">50</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="halign">end</property>
+                  <property name="valign">end</property>
+                  <property name="always-show-image">True</property>
+                  <style>
+                    <class name="btn-blue"/>
+                    <class name="btn-blue__about"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">4</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">False</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="bg-menu"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/menu_selection_glade.html b/doc/Ressources/Glade/menu_selection_glade.html new file mode 100644 index 00000000..26e12089 --- /dev/null +++ b/doc/Ressources/Glade/menu_selection_glade.html @@ -0,0 +1,434 @@ + + + + + + +menu_selection.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path ..\..\css\\style.css -->
+<object class="GtkImage" id="btn_retour_img">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="halign">center</property>
+  <property name="valign">center</property>
+  <property name="pixbuf">../MenuSelection/back.png</property>
+</object>
+<object class="GtkImage" id="image1">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="halign">end</property>
+  <property name="pixbuf">../MenuSelection/btn_grille.png</property>
+</object>
+<object class="GtkImage" id="image2">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../MenuSelection/facile_star.svg</property>
+</object>
+<object class="GtkImage" id="image3">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../MenuSelection/moyen_star.svg</property>
+</object>
+<object class="GtkImage" id="image4">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../MenuSelection/difficile_star.svg</property>
+</object>
+<object class="GtkWindow" id="main_window" >
+  <property name="width-request">900</property>
+  <property name="height-request">700</property>
+  <property name="can-focus">False</property>
+  <property name="resizable">False</property>
+  <child>
+    <object class="GtkFrame">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-start">20</property>
+      <property name="margin-end">20</property>
+      <property name="margin-top">20</property>
+      <property name="margin-bottom">20</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox" id="box_principale">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="orientation">vertical</property>
+          <child>
+            <object class="GtkBox">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <child>
+                <object class="GtkButton" id="btn_retour">
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="receives-default">True</property>
+                  <property name="image">btn_retour_img</property>
+                  <style>
+                    <class name="back"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkBox" id="menu_haut">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="halign">end</property>
+                  <property name="valign">center</property>
+                  <property name="spacing">15</property>
+                  <child>
+                    <object class="GtkButton" id="btn_facile">
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <property name="image">image2</property>
+                      <style>
+                        <class name="btn_niveau"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">0</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkButton" id="btn_moyen">
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <property name="image">image3</property>
+                      <style>
+                        <class name="btn_niveau"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">1</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkButton" id="btn_difficile">
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <property name="image">image4</property>
+                      <style>
+                        <class name="btn_niveau"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">2</property>
+                    </packing>
+                  </child>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="pack-type">end</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkImage" id="logo-menu">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="stock">gtk-missing-image</property>
+                </object>
+                <packing>
+                  <property name="expand">True</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkBox" id="box_contenu">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="orientation">vertical</property>
+              <property name="baseline-position">bottom</property>
+              <child>
+                <object class="GtkImage" id="niveau">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="pixbuf">../MenuSelection/facile.png</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">-1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkScrolledWindow" id="scrolledwindow">
+                  <property name="name">scrolledwindow</property>
+                  <property name="width-request">700</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">True</property>
+                  <property name="halign">center</property>
+                  <child>
+                    <object class="GtkViewport">
+                      <property name="visible">True</property>
+                      <property name="can-focus">False</property>
+                      <property name="shadow-type">none</property>
+                      <property name="halign">center</property>
+                      <child>
+                        <object class="GtkBox">
+                          <property name="visible">True</property>
+                          <property name="can-focus">False</property>
+                          <property name="orientation">vertical</property>
+                          <property name="homogeneous">True</property>
+                          <child>
+                            <object class="GtkListBox" id="facile_box">
+                              <property name="visible">True</property>
+                              <property name="can-focus">False</property>
+
+                              <property name="selection-mode">none</property>
+                              <property name="activate-on-single-click">False</property>
+                              <child>
+                                <object class="GtkListBoxRow">
+                                  <property name="visible">True</property>
+                                  <property name="can-focus">True</property>
+                                   <property name="halign">center</property>
+                  <property name="valign">center</property>
+                                  <property name="activatable">False</property>
+                                  <property name="selectable">False</property>
+                                  <child>
+                                    <placeholder/>
+                                  </child>
+                                </object>
+                              </child>
+                              <style>
+                                <class name="listbox"/>
+                              </style>
+                            </object>
+                            <packing>
+                              <property name="expand">True</property>
+                              <property name="fill">True</property>
+                              <property name="position">0</property>
+                            </packing>
+                          </child>
+                          <child>
+                            <object class="GtkListBox" id="moyen_box">
+                              <property name="visible">True</property>
+                              <property name="can-focus">False</property>
+                              <property name="selection-mode">none</property>
+                              <property name="activate-on-single-click">False</property>
+                              <child>
+                                <object class="GtkListBoxRow">
+                                  <property name="visible">True</property>
+                                  <property name="can-focus">True</property>
+                                  <property name="activatable">False</property>
+                                  <property name="selectable">False</property>
+                                  <child>
+                                    <placeholder/>
+                                  </child>
+                                </object>
+                              </child>
+                              <style>
+                                <class name="listbox"/>
+                              </style>
+                            </object>
+                            <packing>
+                              <property name="expand">True</property>
+                              <property name="fill">True</property>
+                              <property name="position">1</property>
+                            </packing>
+                          </child>
+                          <child>
+                            <object class="GtkListBox" id="difficile_box">
+                              <property name="visible">True</property>
+                              <property name="can-focus">False</property>
+                              <property name="selection-mode">none</property>
+                              <property name="activate-on-single-click">False</property>
+                              <child>
+                                <object class="GtkListBoxRow">
+                                  <property name="visible">True</property>
+                                  <property name="can-focus">True</property>
+                                  <property name="activatable">False</property>
+                                  <property name="selectable">False</property>
+                                  <child>
+                                    <placeholder/>
+                                  </child>
+                                </object>
+                              </child>
+                              <style>
+                                <class name="listbox"/>
+                              </style>
+                            </object>
+                            <packing>
+                              <property name="expand">True</property>
+                              <property name="fill">True</property>
+                              <property name="position">2</property>
+                            </packing>
+                          </child>
+                        </object>
+                      </child>
+                    </object>
+                  </child>
+                  <style>
+                    <class name="scroll-btn"/>
+                  </style>
+                </object>
+                <packing>
+                  <property name="expand">True</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="bg-selection"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/menu_win_glade.html b/doc/Ressources/Glade/menu_win_glade.html new file mode 100644 index 00000000..14672ea0 --- /dev/null +++ b/doc/Ressources/Glade/menu_win_glade.html @@ -0,0 +1,335 @@ + + + + + + +menu_win.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path css\\styleMENU.css -->
+<object class="GtkWindow" id="menu_gain">
+  <property name="width-request">500</property>
+  <property name="height-request">300</property>
+  <property name="can-focus">True</property>
+  <property name="resizable">False</property>
+  <property name="window-position">center</property>
+  <property name="skip-taskbar-hint">True</property>
+  <property name="decorated">False</property>
+  <child>
+    <object class="GtkFrame">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-start">20</property>
+      <property name="margin-end">20</property>
+      <property name="margin-bottom">20</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox">
+          <property name="width-request">100</property>
+          <property name="height-request">80</property>
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="orientation">vertical</property>
+          <child>
+            <object class="GtkBox">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="orientation">vertical</property>
+              <child>
+                <object class="GtkImage">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="pixbuf">../victoire.png</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkLabel">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="label" translatable="yes">Vous etes vraiment trop fort ! </property>
+                  <attributes>
+                    <attribute name="font-desc" value="Toledo 14"/>
+                  </attributes>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkBox">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="halign">center</property>
+              <property name="orientation">vertical</property>
+              <property name="homogeneous">True</property>
+              <child>
+                <object class="GtkLabel" id="texteTemps">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkBox" id="saveBox">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="halign">center</property>
+                  <property name="valign">center</property>
+                  <property name="orientation">vertical</property>
+                  <child>
+                    <object class="GtkLabel" id="textLabel">
+                      <property name="visible">True</property>
+                      <property name="can-focus">False</property>
+                      <property name="label" translatable="yes">Votre pseudo</property>
+                      <property name="justify">center</property>
+                      <attributes>
+                        <attribute name="font-desc" value="Toledo 15"/>
+                      </attributes>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">0</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkEntry" id="zonetexte">
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                    </object>
+                    <packing>
+                      <property name="expand">True</property>
+                      <property name="fill">True</property>
+                      <property name="position">1</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkButton" id="btnSauvegarder">
+                      <property name="label" translatable="yes">Sauvegarder</property>
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <style>
+                        <class name="btn-select"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">True</property>
+                      <property name="fill">True</property>
+                      <property name="position">2</property>
+                    </packing>
+                  </child>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+              <child>
+                <object class="GtkBox">
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="spacing">10</property>
+                  <child>
+                    <object class="GtkButton" id="btnRecommencer">
+                      <property name="label" translatable="yes">Rejouer</property>
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <property name="valign">center</property>
+                      <style>
+                        <class name="btn-select"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">0</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkButton" id="btnRetour">
+                      <property name="label" translatable="yes">Quitter</property>
+                      <property name="visible">True</property>
+                      <property name="can-focus">True</property>
+                      <property name="receives-default">True</property>
+                      <property name="valign">center</property>
+                      <style>
+                        <class name="btn-select"/>
+                      </style>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">1</property>
+                    </packing>
+                  </child>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">2</property>
+                </packing>
+              </child>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="menu"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/plateau_glade.html b/doc/Ressources/Glade/plateau_glade.html new file mode 100644 index 00000000..ab0bb3b1 --- /dev/null +++ b/doc/Ressources/Glade/plateau_glade.html @@ -0,0 +1,391 @@ + + + + + + +plateau.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path ..\..\css\\style.css -->
+<object class="GtkImage" id="aide">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/aide.png</property>
+</object>
+<object class="GtkImage" id="hypothese">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/hypothese.png</property>
+</object>
+<object class="GtkImage" id="pause">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="valign">center</property>
+  <property name="pixbuf">../Plateau/pause.png</property>
+</object>
+<object class="GtkImage" id="redo">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/redo.png</property>
+</object>
+<object class="GtkImage" id="undo">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Plateau/undo.png</property>
+</object>
+<object class="GtkWindow" id="plateau">
+  <property name="width-request">1000</property>
+  <property name="height-request">700</property>
+  <property name="can-focus">False</property>
+  <property name="resizable">False</property>
+  <child>
+    <object class="GtkFrame">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-start">50</property>
+      <property name="margin-end">50</property>
+      <property name="label-xalign">0</property>
+      <property name="shadow-type">none</property>
+      <child>
+        <object class="GtkBox">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="orientation">vertical</property>
+          <child>
+            <object class="GtkBox" id="boxPrincipale">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="orientation">vertical</property>
+              <child>
+                <object class="GtkBox">
+                  <property name="name">menu_haut</property>
+                  <property name="visible">True</property>
+                  <property name="can-focus">False</property>
+                  <property name="margin-top">20</property>
+                  <property name="homogeneous">True</property>
+                  <child>
+                    <object class="GtkBox" id="menu_gauche">
+                      <property name="visible">True</property>
+                      <property name="can-focus">False</property>
+                      <property name="homogeneous">True</property>
+                      <child>
+                        <object class="GtkButton" id="boutonPause">
+                          <property name="name">boutonPause</property>
+                          <property name="visible">True</property>
+                          <property name="can-focus">True</property>
+                          <property name="receives-default">True</property>
+                          <property name="halign">start</property>
+                          <property name="image">pause</property>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">0</property>
+                        </packing>
+                      </child>
+                      <child>
+                        <object class="GtkLabel" id="temps">
+                          <property name="visible">True</property>
+                          <property name="can-focus">False</property>
+                          <property name="label" translatable="yes">""</property>
+                          <attributes>
+                            <attribute name="font-desc" value="Arial Rounded MT Bold, Bold 12"/>
+                          </attributes>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">1</property>
+                        </packing>
+                      </child>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="position">0</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkBox" id="menu_droite">
+                      <property name="visible">True</property>
+                      <property name="can-focus">False</property>
+                      <property name="halign">end</property>
+                      <property name="valign">center</property>
+                      <property name="spacing">15</property>
+                      <child>
+                        <placeholder/>
+                      </child>
+                      <child>
+                        <object class="GtkButton" id="boutonIndice">
+                          <property name="visible">True</property>
+                          <property name="can-focus">True</property>
+                          <property name="receives-default">True</property>
+                          <property name="image">aide</property>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">1</property>
+                        </packing>
+                      </child>
+                      <child>
+                        <object class="GtkButton" id="boutonHypo">
+                          <property name="visible">True</property>
+                          <property name="can-focus">True</property>
+                          <property name="receives-default">True</property>
+                          <property name="image">hypothese</property>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">2</property>
+                        </packing>
+                      </child>
+                    </object>
+                    <packing>
+                      <property name="expand">False</property>
+                      <property name="fill">True</property>
+                      <property name="pack-type">end</property>
+                      <property name="position">1</property>
+                    </packing>
+                  </child>
+                  <child>
+                    <object class="GtkBox" id="menu_milieu">
+                      <property name="visible">True</property>
+                      <property name="can-focus">False</property>
+                      <property name="halign">center</property>
+                      <property name="valign">center</property>
+                      <property name="spacing">15</property>
+                      <child>
+                        <object class="GtkButton" id="boutonUndo">
+                          <property name="name">boutonUndo</property>
+                          <property name="visible">True</property>
+                          <property name="can-focus">True</property>
+                          <property name="receives-default">True</property>
+                          <property name="image">undo</property>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">1</property>
+                        </packing>
+                      </child>
+                      <child>
+                        <object class="GtkButton" id="boutonRedo">
+                          <property name="name">boutonRedo</property>
+                          <property name="visible">True</property>
+                          <property name="can-focus">True</property>
+                          <property name="receives-default">True</property>
+                          <property name="image">redo</property>
+                          <style>
+                            <class name="btn-menu"/>
+                          </style>
+                        </object>
+                        <packing>
+                          <property name="expand">False</property>
+                          <property name="fill">True</property>
+                          <property name="position">2</property>
+                        </packing>
+                      </child>
+                    </object>
+                    <packing>
+                      <property name="expand">True</property>
+                      <property name="fill">True</property>
+                      <property name="position">2</property>
+                    </packing>
+                  </child>
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
+                </packing>
+              </child>
+            <child>
+                <object class="GtkBox" id="boxJeu">
+                  <property name="name">menu_haut</property>
+                  <property name="visible">True</property>
+                   <property name="halign">center</property>
+                   <property name="valign">center</property>
+                  <property name="can-focus">False</property>
+                  <property name="margin-top">20</property>
+                  <property name="margin-start">20</property>
+                  <property name="margin-end">20</property>
+                  <property name="homogeneous">True</property>
+                    <!-- <style>
+                    <class name="tuto_"/>
+                  </style> -->
+                </object>
+                <packing>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">1</property>
+                </packing>
+              </child>
+
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkLabel" id="label_aide">
+                  <property name="visible">True</property>
+                  <property name="margin-bottom">20</property>
+                  <property name="can-focus">False</property>
+                  <property name="label" translatable="yes">""</property>
+                  <style>
+                    <class name="label_aide"/>
+                  </style>
+                </object>
+          </child>
+        </object>
+      </child>
+      <child type="label_item">
+        <placeholder/>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="bg-black"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Ressources/Glade/tutoriel_glade.html b/doc/Ressources/Glade/tutoriel_glade.html new file mode 100644 index 00000000..b156c9e7 --- /dev/null +++ b/doc/Ressources/Glade/tutoriel_glade.html @@ -0,0 +1,233 @@ + + + + + + +tutoriel.glade - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

<?xml version=“1.0” encoding=“UTF-8”?> <!– Generated with glade 3.38.2 –> <interface>

+ +
<requires lib="gtk+" version="3.24"/>
+<!-- interface-css-provider-path ..\..\css\\style.css -->
+<object class="GtkImage" id="droite_img">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Tuto/droite.svg</property>
+</object>
+<object class="GtkImage" id="gauche_img">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Tuto/gauche.svg</property>
+</object>
+<object class="GtkImage" id="image1">
+  <property name="visible">True</property>
+  <property name="can-focus">False</property>
+  <property name="pixbuf">../Tuto/home.svg</property>
+</object>
+<object class="GtkWindow" id="tutoriel">
+  <property name="can-focus">False</property>
+  <property name="halign">center</property>
+  <property name="valign">center</property>
+  <property name="resizable">False</property>
+  <property name="window-position">center</property>
+  <child>
+    <object class="GtkBox">
+      <property name="visible">True</property>
+      <property name="can-focus">False</property>
+      <property name="margin-bottom">10</property>
+      <property name="orientation">vertical</property>
+      <child>
+        <object class="GtkBox" id="box_principale">
+          <property name="visible">True</property>
+          <property name="can-focus">False</property>
+          <property name="halign">center</property>
+          <property name="valign">center</property>
+
+          <child>
+            <object class="GtkButton" id="btnGauche">
+              <property name="visible">True</property>
+              <property name="can-focus">True</property>
+              <property name="receives-default">True</property>
+              <property name="image">gauche_img</property>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">0</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkImage" id="img_tuto">
+              <property name="visible">True</property>
+              <property name="can-focus">False</property>
+              <property name="halign">center</property>
+              <property name="valign">center</property>
+              <property name="pixbuf">../Tuto/tuto_2.svg</property>
+            </object>
+            <packing>
+              <property name="expand">True</property>
+              <property name="fill">True</property>
+              <property name="position">1</property>
+            </packing>
+          </child>
+          <child>
+            <object class="GtkButton" id="btnDroite">
+              <property name="visible">True</property>
+              <property name="can-focus">True</property>
+              <property name="receives-default">True</property>
+              <property name="image">droite_img</property>
+            </object>
+            <packing>
+              <property name="expand">False</property>
+              <property name="fill">True</property>
+              <property name="position">2</property>
+            </packing>
+          </child>
+        </object>
+        <packing>
+          <property name="expand">False</property>
+          <property name="fill">True</property>
+          <property name="position">0</property>
+        </packing>
+      </child>
+      <child>
+        <object class="GtkButton" id="home">
+          <property name="visible">True</property>
+          <property name="can-focus">True</property>
+           <property name="relief">none</property>
+          <property name="receives-default">True</property>
+          <property name="image">image1</property>
+          <property name="always-show-image">True</property>
+        </object>
+        <packing>
+          <property name="expand">False</property>
+          <property name="fill">True</property>
+          <property name="position">1</property>
+        </packing>
+      </child>
+    </object>
+  </child>
+  <style>
+    <class name="bg-tuto"/>
+  </style>
+</object>
+ +

</interface>

+ +
+ + + + + diff --git a/doc/Sauvegarde.html b/doc/Sauvegarde.html new file mode 100644 index 00000000..50bff81d --- /dev/null +++ b/doc/Sauvegarde.html @@ -0,0 +1,329 @@ + + + + + + +class Sauvegarde - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Sauvegarde +

+ +
+ +

Cette classe est responsable de la sauvegarde Elle gère celle du classement et également de la grille

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ charge(grille, nomniv,dif) + click to toggle source +
+ +
+

Chargement d'une sauvegarde

+
  • +

    grille la grille du niveau pour l'initialiser avec le contenu du fichier

    +
  • +

    nomniv le nom du niveau pour savoir quel fichier charger

    +
  • +

    dif la difficulté du niveau pour savoir ou charger le fichier

    +
+ +
+
# File Sauvegarde.rb, line 77
+def Sauvegarde.charge(grille, nomniv,dif)
+    titre = nomniv.match(/[^\/]*.txt/)
+    #sauvegarde devient un tableau
+    saveTab = File.readlines("./Sauvegarde/#{dif}/save#{titre}").map { |str| str.split(":") }
+    
+    for x in 0..(grille.lignes-1)
+        for y in 0..(grille.colonnes-1)
+            noeud = grille.get_child_at(y,x)
+            if ( noeud.status == 'i')
+                if(noeud.eastNode != nil)
+                    if (saveTab[x][y+1] == '-')
+                        grille.ajoutPont(noeud, noeud.eastNode)
+                    elsif (saveTab[x][y+1] == '=')
+                        grille.ajoutPont(noeud, noeud.eastNode)
+                        grille.ajoutPont(noeud, noeud.eastNode)
+                    end
+                end
+                if(noeud.southNode != nil)
+                    if (saveTab[x+1][y] == "I")
+                        grille.ajoutPont(noeud, noeud.southNode)
+                    elsif (saveTab[x+1][y] == 'H')
+                        grille.ajoutPont(noeud, noeud.southNode)
+                        grille.ajoutPont(noeud, noeud.southNode)
+                    end
+                end
+            end
+        end
+    end
+    return saveTab[grille.lignes][0].to_i
+end
+
+
+ + +
+ +
+
+ new(nomniv,dif) + click to toggle source +
+ +
+

Création d'une sauvegarde

+
  • +

    nomniv le nom du niveau pour enregistrer le fichier de sauvegarde

    +
  • +

    dif la difficulté du niveau pour savoir ou sauvegarder le fichier

    +
+ +
+
# File Sauvegarde.rb, line 17
+def initialize(nomniv,dif)
+    @nomniv=nomniv
+    @dif=dif
+    titre = nomniv.match(/[^\/]*.txt/)
+    @path = "./Sauvegarde/#{dif}/save#{titre}"
+end
+
+
+ + +
+ +
+
+ saveDelete(nomniv, dif) + click to toggle source +
+ +
+

Methode supprimant un fichier de sauvegarde, appelé lorsque le joueur termine le niveau

+
  • +

    nomniv le nom du niveau pour savoir comment appeler le fichier

    +
  • +

    dif la difficulté du niveau pour savoir ou charger le fichier

    +
+ +
+
# File Sauvegarde.rb, line 111
+def Sauvegarde.saveDelete(nomniv, dif)
+    titre = nomniv.match(/[^\/]*.txt/)
+    f = File.open("./Sauvegarde/#{dif}/save#{titre}", 'r')
+
+    File.delete(f)
+
+    return self
+end
+
+
+ + +
+ +
+
+ saveTime(nomGrille,difficulte,chrono, nom) + click to toggle source +
+ +
+

Sauvegarde des informations du joueur pour le classement

+
  • +

    nomGrille le nom du niveau pour savoir comment appeler le fichier

    +
  • +

    difficulte la difficulté du niveau pour savoir ou sauvegarder le fichier

    +
  • +

    chrono le chrono de l'utilisateur

    +
  • +

    nom le nom de l'utilisateur

    +
+ +
+
# File Sauvegarde.rb, line 64
+def Sauvegarde.saveTime(nomGrille,difficulte,chrono, nom)
+    titre = nomGrille.match(/[^\/]*.txt/)
+    file = File.open("./Classement/#{difficulte}/#{titre}", 'a')
+    file.write("#{chrono}:#{nom}\n")
+    file.close
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ sauvegarder(grille) + click to toggle source +
+ +
+

Sauvegarde de l'etat de la grille

+
  • +

    grille la grille a sauvegarder

    +
+ +
+
# File Sauvegarde.rb, line 26
+def sauvegarder(grille)
+
+    f=File.open(@path, 'w')
+    
+    for x in 0..(grille.colonnes-1)
+        for y in 0..(grille.lignes-1)
+            noeud = grille.get_child_at(y,x)
+            if (noeud.status == "i")
+                f.write(noeud.degreeMax)
+            elsif (noeud.status == "p")
+                if (noeud.typePont == 1 && noeud.directionPont == 1)
+                    f.write("-")
+                elsif (noeud.typePont == 1 && noeud.directionPont == 2)
+                    f.write("I")
+                elsif (noeud.typePont == 2 && noeud.directionPont == 1)
+                    f.write("=")
+                elsif(noeud.typePont == 2 && noeud.directionPont == 2)
+                    f.write("H")
+                else
+                    f.write("0")
+                end
+            end
+            f.write(":")
+            
+        end
+        f.write("\n")
+    end
+    f.write($tempssec)
+    f.close
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/Sauvegarde/Facile/test_txt.html b/doc/Sauvegarde/Facile/test_txt.html new file mode 100644 index 00000000..b399f1b9 --- /dev/null +++ b/doc/Sauvegarde/Facile/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/Sauvegarde/Hard/test_txt.html b/doc/Sauvegarde/Hard/test_txt.html new file mode 100644 index 00000000..07f46f20 --- /dev/null +++ b/doc/Sauvegarde/Hard/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/Sauvegarde/Moyen/test_txt.html b/doc/Sauvegarde/Moyen/test_txt.html new file mode 100644 index 00000000..8c0f15b7 --- /dev/null +++ b/doc/Sauvegarde/Moyen/test_txt.html @@ -0,0 +1,126 @@ + + + + + + +test - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

Pour faire apparaitre le dossier dans git

+ +
+ + + + + diff --git a/doc/Tuto.html b/doc/Tuto.html new file mode 100644 index 00000000..d81970e2 --- /dev/null +++ b/doc/Tuto.html @@ -0,0 +1,202 @@ + + + + + + +class Tuto - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class Tuto +

+ +
+ +

Cette classe représente le menu Tutoriel

+ +
+ +
+ + + + + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur du menu tutoriel

+ +
+
# File Tuto.rb, line 17
+        def initialize
+                
+                main_window_res = "./Ressources/Glade/tutoriel.glade"
+        builder = Gtk::Builder.new
+        builder.add_from_file(main_window_res)
+
+        @tutoriel = builder.get_object('tutoriel')
+                @tutoriel.set_title "Tutoriel"
+        @tutoriel.signal_connect "destroy" do 
+                        @tutoriel.destroy
+            Gtk.main_quit 
+        end
+                
+        @tutoriel.set_window_position Gtk::WindowPosition::CENTER
+        css_file = Gtk::CssProvider.new
+        css_file.load(data: <<-CSS)
+             @import url("css/tuto.css");
+                CSS
+
+                @box_tuto = builder.get_object('box_principale')
+        
+
+                # Creation et ajouts des boutons <- et -> du Tutoriel  #
+                @btnGauche =  builder.get_object('btnGauche')
+                @btnDroite =  builder.get_object('btnDroite')
+
+                
+                #--------------------------------------------#
+                # Creation du bouton quitter du Tutoriel  #
+                btnQuitter = builder.get_object('home')
+                btnQuitter.signal_connect('clicked') {
+                        @tutoriel.destroy
+                        MainMenu.new 
+                        Gtk.main
+                }
+
+                #--------------------------------------------#
+                # Lien entre le fichier css et les différents composants
+
+                @box_tuto.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+                @box_tuto.style_context.add_class('tuto_1')
+                @btnDroite.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+                btnQuitter.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+                @btnGauche.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+                @tutoriel.style_context.add_provider(css_file, Gtk::StyleProvider::PRIORITY_USER)
+
+                j = 0
+                @box_tuto.show_all
+                
+                @img_tuto = builder.get_object('img_tuto')
+                @img_tuto.from_file = "./Ressources/Tuto/tuto_1.png"
+                
+                @btnGauche.signal_connect('clicked') do
+                        if $id > 1  && $id<=10
+                                $id-=1
+                                @img_tuto.from_file = "./Ressources/Tuto/tuto_"+$id.to_s+".png"
+                        end
+                end
+
+                @btnDroite.signal_connect('clicked') do
+                        if $id>=1 && $id<10
+                                $id+=1
+                                @img_tuto.from_file = "./Ressources/Tuto/tuto_"+$id.to_s+".png"
+                        end
+                end
+
+                @tutoriel.show
+
+        end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/UndoRedo.html b/doc/UndoRedo.html new file mode 100644 index 00000000..f5001ca8 --- /dev/null +++ b/doc/UndoRedo.html @@ -0,0 +1,265 @@ + + + + + + +class UndoRedo - RDoc Documentation + + + + + + + + + + + + + + + + +
+

+ class UndoRedo +

+ +
+ +

Cette classe implémente les fonctionnalités Undo / Redo

+ +
+ +
+ + + +
+
+

Attributes

+
+ +
+
+ redoStack[RW] +
+ +
+

Pile contenant les action à replacer tant que l'utilisateur n'effectue pas une autre action que le Redo

+
+
+
+
+ undoStack[RW] +
+ +
+

Pile contenant les action à enlever

+
+
+
+ + +
+
+

Public Class Methods

+
+ +
+
+ new() + click to toggle source +
+ +
+

Constructeur de la classe UndoRedo Initialise les deux tableaux

+ +
+
# File UndoRedo.rb, line 26
+def initialize
+    @undoStack = Array.[]
+    @redoStack = Array.[]
+end
+
+
+ + +
+ +
+ +
+
+

Public Instance Methods

+
+ +
+
+ cleanAll() + click to toggle source +
+ +
+

Cette méthode est responsable de nettoyer la pile undo et redo

+ +
+
# File UndoRedo.rb, line 17
+def cleanAll
+    @undoStack.clear
+    @redoStack.clear
+
+    return self
+end
+
+
+ + +
+ +
+
+ saveUserClick(action) + click to toggle source +
+ +
+

Sauvegarde le clic de l'utilisateur

+ +
+
# File UndoRedo.rb, line 32
+def saveUserClick(action)
+    @undoStack << action
+
+    return self
+end
+
+
+ + +
+ +
+
+ undoEmpty?() + click to toggle source +
+ +
+

Retourne true si la pile est vide Sinon false

+ +
+
# File UndoRedo.rb, line 47
+def undoEmpty?
+    return @undoStack.empty? 
+end
+
+
+ + +
+ +
+
+ undoUserAction(action) + click to toggle source +
+ +
+

Supprime et renvoi la dernière action utilisateur

+ +
+
# File UndoRedo.rb, line 39
+def undoUserAction(action)
+    @undoStack.pop!()
+
+    return self
+end
+
+
+ + +
+ +
+ +
+
+ + + + diff --git a/doc/created.rid b/doc/created.rid new file mode 100644 index 00000000..d5f40563 --- /dev/null +++ b/doc/created.rid @@ -0,0 +1,138 @@ +Mon, 19 Apr 2021 10:53:22 +0200 +Aide.rb Mon, 19 Apr 2021 10:52:43 +0200 +AideTexte.txt Mon, 19 Apr 2021 10:52:24 +0200 +APropos.rb Mon, 19 Apr 2021 10:52:43 +0200 +BoutonChoix.rb Mon, 19 Apr 2021 10:52:43 +0200 +Classement/Difficile/test.txt Sun, 18 Apr 2021 09:21:04 +0200 +Classement/Facile/test.txt Wed, 07 Apr 2021 15:42:37 +0200 +Classement/Moyen/test.txt Wed, 07 Apr 2021 15:42:37 +0200 +Classement.rb Mon, 19 Apr 2021 10:52:24 +0200 +ClassementNiveau.rb Mon, 19 Apr 2021 10:52:24 +0200 +Client.rb Mon, 19 Apr 2021 10:52:24 +0200 +css/classement.png Sun, 18 Apr 2021 09:21:07 +0200 +css/dark_mode.css Sun, 18 Apr 2021 09:21:07 +0200 +css/logo-selection.png Sun, 18 Apr 2021 09:21:07 +0200 +css/menu_pause.css Sun, 18 Apr 2021 09:21:07 +0200 +css/plateau_style.css Sun, 18 Apr 2021 09:21:07 +0200 +css/style.css Sun, 18 Apr 2021 09:21:07 +0200 +css/tuto.css Sun, 18 Apr 2021 09:21:07 +0200 +HashiGrid.rb Mon, 19 Apr 2021 10:52:43 +0200 +Hypothese.rb Mon, 19 Apr 2021 10:52:43 +0200 +Ile.rb Mon, 19 Apr 2021 10:52:43 +0200 +ListeNiveau/Difficile/10x10.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/10x10_2.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/10x7.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/12x12.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/15x5.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/7x7.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Difficile/8x8.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/10x10.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/10x7.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/12x12.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/12x12_1.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/15x5.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/7x7_1.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/7x7_2.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Facile/7x7_3.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/10x10.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/10x10_2.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/10x7.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/12x12.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/15x5.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/7x7.txt Sun, 18 Apr 2021 09:21:04 +0200 +ListeNiveau/Moyen/8x8.txt Sun, 18 Apr 2021 09:21:04 +0200 +MainMenu.rb Sun, 18 Apr 2021 09:21:04 +0200 +MenuLayout.rb Mon, 19 Apr 2021 10:52:24 +0200 +MenuSelection.rb Mon, 19 Apr 2021 10:52:43 +0200 +Pause.rb Mon, 19 Apr 2021 10:52:24 +0200 +Plateau.rb Mon, 19 Apr 2021 10:52:43 +0200 +Pont.rb Mon, 19 Apr 2021 10:52:43 +0200 +README.md Fri, 26 Mar 2021 14:04:34 +0100 +Ressources/Glade/hypo.glade Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/Glade/menu_chargement.glade Sun, 18 Apr 2021 09:21:06 +0200 +Ressources/Glade/menu_pause.glade Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/Glade/menu_principal.glade Sun, 18 Apr 2021 09:21:06 +0200 +Ressources/Glade/menu_selection.glade Sun, 18 Apr 2021 09:21:06 +0200 +Ressources/Glade/menu_win.glade Sun, 18 Apr 2021 09:21:06 +0200 +Ressources/Glade/plateau.glade Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Glade/tutoriel.glade Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/0.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/1.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/1_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/1_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/1_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/2.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/2_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/2_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/2_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/3.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/3_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/3_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/3_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/4.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/4_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/4_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/4_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/5.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/5_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/5_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/5_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/6.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/6_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/6_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/6_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/7.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/7_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/7_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/7_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/8.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/8_r.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/8_s.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Ile/8_v.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/logo-principal.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/MenuSelection/back.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/MenuSelection/btnfacile.PNG Fri, 26 Mar 2021 14:04:49 +0100 +Ressources/MenuSelection/btn_grille.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/MenuSelection/difficile.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/facile.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/menu_selection.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/MenuSelection/moyen.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/back.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/btnfacile.PNG Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/btn_grille.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/difficile.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/facile.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/menu_selection.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/MenuSelection/Nouveau dossier/moyen.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/menu_back.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/aide.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/annuler.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/hypothese.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/pause.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/plateau - Copie.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/plateau.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/redo.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/undo.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Plateau/valider.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Pont/0.png Fri, 26 Mar 2021 14:04:49 +0100 +Ressources/Pont/h_double.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Pont/h_simple.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Pont/v_double.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Pont/v_simple.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_1.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/Tuto/tuto_10.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_2.png Mon, 19 Apr 2021 10:52:24 +0200 +Ressources/Tuto/tuto_3.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_4.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_5.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_6.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_7.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_8.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/Tuto/tuto_9.png Sun, 18 Apr 2021 09:21:07 +0200 +Ressources/victoire.png Sun, 18 Apr 2021 09:21:07 +0200 +Sauvegarde/Facile/test.txt Wed, 07 Apr 2021 15:42:41 +0200 +Sauvegarde/Hard/test.txt Mon, 19 Apr 2021 10:52:24 +0200 +Sauvegarde/Moyen/test.txt Wed, 07 Apr 2021 15:42:41 +0200 +Sauvegarde.rb Mon, 19 Apr 2021 10:52:43 +0200 +Tuto.rb Mon, 19 Apr 2021 10:52:24 +0200 +UndoRedo.rb Mon, 19 Apr 2021 10:52:43 +0200 diff --git a/doc/css/dark_mode_css.html b/doc/css/dark_mode_css.html new file mode 100644 index 00000000..7ae43819 --- /dev/null +++ b/doc/css/dark_mode_css.html @@ -0,0 +1,152 @@ + + + + + + +dark_mode.css - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

window{

+ +
background-color:rgb(49,49,49);
+ +

}

+ +

button {

+ +
background-color: rgb(34,34,34);
+border-color: rgb(34,34,34);
+font-size: 18px;
+ +

}

+ +

button:hover {

+ +
background-color: rgb(22,22,22);
+border-color: rgb(22,22,22);
+box-shadow: 0px 0px 5px 0.8px rgb(22,22,22);
+ +

}

+ +

label {

+ +
color: #FFFFFF;
+ +

}

+ +
+ + + + + diff --git a/doc/css/fonts.css b/doc/css/fonts.css new file mode 100644 index 00000000..57302b51 --- /dev/null +++ b/doc/css/fonts.css @@ -0,0 +1,167 @@ +/* + * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + * with Reserved Font Name "Source". All Rights Reserved. Source is a + * trademark of Adobe Systems Incorporated in the United States and/or other + * countries. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 400; + src: local("Source Code Pro"), + local("SourceCodePro-Regular"), + url("../fonts/SourceCodePro-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Source Code Pro"; + font-style: normal; + font-weight: 700; + src: local("Source Code Pro Bold"), + local("SourceCodePro-Bold"), + url("../fonts/SourceCodePro-Bold.ttf") format("truetype"); +} + +/* + * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com), + * with Reserved Font Name Lato. + * + * This Font Software is licensed under the SIL Open Font License, Version + * 1.1. + * + * This license is copied below, and is also available with a FAQ at: + * http://scripts.sil.org/OFL + */ + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 300; + src: local("Lato Light"), + local("Lato-Light"), + url("../fonts/Lato-Light.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 300; + src: local("Lato Light Italic"), + local("Lato-LightItalic"), + url("../fonts/Lato-LightItalic.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: normal; + font-weight: 700; + src: local("Lato Regular"), + local("Lato-Regular"), + url("../fonts/Lato-Regular.ttf") format("truetype"); +} + +@font-face { + font-family: "Lato"; + font-style: italic; + font-weight: 700; + src: local("Lato Italic"), + local("Lato-Italic"), + url("../fonts/Lato-RegularItalic.ttf") format("truetype"); +} + +/* + * ----------------------------------------------------------- + * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 + * ----------------------------------------------------------- + * + * PREAMBLE + * The goals of the Open Font License (OFL) are to stimulate worldwide + * development of collaborative font projects, to support the font creation + * efforts of academic and linguistic communities, and to provide a free and + * open framework in which fonts may be shared and improved in partnership + * with others. + * + * The OFL allows the licensed fonts to be used, studied, modified and + * redistributed freely as long as they are not sold by themselves. The + * fonts, including any derivative works, can be bundled, embedded, + * redistributed and/or sold with any software provided that any reserved + * names are not used by derivative works. The fonts and derivatives, + * however, cannot be released under any other type of license. The + * requirement for fonts to remain under this license does not apply + * to any document created using the fonts or their derivatives. + * + * DEFINITIONS + * "Font Software" refers to the set of files released by the Copyright + * Holder(s) under this license and clearly marked as such. This may + * include source files, build scripts and documentation. + * + * "Reserved Font Name" refers to any names specified as such after the + * copyright statement(s). + * + * "Original Version" refers to the collection of Font Software components as + * distributed by the Copyright Holder(s). + * + * "Modified Version" refers to any derivative made by adding to, deleting, + * or substituting -- in part or in whole -- any of the components of the + * Original Version, by changing formats or by porting the Font Software to a + * new environment. + * + * "Author" refers to any designer, engineer, programmer, technical + * writer or other person who contributed to the Font Software. + * + * PERMISSION & CONDITIONS + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Font Software, to use, study, copy, merge, embed, modify, + * redistribute, and sell modified and unmodified copies of the Font + * Software, subject to the following conditions: + * + * 1) Neither the Font Software nor any of its individual components, + * in Original or Modified Versions, may be sold by itself. + * + * 2) Original or Modified Versions of the Font Software may be bundled, + * redistributed and/or sold with any software, provided that each copy + * contains the above copyright notice and this license. These can be + * included either as stand-alone text files, human-readable headers or + * in the appropriate machine-readable metadata fields within text or + * binary files as long as those fields can be easily viewed by the user. + * + * 3) No Modified Version of the Font Software may use the Reserved Font + * Name(s) unless explicit written permission is granted by the corresponding + * Copyright Holder. This restriction only applies to the primary font name as + * presented to the users. + * + * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font + * Software shall not be used to promote, endorse or advertise any + * Modified Version, except to acknowledge the contribution(s) of the + * Copyright Holder(s) and the Author(s) or with their explicit written + * permission. + * + * 5) The Font Software, modified or unmodified, in part or in whole, + * must be distributed entirely under this license, and must not be + * distributed under any other license. The requirement for fonts to + * remain under this license does not apply to any document created + * using the Font Software. + * + * TERMINATION + * This license becomes null and void if any of the above conditions are + * not met. + * + * DISCLAIMER + * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL + * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM + * OTHER DEALINGS IN THE FONT SOFTWARE. + */ + diff --git a/doc/css/menu_pause_css.html b/doc/css/menu_pause_css.html new file mode 100644 index 00000000..99bc2805 --- /dev/null +++ b/doc/css/menu_pause_css.html @@ -0,0 +1,152 @@ + + + + + + +menu_pause.css - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

.menu{

+ +
all:unset;
+background-color: #020547;
+border-radius: 5px;
+ +

}

+ +

.btn-select {

+ +
all:unset;
+background-color: #F8DDD7;
+padding:10px 50px;
+font-family: "Toledo";
+border-radius: 5px;
+color: #CD4648;
+font-size: 22px;
+ +

}

+ +

.btn-select:hover {

+ +
background-color: #CD4648;
+color: white;
+transition: all .3s ease;
+ +

}

+ +
+ + + + + diff --git a/doc/css/plateau_style_css.html b/doc/css/plateau_style_css.html new file mode 100644 index 00000000..87362744 --- /dev/null +++ b/doc/css/plateau_style_css.html @@ -0,0 +1,194 @@ + + + + + + +plateau_style.css - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

.bg-black {

+ +
background-image: url('../Ressources/Plateau/plateau.png');
+background-size: cover;
+background-repeat: no-repeat;
+ +

}

+ +

.bg-hypo {

+ +
background-color: #F8DDD7;
+ +

}

+ +

.boxJeu {

+ +
 all:unset;
+/* background-color: rgba(255, 255, 255, 0.1); 
+ border-radius: 5px; */
+ +

}

+ +

.help {

+ +
background-image: url("../Ressources/Plateau/pause.png");
+ +

}

+ +

.ile {

+ +
all:unset;
+border:.2px solid #9c5503;
+/* background-color: #5B3512; */
+border-radius: 5px;
+ +

}

+ +

.label_aide {

+ +
color: #020547;
+font-size: 18.7px;
+font-weight: bold;
+font-family: 'Toledo';
+ +

}

+ +

.ile:hover {

+ +
  background-color:#FFFDA9;
+}
+ +

.possibles {

+ +
background-color: rgba(136, 207, 255, .3);
+ +

}

+ +

.btn-menu{

+ +
all: unset;
+ +

}

+ +

.btn-menu:hover {

+ +
all:unset;
+opacity: .6;
+ +

}

+ +
+ + + + + diff --git a/doc/css/rdoc.css b/doc/css/rdoc.css new file mode 100644 index 00000000..35aff77f --- /dev/null +++ b/doc/css/rdoc.css @@ -0,0 +1,619 @@ +/* + * "Darkfish" Rdoc CSS + * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* vim: ft=css et sw=2 ts=2 sts=2 */ +/* Base Green is: #6C8C22 */ + +.hide { display: none !important; } + +* { padding: 0; margin: 0; } + +body { + background: #fafafa; + font-family: Lato, sans-serif; + font-weight: 300; +} + +h1 span, +h2 span, +h3 span, +h4 span, +h5 span, +h6 span { + position: relative; + + display: none; + padding-left: 1em; + line-height: 0; + vertical-align: baseline; + font-size: 10px; +} + +h1 span { top: -1.3em; } +h2 span { top: -1.2em; } +h3 span { top: -1.0em; } +h4 span { top: -0.8em; } +h5 span { top: -0.5em; } +h6 span { top: -0.5em; } + +h1:hover span, +h2:hover span, +h3:hover span, +h4:hover span, +h5:hover span, +h6:hover span { + display: inline; +} + +h1:target, +h2:target, +h3:target, +h4:target, +h5:target, +h6:target { + margin-left: -10px; + border-left: 10px solid #f1edba; +} + +:link, +:visited { + color: #6C8C22; + text-decoration: none; +} + +:link:hover, +:visited:hover { + border-bottom: 1px dotted #6C8C22; +} + +code, +pre { + font-family: "Source Code Pro", Monaco, monospace; + background-color: rgba(27,31,35,0.05); + padding: 0em 0.2em; + border-radius: 0.2em; +} + +/* @group Generic Classes */ + +.initially-hidden { + display: none; +} + +#search-field { + width: 98%; + background: white; + border: none; + height: 1.5em; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + text-align: left; +} +#search-field:focus { + background: #f1edba; +} +#search-field:-moz-placeholder, +#search-field::-webkit-input-placeholder { + font-weight: bold; + color: #666; +} + +.missing-docs { + font-size: 120%; + background: white url(../images/wrench_orange.png) no-repeat 4px center; + color: #ccc; + line-height: 2em; + border: 1px solid #d00; + opacity: 1; + padding-left: 20px; + text-indent: 24px; + letter-spacing: 3px; + font-weight: bold; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +.target-section { + border: 2px solid #dcce90; + border-left-width: 8px; + padding: 0 1em; + background: #fff3c2; +} + +/* @end */ + +/* @group Index Page, Standalone file pages */ +.table-of-contents ul { + margin: 1em; + list-style: none; +} + +.table-of-contents ul ul { + margin-top: 0.25em; +} + +.table-of-contents ul :link, +.table-of-contents ul :visited { + font-size: 16px; +} + +.table-of-contents li { + margin-bottom: 0.25em; +} + +.table-of-contents li .toc-toggle { + width: 16px; + height: 16px; + background: url(../images/add.png) no-repeat; +} + +.table-of-contents li .toc-toggle.open { + background: url(../images/delete.png) no-repeat; +} + +/* @end */ + +/* @group Top-Level Structure */ + +nav { + float: left; + width: 260px; + font-family: Helvetica, sans-serif; + font-size: 14px; +} + +main { + display: block; + margin: 0 2em 5em 260px; + padding-left: 20px; + min-width: 340px; + font-size: 16px; +} + +main h1, +main h2, +main h3, +main h4, +main h5, +main h6 { + font-family: Helvetica, sans-serif; +} + +.table-of-contents main { + margin-left: 2em; +} + +#validator-badges { + clear: both; + margin: 1em 1em 2em; + font-size: smaller; +} + +/* @end */ + +/* @group navigation */ +nav { + margin-bottom: 1em; +} + +nav .nav-section { + margin-top: 2em; + border-top: 2px solid #aaa; + font-size: 90%; + overflow: hidden; +} + +nav h2 { + margin: 0; + padding: 2px 8px 2px 8px; + background-color: #e8e8e8; + color: #555; + font-size: 125%; + text-align: center; +} + +nav h3, +#table-of-contents-navigation { + margin: 0; + padding: 2px 8px 2px 8px; + text-align: right; + background-color: #e8e8e8; + color: #555; +} + +nav ul, +nav dl, +nav p { + padding: 4px 8px 0; + list-style: none; +} + +#project-navigation .nav-section { + margin: 0; + border-top: 0; +} + +#home-section h2 { + text-align: center; +} + +#table-of-contents-navigation { + font-size: 1.2em; + font-weight: bold; + text-align: center; +} + +#search-section { + margin-top: 0; + border-top: 0; +} + +#search-field-wrapper { + border-top: 1px solid #aaa; + border-bottom: 1px solid #aaa; + padding: 3px 8px; + background-color: #e8e8e8; + color: #555; +} + +ul.link-list li { + white-space: nowrap; + line-height: 1.4em; +} + +ul.link-list .type { + font-size: 8px; + text-transform: uppercase; + color: white; + background: #969696; + padding: 2px 4px; + -webkit-border-radius: 5px; +} + +dl.note-list dt { + float: left; + margin-right: 1em; +} + +.calls-super { + background: url(../images/arrow_up.png) no-repeat right center; +} + +/* @end */ + +/* @group Documentation Section */ +main { + color: #333; +} + +main > h1:first-child, +main > h2:first-child, +main > h3:first-child, +main > h4:first-child, +main > h5:first-child, +main > h6:first-child { + margin-top: 0px; +} + +main sup { + vertical-align: super; + font-size: 0.8em; +} + +/* The heading with the class name */ +main h1[class] { + margin-top: 0; + margin-bottom: 1em; + font-size: 2em; + color: #6C8C22; +} + +main h1 { + margin: 2em 0 0.5em; + font-size: 1.7em; +} + +main h2 { + margin: 2em 0 0.5em; + font-size: 1.5em; +} + +main h3 { + margin: 2em 0 0.5em; + font-size: 1.2em; +} + +main h4 { + margin: 2em 0 0.5em; + font-size: 1.1em; +} + +main h5 { + margin: 2em 0 0.5em; + font-size: 1em; +} + +main h6 { + margin: 2em 0 0.5em; + font-size: 1em; +} + +main p { + margin: 0 0 0.5em; + line-height: 1.4em; +} + +main pre { + margin: 1.2em 0.5em; + padding: 1em; + font-size: 0.8em; +} + +main hr { + margin: 1.5em 1em; + border: 2px solid #ddd; +} + +main blockquote { + margin: 0 2em 1.2em 1.2em; + padding-left: 0.5em; + border-left: 2px solid #ddd; +} + +main ol, +main ul { + margin: 1em 2em; +} + +main li > p { + margin-bottom: 0.5em; +} + +main dl { + margin: 1em 0.5em; +} + +main dt { + margin-bottom: 0.5em; + font-weight: bold; +} + +main dd { + margin: 0 1em 1em 0.5em; +} + +main header h2 { + margin-top: 2em; + border-width: 0; + border-top: 4px solid #bbb; + font-size: 130%; +} + +main header h3 { + margin: 2em 0 1.5em; + border-width: 0; + border-top: 3px solid #bbb; + font-size: 120%; +} + +.documentation-section-title { + position: relative; +} +.documentation-section-title .section-click-top { + position: absolute; + top: 6px; + left: 12px; + font-size: 10px; + color: #9b9877; + visibility: hidden; + padding-left: 0.5px; +} + +.documentation-section-title:hover .section-click-top { + visibility: visible; +} + +.constants-list > dl { + margin: 1em 0 2em; + border: 0; +} + +.constants-list > dl dt { + margin-bottom: 0.75em; + padding-left: 0; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; +} + +.constants-list > dl dt a { + color: inherit; +} + +.constants-list > dl dd { + margin: 0 0 2em 0; + padding: 0; + color: #666; +} + +.documentation-section h2 { + position: relative; +} + +.documentation-section h2 a { + position: absolute; + top: 8px; + right: 10px; + font-size: 12px; + color: #9b9877; + visibility: hidden; +} + +.documentation-section h2:hover a { + visibility: visible; +} + +/* @group Method Details */ + +main .method-source-code { + max-height: 0; + overflow: hidden; + transition-duration: 200ms; + transition-delay: 0ms; + transition-property: all; + transition-timing-function: ease-in-out; +} + +main .method-source-code.active-menu { + max-height: 100vh; +} + +main .method-description .method-calls-super { + color: #333; + font-weight: bold; +} + +main .method-detail { + margin-bottom: 2.5em; + cursor: pointer; +} + +main .method-detail:target { + margin-left: -10px; + border-left: 10px solid #f1edba; +} + +main .method-heading { + position: relative; + font-family: "Source Code Pro", Monaco, monospace; + font-size: 110%; + font-weight: bold; + color: #333; +} +main .method-heading :link, +main .method-heading :visited { + color: inherit; +} +main .method-click-advice { + position: absolute; + top: 2px; + right: 5px; + font-size: 12px; + color: #9b9877; + visibility: hidden; + padding-right: 20px; + line-height: 20px; + background: url(../images/zoom.png) no-repeat right top; +} +main .method-heading:hover .method-click-advice { + visibility: visible; +} + +main .method-alias .method-heading { + color: #666; +} + +main .method-description, +main .aliases { + margin-top: 0.75em; + color: #333; +} + +main .aliases { + padding-top: 4px; + font-style: italic; + cursor: default; +} +main .method-description ul { + margin-left: 1.5em; +} + +main #attribute-method-details .method-detail:hover { + background-color: transparent; + cursor: default; +} +main .attribute-access-type { + text-transform: uppercase; + padding: 0 1em; +} +/* @end */ + +/* @end */ + +/* @group Source Code */ + +pre { + margin: 0.5em 0; + border: 1px dashed #999; + padding: 0.5em; + background: #262626; + color: white; + overflow: auto; +} + +.ruby-constant { color: #7fffd4; background: transparent; } +.ruby-keyword { color: #00ffff; background: transparent; } +.ruby-ivar { color: #eedd82; background: transparent; } +.ruby-operator { color: #00ffee; background: transparent; } +.ruby-identifier { color: #ffdead; background: transparent; } +.ruby-node { color: #ffa07a; background: transparent; } +.ruby-comment { color: #dc0000; background: transparent; } +.ruby-regexp { color: #ffa07a; background: transparent; } +.ruby-value { color: #7fffd4; background: transparent; } + +/* @end */ + + +/* @group search results */ +#search-results { + font-family: Lato, sans-serif; + font-weight: 300; +} + +#search-results .search-match { + font-family: Helvetica, sans-serif; + font-weight: normal; +} + +#search-results .search-selected { + background: #e8e8e8; + border-bottom: 1px solid transparent; +} + +#search-results li { + list-style: none; + border-bottom: 1px solid #aaa; + margin-bottom: 0.5em; +} + +#search-results li:last-child { + border-bottom: none; + margin-bottom: 0; +} + +#search-results li p { + padding: 0; + margin: 0.5em; +} + +#search-results .search-namespace { + font-weight: bold; +} + +#search-results li em { + background: yellow; + font-style: normal; +} + +#search-results pre { + margin: 0.5em; + font-family: "Source Code Pro", Monaco, monospace; +} + +/* @end */ + diff --git a/doc/css/style_css.html b/doc/css/style_css.html new file mode 100644 index 00000000..f22efb53 --- /dev/null +++ b/doc/css/style_css.html @@ -0,0 +1,250 @@ + + + + + + +style.css - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

button {

+ +
all:unset;
+background-color: #CD4648;
+padding-right:20px;
+font-family: "Toledo";
+border-radius: 5px;
+color: #FFFFFF;
+font-size: 22px;
+ +

}

+ +

.bg-menu {

+ +
background-image: url('../Ressources/menu_back.png');
+background-size: cover;
+background-repeat: no-repeat;
+ +

}

+ +

.bg-selection {

+ +
background-image: url('../Ressources/MenuSelection/menu_selection.png');
+ +

background-size: cover; background-repeat: no-repeat;

+ +

}

+ +

.listbox {

+ +
all:unset;
+
+ +

}

+ +

.help {

+ +
background-image: url("../Ressources/Plateau/pause.png");
+ +

}

+ +

.btn_niveau{

+ +
padding: 10px;
+background-color: white;
+ +

}

+ +

.btn_niveau:hover {

+ +
background-color: #9EDDFF;
+ +

}

+ +

.back {

+ +
all:unset;
+
+ +

}

+ +

.btn-blue {

+ +
all:unset;
+border-radius: 5px;
+background-color: #020547;      
+font-family: "Toledo";
+color: #FFFFFF;
+font-size: 22px;
+ +

}

+ +

box {

+ +
all:unset;
+
+ +

}

+ +

.btn-help {

+ +
all:unset;
+
+ +

} .menu{

+ +
all:unset;
+background-color: #020547;
+border-radius: 5px;
+ +

}

+ +

.menu-ext {

+ +
background-color: #F8DDD7;
+ +

}

+ +

main_window{

+ +
background-color: #051531;
+ +

}

+ +

.btn-select {

+ +
all:unset;
+background-color: #F8DDD7;
+padding:10px 50px;
+font-family: "Toledo";
+border-radius: 5px;
+color: #CD4648;
+font-size: 22px;
+ +

} .btn-select:hover {

+ +
background-color: #CD4648;
+color: white;
+transition: all .3s ease;
+ +

}

+ +
.btn:hover {
+        background-color: #051531;
+}
+ +
+ + + + + diff --git a/doc/css/tuto_css.html b/doc/css/tuto_css.html new file mode 100644 index 00000000..c2bb130f --- /dev/null +++ b/doc/css/tuto_css.html @@ -0,0 +1,161 @@ + + + + + + +tuto.css - RDoc Documentation + + + + + + + + + + + + + + + + +
+ +

.bg-tuto {

+ +
all: unset;   
+background-image: url("../Ressources/Tuto/bg_tuto.svg");
+background-size: cover;
+background-color: #F8DDD7;
+background-repeat: no-repeat;
+ +

}

+ +

.btnDroite {

+ +
background-image: url("../Ressources/Tuto/droite.svg");
+background-repeat: no-repeat;
+ +

}

+ +

.btnGauche {

+ +
background-image: url("../Ressources/Tuto/gauche.svg");
+background-repeat: no-repeat;
+ +

}

+ +

button{

+ +
all:unset;
+
+ +

}

+ +

button:hover {

+ +
opacity: .7;
+ +

}

+ +
+ + + + + diff --git a/doc/fonts/Lato-Light.ttf b/doc/fonts/Lato-Light.ttf new file mode 100644 index 00000000..b49dd437 Binary files /dev/null and b/doc/fonts/Lato-Light.ttf differ diff --git a/doc/fonts/Lato-LightItalic.ttf b/doc/fonts/Lato-LightItalic.ttf new file mode 100644 index 00000000..7959fef0 Binary files /dev/null and b/doc/fonts/Lato-LightItalic.ttf differ diff --git a/doc/fonts/Lato-Regular.ttf b/doc/fonts/Lato-Regular.ttf new file mode 100644 index 00000000..839cd589 Binary files /dev/null and b/doc/fonts/Lato-Regular.ttf differ diff --git a/doc/fonts/Lato-RegularItalic.ttf b/doc/fonts/Lato-RegularItalic.ttf new file mode 100644 index 00000000..bababa09 Binary files /dev/null and b/doc/fonts/Lato-RegularItalic.ttf differ diff --git a/doc/fonts/SourceCodePro-Bold.ttf b/doc/fonts/SourceCodePro-Bold.ttf new file mode 100644 index 00000000..61e3090c Binary files /dev/null and b/doc/fonts/SourceCodePro-Bold.ttf differ diff --git a/doc/fonts/SourceCodePro-Regular.ttf b/doc/fonts/SourceCodePro-Regular.ttf new file mode 100644 index 00000000..85686d96 Binary files /dev/null and b/doc/fonts/SourceCodePro-Regular.ttf differ diff --git a/doc/images/add.png b/doc/images/add.png new file mode 100644 index 00000000..6332fefe Binary files /dev/null and b/doc/images/add.png differ diff --git a/doc/images/arrow_up.png b/doc/images/arrow_up.png new file mode 100644 index 00000000..1ebb1932 Binary files /dev/null and b/doc/images/arrow_up.png differ diff --git a/doc/images/brick.png b/doc/images/brick.png new file mode 100644 index 00000000..7851cf34 Binary files /dev/null and b/doc/images/brick.png differ diff --git a/doc/images/brick_link.png b/doc/images/brick_link.png new file mode 100644 index 00000000..9ebf013a Binary files /dev/null and b/doc/images/brick_link.png differ diff --git a/doc/images/bug.png b/doc/images/bug.png new file mode 100644 index 00000000..2d5fb90e Binary files /dev/null and b/doc/images/bug.png differ diff --git a/doc/images/bullet_black.png b/doc/images/bullet_black.png new file mode 100644 index 00000000..57619706 Binary files /dev/null and b/doc/images/bullet_black.png differ diff --git a/doc/images/bullet_toggle_minus.png b/doc/images/bullet_toggle_minus.png new file mode 100644 index 00000000..b47ce55f Binary files /dev/null and b/doc/images/bullet_toggle_minus.png differ diff --git a/doc/images/bullet_toggle_plus.png b/doc/images/bullet_toggle_plus.png new file mode 100644 index 00000000..9ab4a896 Binary files /dev/null and b/doc/images/bullet_toggle_plus.png differ diff --git a/doc/images/date.png b/doc/images/date.png new file mode 100644 index 00000000..783c8335 Binary files /dev/null and b/doc/images/date.png differ diff --git a/doc/images/delete.png b/doc/images/delete.png new file mode 100644 index 00000000..08f24936 Binary files /dev/null and b/doc/images/delete.png differ diff --git a/doc/images/find.png b/doc/images/find.png new file mode 100644 index 00000000..15474796 Binary files /dev/null and b/doc/images/find.png differ diff --git a/doc/images/loadingAnimation.gif b/doc/images/loadingAnimation.gif new file mode 100644 index 00000000..82290f48 Binary files /dev/null and b/doc/images/loadingAnimation.gif differ diff --git a/doc/images/macFFBgHack.png b/doc/images/macFFBgHack.png new file mode 100644 index 00000000..c6473b32 Binary files /dev/null and b/doc/images/macFFBgHack.png differ diff --git a/doc/images/package.png b/doc/images/package.png new file mode 100644 index 00000000..da3c2a2d Binary files /dev/null and b/doc/images/package.png differ diff --git a/doc/images/page_green.png b/doc/images/page_green.png new file mode 100644 index 00000000..de8e003f Binary files /dev/null and b/doc/images/page_green.png differ diff --git a/doc/images/page_white_text.png b/doc/images/page_white_text.png new file mode 100644 index 00000000..813f712f Binary files /dev/null and b/doc/images/page_white_text.png differ diff --git a/doc/images/page_white_width.png b/doc/images/page_white_width.png new file mode 100644 index 00000000..1eb88094 Binary files /dev/null and b/doc/images/page_white_width.png differ diff --git a/doc/images/plugin.png b/doc/images/plugin.png new file mode 100644 index 00000000..6187b15a Binary files /dev/null and b/doc/images/plugin.png differ diff --git a/doc/images/ruby.png b/doc/images/ruby.png new file mode 100644 index 00000000..f763a168 Binary files /dev/null and b/doc/images/ruby.png differ diff --git a/doc/images/tag_blue.png b/doc/images/tag_blue.png new file mode 100644 index 00000000..3f02b5f8 Binary files /dev/null and b/doc/images/tag_blue.png differ diff --git a/doc/images/tag_green.png b/doc/images/tag_green.png new file mode 100644 index 00000000..83ec984b Binary files /dev/null and b/doc/images/tag_green.png differ diff --git a/doc/images/transparent.png b/doc/images/transparent.png new file mode 100644 index 00000000..d665e179 Binary files /dev/null and b/doc/images/transparent.png differ diff --git a/doc/images/wrench.png b/doc/images/wrench.png new file mode 100644 index 00000000..5c8213fe Binary files /dev/null and b/doc/images/wrench.png differ diff --git a/doc/images/wrench_orange.png b/doc/images/wrench_orange.png new file mode 100644 index 00000000..565a9330 Binary files /dev/null and b/doc/images/wrench_orange.png differ diff --git a/doc/images/zoom.png b/doc/images/zoom.png new file mode 100644 index 00000000..908612e3 Binary files /dev/null and b/doc/images/zoom.png differ diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..2157e69d --- /dev/null +++ b/doc/index.html @@ -0,0 +1,146 @@ + + + + + + +RDoc Documentation + + + + + + + + + + + + + + + + +
+

This is the API documentation for RDoc Documentation. +

+ + + + diff --git a/doc/js/darkfish.js b/doc/js/darkfish.js new file mode 100644 index 00000000..111bbf8e --- /dev/null +++ b/doc/js/darkfish.js @@ -0,0 +1,84 @@ +/** + * + * Darkfish Page Functions + * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* Provide console simulation for firebug-less environments */ +/* +if (!("console" in window) || !("firebug" in console)) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +}; +*/ + + +function showSource( e ) { + var target = e.target; + while (!target.classList.contains('method-detail')) { + target = target.parentNode; + } + if (typeof target !== "undefined" && target !== null) { + target = target.querySelector('.method-source-code'); + } + if (typeof target !== "undefined" && target !== null) { + target.classList.toggle('active-menu') + } +}; + +function hookSourceViews() { + document.querySelectorAll('.method-heading').forEach(function (codeObject) { + codeObject.addEventListener('click', showSource); + }); +}; + +function hookSearch() { + var input = document.querySelector('#search-field'); + var result = document.querySelector('#search-results'); + result.classList.remove("initially-hidden"); + + var search_section = document.querySelector('#search-section'); + search_section.classList.remove("initially-hidden"); + + var search = new Search(search_data, input, result); + + search.renderItem = function(result) { + var li = document.createElement('li'); + var html = ''; + + // TODO add relative path to + + + + + + + + + + + + +
+

Table of Contents - RDoc Documentation

+ +

Pages

+ + +

Classes and Modules

+ + +

Methods

+ +
+ + + +