diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d2512e921b8dcce355732c332b880fdcac9336d8 Binary files /dev/null and b/.DS_Store differ diff --git a/.classpath b/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..79da6ab9ed6945660ca488615d202965bb426c67 --- /dev/null +++ b/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="test"/> + <classpathentry kind="lib" path="lib/battleship-library-1.0.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..dfe0770424b2a19faf507a501ebfc23be8f54e7b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1726048cd06b9a143e0376ed46dd9b9a8d53 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..26d33521af10bcc7fd8cea344038eaaeb78d0ef5 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000000000000000000000000000000000000..4c17e3086873360cd36182d55401ec6e82de1c50 --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +FenLog.java \ No newline at end of file diff --git a/.idea/battleship-student-project-2021.iml b/.idea/battleship-student-project-2021.iml new file mode 100644 index 0000000000000000000000000000000000000000..c5b6a1e1085df17d61bc45d32529d7909852f819 --- /dev/null +++ b/.idea/battleship-student-project-2021.iml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="lib" level="project" /> + <orderEntry type="module-library" scope="TEST"> + <library name="JUnit5.4"> + <CLASSES> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter/5.4.2/junit-jupiter-5.4.2.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.2/junit-jupiter-api-5.4.2.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.2/junit-platform-commons-1.4.2.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.2/junit-jupiter-params-5.4.2.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-engine/5.4.2/junit-jupiter-engine-5.4.2.jar!/" /> + <root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-engine/1.4.2/junit-platform-engine-1.4.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + </component> +</module> \ No newline at end of file diff --git a/.idea/libraries/lib.xml b/.idea/libraries/lib.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa8838a590c51fab5874c30c10510a0b093b73a0 --- /dev/null +++ b/.idea/libraries/lib.xml @@ -0,0 +1,10 @@ +<component name="libraryTable"> + <library name="lib"> + <CLASSES> + <root url="file://$PROJECT_DIR$/lib" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + <jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" /> + </library> +</component> \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5d79e0ca59328739cde02b6e568ef97383f0d15 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <output url="file://$PROJECT_DIR$/out" /> + </component> +</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..32cbec58db170a5083dfcb41ce7b96de21b14ca5 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/battleship-student-project-2021.iml" filepath="$PROJECT_DIR$/.idea/battleship-student-project-2021.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..35eb1ddfbbc029bcab630581847471d7f238ec53 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..9fa2082e9e221728d9899dd3f098b7f95f6c6c7c --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>projet-tutore</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fad30fd7118f3a722a9f4b6e5846590662d6da10 --- /dev/null +++ b/README.md @@ -0,0 +1,106 @@ +# Projet S2 : Bataille Navale + + + +## Présentation rapide + +Il va s'agir de développer une application cliente permettant de jouer +en réseau à la bataille navale : https://fr.wikipedia.org/wiki/Bataille_navale_(jeu) + +Un serveur de jeu est accessible en ligne sous la forme d'une API Rest + (http://37.187.38.219/api/v0) et une librairie Java + interfaçant le serveur vous est fournie (en partie). + + +## Travail à faire + +### initialisation du projet + +1. créez un git spécifique à votre groupe sur le gitlab de l'université : + https://gitlab.univ-nantes.fr/ + +2. ajoutez comme "maintainer" votre enseignant-référent et M. Arnaud Lanoix + +3. déposez sur votre git, l'ensemble des sources récupérées ici : +https://gitlab.univ-nantes.fr/iut.info1.project/battleship-student-project-2021/-/archive/master/battleship-student-project-2021-master.zip +OU faites un fork de ce dépot. + + + + **Vous respecterez la structure imposée en terme de dossiers/paquetages** + + NB :le source récupéré contient un repertoire lib/ + contenant une archive jar `battleship-library-1.x.jar` + + il faut ajouter ce .jar comme une librairie dans votre IDE préféré + + il s'agit de code qui vous est fourni, que vous devrez utiliser + mais que vous ne pouvez pas modifier + + +### implémentation de `ships.*` + +2. il vous faut (terminer de) développer le modèle de données représentant +la flotte de bateaux ; pour cela, il vous faut coder +les classes suivantes (dans `src/info1/ships/`) : + * `Coord` implémentant `ICoord` + * `Ship` implémentant `IShip` et (si nécessaire) modifier les classes "filles" fournies + * `NavyFleet` implémentant `INavyFleet` + +Les interfaces à implémenter sont présentes dans `battleship-library-1.x.jar` ; +elles sont sont documentées dans la javadoc fournie (documentation/javadoc). + +NB :des cas de tests écrit en Junit 5.4 vous +permettront de valider votre implémentation : + * `CoordTest` + * `NavyFleetTest` + * `ShipTest` + + + + +### utilisation de `info1.network.Network` ... + + +vous pouvez maintenant utiliser la classe `Network` pour échanger avec le serveur, +càd créer ou rejoindre une partie, puis jouer, càd effectuer un tir +sur une coordonnée précise. + + + +La classe `Network` est documentée dans la javadoc fournie (documentation/javadoc). + +Plus de détail sur l'usage de la classe Network dans . + +La classe de tests `RunningGameTest` illustre également l'utilisation de `info1.network.Network` ; elle devrait +fonctionner une fois que vous avez correctement implémenter les classes du package `ships.*`.s + +### ... et développement d'une interface graphique + +Développez une interface graphique en Swing vous permettant de jouer, cad + +1. positionner des bateaux + +2. créer une flotte de bateaux + +3. initialiser une partie sur le serveur + +4. rejoindre une partie initialisée sur le serveur + +5. jouer via le serveur + +6. gagner ;-) + + + +## Remarques + +Chaque groupe aura un enseignant-référent qui passera +vous voir régulièrement afin de vous assister +mais aussi évaluer votre travail. + + + + + +_Image du bateau issue de https://en.wikipedia.org/wiki/French_battleship_Brennus_ diff --git a/documentation/.DS_Store b/documentation/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6fd43dad97f6a516e01e9134276596e64403fb44 Binary files /dev/null and b/documentation/.DS_Store differ diff --git a/documentation/HowtoUseNetwork.md b/documentation/HowtoUseNetwork.md new file mode 100644 index 0000000000000000000000000000000000000000..307ce4ea6686dd2d56e16397402098496a7cc064 --- /dev/null +++ b/documentation/HowtoUseNetwork.md @@ -0,0 +1,62 @@ +# Documentation de **Network** + +La serveur de jeu est un serveur REST disponible à l'adresse suivante : +http://37.187.38.219/api/v0 + +La logique d'échange est la suivante : + +## 1ere phase : initialisation + +Des joueurs s'inscrivent sur le serveur via + +`Network.suscribeNewPlayer(...)` + +On peut lister les joueurs déjà inscrits via + +`Network.listActivePlayers(...)` + +Des joueurs initient des parties sur le serveur via + +`Network.initNewGame(...)` + +On peut lister les parties initialisées via + +`Network.listInitializedGames(...)` + +Un joueur peut rejoindre une partie initialisée + +`Network.joinGame(...)` + +alors la phase de jeu commence... + + +## 2ième phase : dérouler d'une partie +A tour de rôle les deux joueurs de la partie vont pouvoir jouer. + + +Avant de jouer, il faut vérifier l'état de la partie via + +`Network.getInfo(...)` + +Puis on peut jouer si c'est à notre tour via + +`Network.playOneTurn(...)` + + + +## Les limitations du serveur sont les suivantes + +* le joueur qui a initialisé une partie ne sera pas prévenu qu'un joueur + a rejoint sa partie ; + +* lorsqu'un joueur a joué l'autre joueur n'est pas prévenu que c'est +à son tour de jouer ; + +* lorsqu'un joueur touche (ou coule) un navire adverse, +l'autre joueur n'est pas prévenu ; + +* lorsqu'un joueur gagne la partie, l'autre joueur n'est pas +prévenu non plus. + +**NB : il faut utiliser `Network.getInfo(...)` pour s'informer + périodiquement de l'état courant de la partie** diff --git a/documentation/javadoc/allclasses-frame.html b/documentation/javadoc/allclasses-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..b05cb8c3fcfd980829f7cc870dfae7159a6b20e1 --- /dev/null +++ b/documentation/javadoc/allclasses-frame.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>All Classes</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<h1 class="bar">All Classes</h1> +<div class="indexContainer"> +<ul> +<li><a href="info1/ships/BadCoordException.html" title="class in info1.ships" target="classFrame">BadCoordException</a></li> +<li><a href="info1/network/BadIdException.html" title="class in info1.network" target="classFrame">BadIdException</a></li> +<li><a href="info1/ships/CoordsBadShipException.html" title="class in info1.ships" target="classFrame">CoordsBadShipException</a></li> +<li><a href="info1/network/Game.html" title="class in info1.network" target="classFrame">Game</a></li> +<li><a href="info1/ships/ICoord.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">ICoord</span></a></li> +<li><a href="info1/ships/INavyFleet.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">INavyFleet</span></a></li> +<li><a href="info1/ships/IShip.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">IShip</span></a></li> +<li><a href="info1/network/Network.html" title="class in info1.network" target="classFrame">Network</a></li> +<li><a href="info1/network/Player.html" title="class in info1.network" target="classFrame">Player</a></li> +<li><a href="info1/ships/ShipCategory.html" title="enum in info1.ships" target="classFrame">ShipCategory</a></li> +<li><a href="info1/ships/UncompleteFleetException.html" title="class in info1.ships" target="classFrame">UncompleteFleetException</a></li> +</ul> +</div> +</body> +</html> diff --git a/documentation/javadoc/allclasses-noframe.html b/documentation/javadoc/allclasses-noframe.html new file mode 100644 index 0000000000000000000000000000000000000000..36cf1e786f652ad585de88a3e6f368ea04db1f0b --- /dev/null +++ b/documentation/javadoc/allclasses-noframe.html @@ -0,0 +1,29 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>All Classes</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<h1 class="bar">All Classes</h1> +<div class="indexContainer"> +<ul> +<li><a href="info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></li> +<li><a href="info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></li> +<li><a href="info1/ships/CoordsBadShipException.html" title="class in info1.ships">CoordsBadShipException</a></li> +<li><a href="info1/network/Game.html" title="class in info1.network">Game</a></li> +<li><a href="info1/ships/ICoord.html" title="interface in info1.ships"><span class="interfaceName">ICoord</span></a></li> +<li><a href="info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="interfaceName">INavyFleet</span></a></li> +<li><a href="info1/ships/IShip.html" title="interface in info1.ships"><span class="interfaceName">IShip</span></a></li> +<li><a href="info1/network/Network.html" title="class in info1.network">Network</a></li> +<li><a href="info1/network/Player.html" title="class in info1.network">Player</a></li> +<li><a href="info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></li> +<li><a href="info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a></li> +</ul> +</div> +</body> +</html> diff --git a/documentation/javadoc/constant-values.html b/documentation/javadoc/constant-values.html new file mode 100644 index 0000000000000000000000000000000000000000..762c628a2bde3b355f696972fe15df8998028ec5 --- /dev/null +++ b/documentation/javadoc/constant-values.html @@ -0,0 +1,120 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Constant Field Values</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Constant Field Values"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?constant-values.html" target="_top">Frames</a></li> +<li><a href="constant-values.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Constant Field Values" class="title">Constant Field Values</h1> +<h2 title="Contents">Contents</h2> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?constant-values.html" target="_top">Frames</a></li> +<li><a href="constant-values.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/help-doc.html b/documentation/javadoc/help-doc.html new file mode 100644 index 0000000000000000000000000000000000000000..c77c37fc1475bc115319e4d6fb89502aa1b45241 --- /dev/null +++ b/documentation/javadoc/help-doc.html @@ -0,0 +1,217 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>API Help</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="API Help"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li class="navBarCell1Rev">Help</li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?help-doc.html" target="_top">Frames</a></li> +<li><a href="help-doc.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">How This API Document Is Organized</h1> +<div class="subTitle">This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.</div> +</div> +<div class="contentContainer"> +<ul class="blockList"> +<li class="blockList"> +<h2>Overview</h2> +<p>The <a href="overview-summary.html">Overview</a> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</p> +</li> +<li class="blockList"> +<h2>Package</h2> +<p>Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:</p> +<ul> +<li>Interfaces (italic)</li> +<li>Classes</li> +<li>Enums</li> +<li>Exceptions</li> +<li>Errors</li> +<li>Annotation Types</li> +</ul> +</li> +<li class="blockList"> +<h2>Class/Interface</h2> +<p>Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:</p> +<ul> +<li>Class inheritance diagram</li> +<li>Direct Subclasses</li> +<li>All Known Subinterfaces</li> +<li>All Known Implementing Classes</li> +<li>Class/interface declaration</li> +<li>Class/interface description</li> +</ul> +<ul> +<li>Nested Class Summary</li> +<li>Field Summary</li> +<li>Constructor Summary</li> +<li>Method Summary</li> +</ul> +<ul> +<li>Field Detail</li> +<li>Constructor Detail</li> +<li>Method Detail</li> +</ul> +<p>Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</p> +</li> +<li class="blockList"> +<h2>Annotation Type</h2> +<p>Each annotation type has its own separate page with the following sections:</p> +<ul> +<li>Annotation Type declaration</li> +<li>Annotation Type description</li> +<li>Required Element Summary</li> +<li>Optional Element Summary</li> +<li>Element Detail</li> +</ul> +</li> +<li class="blockList"> +<h2>Enum</h2> +<p>Each enum has its own separate page with the following sections:</p> +<ul> +<li>Enum declaration</li> +<li>Enum description</li> +<li>Enum Constant Summary</li> +<li>Enum Constant Detail</li> +</ul> +</li> +<li class="blockList"> +<h2>Tree (Class Hierarchy)</h2> +<p>There is a <a href="overview-tree.html">Class Hierarchy</a> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.</p> +<ul> +<li>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.</li> +<li>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</li> +</ul> +</li> +<li class="blockList"> +<h2>Index</h2> +<p>The <a href="index-files/index-1.html">Index</a> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</p> +</li> +<li class="blockList"> +<h2>Prev/Next</h2> +<p>These links take you to the next or previous class, interface, package, or related page.</p> +</li> +<li class="blockList"> +<h2>Frames/No Frames</h2> +<p>These links show and hide the HTML frames. All pages are available with or without frames.</p> +</li> +<li class="blockList"> +<h2>All Classes</h2> +<p>The <a href="allclasses-noframe.html">All Classes</a> link shows all classes and interfaces except non-static nested types.</p> +</li> +<li class="blockList"> +<h2>Serialized Form</h2> +<p>Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.</p> +</li> +<li class="blockList"> +<h2>Constant Field Values</h2> +<p>The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.</p> +</li> +</ul> +<span class="emphasizedPhrase">This help file applies to API documentation generated using the standard doclet.</span></div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li class="navBarCell1Rev">Help</li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?help-doc.html" target="_top">Frames</a></li> +<li><a href="help-doc.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-1.html b/documentation/javadoc/index-files/index-1.html new file mode 100644 index 0000000000000000000000000000000000000000..78985cd49ff0e7165bdaf3bb85d356505306d6a7 --- /dev/null +++ b/documentation/javadoc/index-files/index-1.html @@ -0,0 +1,141 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>A-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="A-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Letter</li> +<li><a href="index-2.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-1.html" target="_top">Frames</a></li> +<li><a href="index-1.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:A"> +<!-- --> +</a> +<h2 class="title">A</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#add-info1.ships.IShip-">add(IShip)</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Player.html#asJSON--">asJSON()</a></span> - Method in class info1.network.<a href="../info1/network/Player.html" title="class in info1.network">Player</a></dt> +<dd> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON de la forme {"nom":"'player_name'"}</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#asJSON--">asJSON()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#asJSON--">asJSON()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">donne une représentation de l'objet courant sous la forme d'un tableau JSON</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#asJSON--">asJSON()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Letter</li> +<li><a href="index-2.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-1.html" target="_top">Frames</a></li> +<li><a href="index-1.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-10.html b/documentation/javadoc/index-files/index-10.html new file mode 100644 index 0000000000000000000000000000000000000000..a382b7b5e16c86e372e9c99ceb4e1398fa864401 --- /dev/null +++ b/documentation/javadoc/index-files/index-10.html @@ -0,0 +1,129 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>N-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="N-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-9.html">Prev Letter</a></li> +<li><a href="index-11.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-10.html" target="_top">Frames</a></li> +<li><a href="index-10.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:N"> +<!-- --> +</a> +<h2 class="title">N</h2> +<dl> +<dt><a href="../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Network</span></a> - Class in <a href="../info1/network/package-summary.html">info1.network</a></dt> +<dd> +<div class="block">Classe Network qui défini les méthodes de communication avec le serveur</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#Network--">Network()</a></span> - Constructor for class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-9.html">Prev Letter</a></li> +<li><a href="index-11.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-10.html" target="_top">Frames</a></li> +<li><a href="index-10.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-11.html b/documentation/javadoc/index-files/index-11.html new file mode 100644 index 0000000000000000000000000000000000000000..9650fca8d27bc03ea9a34d440dd84df4f2df509d --- /dev/null +++ b/documentation/javadoc/index-files/index-11.html @@ -0,0 +1,135 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>P-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="P-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-10.html">Prev Letter</a></li> +<li><a href="index-12.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-11.html" target="_top">Frames</a></li> +<li><a href="index-11.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:P"> +<!-- --> +</a> +<h2 class="title">P</h2> +<dl> +<dt><a href="../info1/network/Player.html" title="class in info1.network"><span class="typeNameLink">Player</span></a> - Class in <a href="../info1/network/package-summary.html">info1.network</a></dt> +<dd> +<div class="block">classe définissant un "joueur" coté serveur</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Player.html#Player-java.lang.String-">Player(String)</a></span> - Constructor for class info1.network.<a href="../info1/network/Player.html" title="class in info1.network">Player</a></dt> +<dd> +<div class="block">construit un objet Player</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#playOneTurn-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.ICoord-">playOneTurn(String, Game, Player, ICoord)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">permet de jouer un tour, c'est-à-dire d'effectuer un tir</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-10.html">Prev Letter</a></li> +<li><a href="index-12.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-11.html" target="_top">Frames</a></li> +<li><a href="index-11.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-12.html b/documentation/javadoc/index-files/index-12.html new file mode 100644 index 0000000000000000000000000000000000000000..cdac343995a5145b6ad29c40ee0726696d847ca8 --- /dev/null +++ b/documentation/javadoc/index-files/index-12.html @@ -0,0 +1,127 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>R-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="R-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-11.html">Prev Letter</a></li> +<li><a href="index-13.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-12.html" target="_top">Frames</a></li> +<li><a href="index-12.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:R"> +<!-- --> +</a> +<h2 class="title">R</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#remainingSize--">remainingSize()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">au départ la taille d'une flotte est de 20 ; plus elle contient de navires, plus sa taille restante diminue</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-11.html">Prev Letter</a></li> +<li><a href="index-13.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-12.html" target="_top">Frames</a></li> +<li><a href="index-12.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-13.html b/documentation/javadoc/index-files/index-13.html new file mode 100644 index 0000000000000000000000000000000000000000..c64dd4daaa9bc23df5b3bd4ea319cb6a7508793f --- /dev/null +++ b/documentation/javadoc/index-files/index-13.html @@ -0,0 +1,131 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>S-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="S-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-12.html">Prev Letter</a></li> +<li><a href="index-14.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-13.html" target="_top">Frames</a></li> +<li><a href="index-13.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:S"> +<!-- --> +</a> +<h2 class="title">S</h2> +<dl> +<dt><a href="../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">ShipCategory</span></a> - Enum in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">Enumeration qui défini les différentes catégories de bateaux</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#suscribeNewPlayer-java.lang.String-info1.network.Player-">suscribeNewPlayer(String, Player)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">inscrit un nouveau joueur sur le serveur</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-12.html">Prev Letter</a></li> +<li><a href="index-14.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-13.html" target="_top">Frames</a></li> +<li><a href="index-13.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-14.html b/documentation/javadoc/index-files/index-14.html new file mode 100644 index 0000000000000000000000000000000000000000..511356a442e2027166ee5fb2b271e76c45d0448a --- /dev/null +++ b/documentation/javadoc/index-files/index-14.html @@ -0,0 +1,133 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>T-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="T-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-13.html">Prev Letter</a></li> +<li><a href="index-15.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-14.html" target="_top">Frames</a></li> +<li><a href="index-14.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:T"> +<!-- --> +</a> +<h2 class="title">T</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#toString--">toString()</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Player.html#toString--">toString()</a></span> - Method in class info1.network.<a href="../info1/network/Player.html" title="class in info1.network">Player</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#toString--">toString()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#toString--">toString()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#toString--">toString()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-13.html">Prev Letter</a></li> +<li><a href="index-15.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-14.html" target="_top">Frames</a></li> +<li><a href="index-14.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-15.html b/documentation/javadoc/index-files/index-15.html new file mode 100644 index 0000000000000000000000000000000000000000..6f9a669028d4969c31b06e31161f8d4474815f37 --- /dev/null +++ b/documentation/javadoc/index-files/index-15.html @@ -0,0 +1,127 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>U-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="U-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-14.html">Prev Letter</a></li> +<li><a href="index-16.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li> +<li><a href="index-15.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:U"> +<!-- --> +</a> +<h2 class="title">U</h2> +<dl> +<dt><a href="../info1/ships/UncompleteFleetException.html" title="class in info1.ships"><span class="typeNameLink">UncompleteFleetException</span></a> - Exception in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/UncompleteFleetException.html#UncompleteFleetException--">UncompleteFleetException()</a></span> - Constructor for exception info1.ships.<a href="../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-14.html">Prev Letter</a></li> +<li><a href="index-16.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-15.html" target="_top">Frames</a></li> +<li><a href="index-15.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-16.html b/documentation/javadoc/index-files/index-16.html new file mode 100644 index 0000000000000000000000000000000000000000..7f4e4c26813acc22e50cdf6785ce1cd481dc83b7 --- /dev/null +++ b/documentation/javadoc/index-files/index-16.html @@ -0,0 +1,132 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>V-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="V-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-15.html">Prev Letter</a></li> +<li>Next Letter</li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-16.html" target="_top">Frames</a></li> +<li><a href="index-16.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:V"> +<!-- --> +</a> +<h2 class="title">V</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/ships/ShipCategory.html#valueOf-java.lang.String-">valueOf(String)</a></span> - Static method in enum info1.ships.<a href="../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></dt> +<dd> +<div class="block">Returns the enum constant of this type with the specified name.</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ShipCategory.html#values--">values()</a></span> - Static method in enum info1.ships.<a href="../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></dt> +<dd> +<div class="block">Returns an array containing the constants of this enum type, in +the order they are declared.</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-15.html">Prev Letter</a></li> +<li>Next Letter</li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-16.html" target="_top">Frames</a></li> +<li><a href="index-16.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-2.html b/documentation/javadoc/index-files/index-2.html new file mode 100644 index 0000000000000000000000000000000000000000..34dbf4750d81c43b528c9c40494190a712ad02dd --- /dev/null +++ b/documentation/javadoc/index-files/index-2.html @@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>B-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="B-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-1.html">Prev Letter</a></li> +<li><a href="index-3.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-2.html" target="_top">Frames</a></li> +<li><a href="index-2.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:B"> +<!-- --> +</a> +<h2 class="title">B</h2> +<dl> +<dt><a href="../info1/ships/BadCoordException.html" title="class in info1.ships"><span class="typeNameLink">BadCoordException</span></a> - Exception in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">Exception levée si l'on tente de fabriquer une coordonnée alphanumérique à partir d'une chaine + de caractères incorrecte</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/BadCoordException.html#BadCoordException--">BadCoordException()</a></span> - Constructor for exception info1.ships.<a href="../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></dt> +<dd> </dd> +<dt><a href="../info1/network/BadIdException.html" title="class in info1.network"><span class="typeNameLink">BadIdException</span></a> - Exception in <a href="../info1/network/package-summary.html">info1.network</a></dt> +<dd> +<div class="block">Exception levée si l'id passé lors da construction d'une partie est incorrect</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/BadIdException.html#BadIdException--">BadIdException()</a></span> - Constructor for exception info1.network.<a href="../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-1.html">Prev Letter</a></li> +<li><a href="index-3.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-2.html" target="_top">Frames</a></li> +<li><a href="index-2.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-3.html b/documentation/javadoc/index-files/index-3.html new file mode 100644 index 0000000000000000000000000000000000000000..618728f2579f703335a0b6cd4745460af8880d21 --- /dev/null +++ b/documentation/javadoc/index-files/index-3.html @@ -0,0 +1,143 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>C-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="C-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-2.html">Prev Letter</a></li> +<li><a href="index-4.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-3.html" target="_top">Frames</a></li> +<li><a href="index-3.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:C"> +<!-- --> +</a> +<h2 class="title">C</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#compareTo-info1.ships.ICoord-">compareTo(ICoord)</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">compare l'objet courant à l'ojet coord</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#compareTo-info1.ships.IShip-">compareTo(IShip)</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> +<div class="block">compare le bateau courant avec le bateau autre + un bateau est plus grand qu'un autre si sa taille est plus grande, + sinon si son nom est plus grand (alphabétiquement parlant), + sinon si sa coordonnée de proue est plus grande, + sinon si sa coordonnée de poupe est plus grande</div> +</dd> +<dt><a href="../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">CoordsBadShipException</span></a> - Exception in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">Exception levée à la création d'un bateau si les coordonnées + du bateau ne définissent pas un bateau correct : + une ligne, une colonne, de la bonne taille, etc.</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/CoordsBadShipException.html#CoordsBadShipException--">CoordsBadShipException()</a></span> - Constructor for exception info1.ships.<a href="../info1/ships/CoordsBadShipException.html" title="class in info1.ships">CoordsBadShipException</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-2.html">Prev Letter</a></li> +<li><a href="index-4.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-3.html" target="_top">Frames</a></li> +<li><a href="index-3.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-4.html b/documentation/javadoc/index-files/index-4.html new file mode 100644 index 0000000000000000000000000000000000000000..21dbd143f1a4534bbd3074ba16d55ff5da63358f --- /dev/null +++ b/documentation/javadoc/index-files/index-4.html @@ -0,0 +1,139 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>E-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="E-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-3.html">Prev Letter</a></li> +<li><a href="index-5.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-4.html" target="_top">Frames</a></li> +<li><a href="index-4.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:E"> +<!-- --> +</a> +<h2 class="title">E</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#equals-java.lang.Object-">equals(Object)</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> +<div class="block">vérifie l'égalité</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Player.html#equals-java.lang.Object-">equals(Object)</a></span> - Method in class info1.network.<a href="../info1/network/Player.html" title="class in info1.network">Player</a></dt> +<dd> +<div class="block">vérifie l'égalité</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#equals-java.lang.Object-">equals(Object)</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">vérifie l'égalité</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#equals-java.lang.Object-">equals(Object)</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> +<div class="block">vérifie l'égalité</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-3.html">Prev Letter</a></li> +<li><a href="index-5.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-4.html" target="_top">Frames</a></li> +<li><a href="index-4.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-5.html b/documentation/javadoc/index-files/index-5.html new file mode 100644 index 0000000000000000000000000000000000000000..25ab79ae93d0d5ef8f6709dcd396ca0631b44592 --- /dev/null +++ b/documentation/javadoc/index-files/index-5.html @@ -0,0 +1,178 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>G-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="G-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-4.html">Prev Letter</a></li> +<li><a href="index-6.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-5.html" target="_top">Frames</a></li> +<li><a href="index-5.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:G"> +<!-- --> +</a> +<h2 class="title">G</h2> +<dl> +<dt><a href="../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Game</span></a> - Class in <a href="../info1/network/package-summary.html">info1.network</a></dt> +<dd> +<div class="block">Classe définissant une "partie" coté serveur</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#Game-int-">Game(int)</a></span> - Constructor for class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> +<div class="block">construit un objet Game</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#getAlphaX--">getAlphaX()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">donne la coordonnée X sous forme alphabétique</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getBack--">getBack()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getCategory--">getCategory()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getCoords--">getCoords()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getFront--">getFront()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#getGuest--">getGuest()</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#getId--">getId()</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#getInfo-java.lang.String-info1.network.Game-info1.network.Player-">getInfo(String, Game, Player)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">permet de consulter l'etat d'une partie</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#getInitiator--">getInitiator()</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Player.html#getName--">getName()</a></span> - Method in class info1.network.<a href="../info1/network/Player.html" title="class in info1.network">Player</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getName--">getName()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#getShips--">getShips()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">donne la liste triée de tous les bateaux de la flotte</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#getShips-info1.ships.ShipCategory-">getShips(ShipCategory)</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">donne l'ensemble de tous les bateaux d'une catégorie donnée</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#getSize--">getSize()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ShipCategory.html#getSize--">getSize()</a></span> - Method in enum info1.ships.<a href="../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#getX--">getX()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">donne la coordonnée X sous forme numérique, avec la correspondance suivante : + A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#getY--">getY()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> +<div class="block">donne la coordonnée Y sous forme numérique</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-4.html">Prev Letter</a></li> +<li><a href="index-6.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-5.html" target="_top">Frames</a></li> +<li><a href="index-5.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-6.html b/documentation/javadoc/index-files/index-6.html new file mode 100644 index 0000000000000000000000000000000000000000..73f6e7232e557098cf2a33f575e7ec9e1482ac19 --- /dev/null +++ b/documentation/javadoc/index-files/index-6.html @@ -0,0 +1,127 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>H-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="H-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-5.html">Prev Letter</a></li> +<li><a href="index-7.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-6.html" target="_top">Frames</a></li> +<li><a href="index-6.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:H"> +<!-- --> +</a> +<h2 class="title">H</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/ships/ICoord.html#hashCode--">hashCode()</a></span> - Method in interface info1.ships.<a href="../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/IShip.html#hashCode--">hashCode()</a></span> - Method in interface info1.ships.<a href="../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></dt> +<dd> </dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-5.html">Prev Letter</a></li> +<li><a href="index-7.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-6.html" target="_top">Frames</a></li> +<li><a href="index-6.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-7.html b/documentation/javadoc/index-files/index-7.html new file mode 100644 index 0000000000000000000000000000000000000000..9c720c6e3300d0f2fb31ef92b7742b3f5da530b1 --- /dev/null +++ b/documentation/javadoc/index-files/index-7.html @@ -0,0 +1,159 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>I-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="I-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-6.html">Prev Letter</a></li> +<li><a href="index-8.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-7.html" target="_top">Frames</a></li> +<li><a href="index-7.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:I"> +<!-- --> +</a> +<h2 class="title">I</h2> +<dl> +<dt><a href="../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">ICoord</span></a> - Interface in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">ICoord défini une interface pour manipuler des coordonnées alphanumériques comme "A1", "B6", "J3", etc.</div> +</dd> +<dt><a href="../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">INavyFleet</span></a> - Interface in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">interface définissant les fonctionnalités d'une flotte de navires</div> +</dd> +<dt><a href="../info1/network/package-summary.html">info1.network</a> - package info1.network</dt> +<dd> </dd> +<dt><a href="../info1/ships/package-summary.html">info1.ships</a> - package info1.ships</dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#initiate-info1.network.Player-">initiate(Player)</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> +<div class="block">fixe l'initiateur de la partie</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#initNewGame-java.lang.String-info1.network.Player-info1.ships.INavyFleet-">initNewGame(String, Player, INavyFleet)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">initialise une nouvelle partie sur le serveur</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#isBelgianConfiguration--">isBelgianConfiguration()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">indique si la flotte est dans la configuration "belge" : + 1 cuirassé, 2 croiseurs, 3 torpilleurs, 4 sous-marins</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#isComplete--">isComplete()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> </dd> +<dt><span class="memberNameLink"><a href="../info1/ships/INavyFleet.html#isFrenchConfiguration--">isFrenchConfiguration()</a></span> - Method in interface info1.ships.<a href="../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></dt> +<dd> +<div class="block">indique si la flotte est dans la configuration "française" : + 1 porte-avion, 1 cuirassé, 2 croiseurs, 2 torpilleurs, 1 sous-marin</div> +</dd> +<dt><a href="../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">IShip</span></a> - Interface in <a href="../info1/ships/package-summary.html">info1.ships</a></dt> +<dd> +<div class="block">interface décrivant les fonctionnalités d'un navire</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-6.html">Prev Letter</a></li> +<li><a href="index-8.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-7.html" target="_top">Frames</a></li> +<li><a href="index-7.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-8.html b/documentation/javadoc/index-files/index-8.html new file mode 100644 index 0000000000000000000000000000000000000000..0f584425d8e6141288847aeb7216eaa4571636e7 --- /dev/null +++ b/documentation/javadoc/index-files/index-8.html @@ -0,0 +1,132 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>J-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="J-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-7.html">Prev Letter</a></li> +<li><a href="index-9.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-8.html" target="_top">Frames</a></li> +<li><a href="index-8.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:J"> +<!-- --> +</a> +<h2 class="title">J</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/network/Game.html#join-info1.network.Player-">join(Player)</a></span> - Method in class info1.network.<a href="../info1/network/Game.html" title="class in info1.network">Game</a></dt> +<dd> +<div class="block">fixe le second joueur de la partie</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#joinGame-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.INavyFleet-">joinGame(String, Game, Player, INavyFleet)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">permet de rejoindre une partie initialisée sur le serveur + NB : la partie passée en paramètre est modifiée, par l'ajout du joueur rejoignant la partie</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-7.html">Prev Letter</a></li> +<li><a href="index-9.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-8.html" target="_top">Frames</a></li> +<li><a href="index-8.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index-files/index-9.html b/documentation/javadoc/index-files/index-9.html new file mode 100644 index 0000000000000000000000000000000000000000..334998fdc3f65833793c58155b071f407a9dc1c3 --- /dev/null +++ b/documentation/javadoc/index-files/index-9.html @@ -0,0 +1,131 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>L-Index</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> +<script type="text/javascript" src="../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="L-Index"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-8.html">Prev Letter</a></li> +<li><a href="index-10.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-9.html" target="_top">Frames</a></li> +<li><a href="index-9.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> <a name="I:L"> +<!-- --> +</a> +<h2 class="title">L</h2> +<dl> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#listActivePlayers-java.lang.String-">listActivePlayers(String)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">donne la liste des joueurs actifs connectés sur le serveur</div> +</dd> +<dt><span class="memberNameLink"><a href="../info1/network/Network.html#listInitializedGames-java.lang.String-">listInitializedGames(String)</a></span> - Static method in class info1.network.<a href="../info1/network/Network.html" title="class in info1.network">Network</a></dt> +<dd> +<div class="block">donne la liste des parties initialisées sur le serveur</div> +</dd> +</dl> +<a href="index-1.html">A</a> <a href="index-2.html">B</a> <a href="index-3.html">C</a> <a href="index-4.html">E</a> <a href="index-5.html">G</a> <a href="index-6.html">H</a> <a href="index-7.html">I</a> <a href="index-8.html">J</a> <a href="index-9.html">L</a> <a href="index-10.html">N</a> <a href="index-11.html">P</a> <a href="index-12.html">R</a> <a href="index-13.html">S</a> <a href="index-14.html">T</a> <a href="index-15.html">U</a> <a href="index-16.html">V</a> </div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="../overview-tree.html">Tree</a></li> +<li class="navBarCell1Rev">Index</li> +<li><a href="../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="index-8.html">Prev Letter</a></li> +<li><a href="index-10.html">Next Letter</a></li> +</ul> +<ul class="navList"> +<li><a href="../index.html?index-files/index-9.html" target="_top">Frames</a></li> +<li><a href="index-9.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/index.html b/documentation/javadoc/index.html new file mode 100644 index 0000000000000000000000000000000000000000..1f187dfcb352ab2959f96a23c8bda6e4d555339e --- /dev/null +++ b/documentation/javadoc/index.html @@ -0,0 +1,75 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Generated Documentation (Untitled)</title> +<script type="text/javascript"> + tmpTargetPage = "" + window.location.search; + if (tmpTargetPage != "" && tmpTargetPage != "undefined") + tmpTargetPage = tmpTargetPage.substring(1); + if (tmpTargetPage.indexOf(":") != -1 || (tmpTargetPage != "" && !validURL(tmpTargetPage))) + tmpTargetPage = "undefined"; + targetPage = tmpTargetPage; + function validURL(url) { + try { + url = decodeURIComponent(url); + } + catch (error) { + return false; + } + var pos = url.indexOf(".html"); + if (pos == -1 || pos != url.length - 5) + return false; + var allowNumber = false; + var allowSep = false; + var seenDot = false; + for (var i = 0; i < url.length - 5; i++) { + var ch = url.charAt(i); + if ('a' <= ch && ch <= 'z' || + 'A' <= ch && ch <= 'Z' || + ch == '$' || + ch == '_' || + ch.charCodeAt(0) > 127) { + allowNumber = true; + allowSep = true; + } else if ('0' <= ch && ch <= '9' + || ch == '-') { + if (!allowNumber) + return false; + } else if (ch == '/' || ch == '.') { + if (!allowSep) + return false; + allowNumber = false; + allowSep = false; + if (ch == '.') + seenDot = true; + if (ch == '/' && seenDot) + return false; + } else { + return false; + } + } + return true; + } + function loadFrames() { + if (targetPage != "" && targetPage != "undefined") + top.classFrame.location = top.targetPage; + } +</script> +</head> +<frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()"> +<frameset rows="30%,70%" title="Left frames" onload="top.loadFrames()"> +<frame src="overview-frame.html" name="packageListFrame" title="All Packages"> +<frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> +</frameset> +<frame src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> +<noframes> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> +</noframes> +</frameset> +</html> diff --git a/documentation/javadoc/info1/network/BadIdException.html b/documentation/javadoc/info1/network/BadIdException.html new file mode 100644 index 0000000000000000000000000000000000000000..d765a55a4fc842559de452074304d9513da2215b --- /dev/null +++ b/documentation/javadoc/info1/network/BadIdException.html @@ -0,0 +1,263 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>BadIdException</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="BadIdException"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/BadIdException.html" target="_top">Frames</a></li> +<li><a href="BadIdException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.network</div> +<h2 title="Class BadIdException" class="title">Class BadIdException</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.lang.Throwable</li> +<li> +<ul class="inheritance"> +<li>java.lang.Exception</li> +<li> +<ul class="inheritance"> +<li>info1.network.BadIdException</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Serializable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="typeNameLabel">BadIdException</span> +extends java.lang.Exception</pre> +<div class="block">Exception levée si l'id passé lors da construction d'une partie est incorrect</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../serialized-form.html#info1.network.BadIdException">Serialized Form</a></dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/network/BadIdException.html#BadIdException--">BadIdException</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Throwable"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Throwable</h3> +<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="BadIdException--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>BadIdException</h4> +<pre>public BadIdException()</pre> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/BadIdException.html" target="_top">Frames</a></li> +<li><a href="BadIdException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/network/Game.html b/documentation/javadoc/info1/network/Game.html new file mode 100644 index 0000000000000000000000000000000000000000..7c4d685981216faea829002edbf34d1f093ca7af --- /dev/null +++ b/documentation/javadoc/info1/network/Game.html @@ -0,0 +1,409 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Game</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Game"; + } + } + catch(err) { + } +//--> +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/BadIdException.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Game.html" target="_top">Frames</a></li> +<li><a href="Game.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.network</div> +<h2 title="Class Game" class="title">Class Game</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>info1.network.Game</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public class <span class="typeNameLabel">Game</span> +extends java.lang.Object</pre> +<div class="block">Classe définissant une "partie" coté serveur</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#Game-int-">Game</a></span>(int id)</code> +<div class="block">construit un objet Game</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object o)</code> +<div class="block">vérifie l'égalité</div> +</td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code><a href="../../info1/network/Player.html" title="class in info1.network">Player</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#getGuest--">getGuest</a></span>()</code> </td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#getId--">getId</a></span>()</code> </td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code><a href="../../info1/network/Player.html" title="class in info1.network">Player</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#getInitiator--">getInitiator</a></span>()</code> </td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#initiate-info1.network.Player-">initiate</a></span>(<a href="../../info1/network/Player.html" title="class in info1.network">Player</a> initiator)</code> +<div class="block">fixe l'initiateur de la partie</div> +</td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code>void</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#join-info1.network.Player-">join</a></span>(<a href="../../info1/network/Player.html" title="class in info1.network">Player</a> guest)</code> +<div class="block">fixe le second joueur de la partie</div> +</td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Game.html#toString--">toString</a></span>()</code> </td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="Game-int-"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>Game</h4> +<pre>public Game(int id) + throws <a href="../../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></pre> +<div class="block">construit un objet Game</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>id</code> - id de la partie, donné par le serveur</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="../../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></code> - si l'id est négatif ou nul;</dd> +</dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="equals-java.lang.Object-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>public boolean equals(java.lang.Object o)</pre> +<div class="block">vérifie l'égalité</div> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>equals</code> in class <code>java.lang.Object</code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>o</code> - un objet quelconque</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si o est égal à l'objet courant</dd> +</dl> +</li> +</ul> +<a name="getGuest--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getGuest</h4> +<pre>public <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> getGuest()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>le joueur qui a rejoint la partie coté serveur + null si aucun joueur n'a rejoint la partie</dd> +</dl> +</li> +</ul> +<a name="getId--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getId</h4> +<pre>public int getId()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un entier id de la partie coté serveur</dd> +</dl> +</li> +</ul> +<a name="getInitiator--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getInitiator</h4> +<pre>public <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> getInitiator()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>le joueur initiateur de la partie coté serveur + null si aucun joueur n'a initié la partie</dd> +</dl> +</li> +</ul> +<a name="initiate-info1.network.Player-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>initiate</h4> +<pre>public void initiate(<a href="../../info1/network/Player.html" title="class in info1.network">Player</a> initiator)</pre> +<div class="block">fixe l'initiateur de la partie</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>initiator</code> - un joueur, initiateur de la partie côté serveur</dd> +</dl> +</li> +</ul> +<a name="join-info1.network.Player-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>join</h4> +<pre>public void join(<a href="../../info1/network/Player.html" title="class in info1.network">Player</a> guest)</pre> +<div class="block">fixe le second joueur de la partie</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>guest</code> - un autre joueur, qui rejoint la partie côté serveur</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>toString</h4> +<pre>public java.lang.String toString()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>toString</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une chaine de caractères représentant + une partie sous la forme d'un triplet + ['id_partie' : 'initiator_name' vs 'guest_name']</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/BadIdException.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Game.html" target="_top">Frames</a></li> +<li><a href="Game.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/network/Network.html b/documentation/javadoc/info1/network/Network.html new file mode 100644 index 0000000000000000000000000000000000000000..15ee94b43a4d49149ed4d93a5271aced6714dbec --- /dev/null +++ b/documentation/javadoc/info1/network/Network.html @@ -0,0 +1,493 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Network</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Network"; + } + } + catch(err) { + } +//--> +var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9}; +var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/network/Player.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Network.html" target="_top">Frames</a></li> +<li><a href="Network.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.network</div> +<h2 title="Class Network" class="title">Class Network</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>info1.network.Network</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public class <span class="typeNameLabel">Network</span> +extends java.lang.Object</pre> +<div class="block">Classe Network qui défini les méthodes de communication avec le serveur</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#Network--">Network</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#getInfo-java.lang.String-info1.network.Game-info1.network.Player-">getInfo</a></span>(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player)</code> +<div class="block">permet de consulter l'etat d'une partie</div> +</td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>static <a href="../../info1/network/Game.html" title="class in info1.network">Game</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#initNewGame-java.lang.String-info1.network.Player-info1.ships.INavyFleet-">initNewGame</a></span>(java.lang.String baseurl, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> initiator, + <a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a> initFleet)</code> +<div class="block">initialise une nouvelle partie sur le serveur</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>static boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#joinGame-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.INavyFleet-">joinGame</a></span>(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> guest, + <a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a> guestFleet)</code> +<div class="block">permet de rejoindre une partie initialisée sur le serveur + NB : la partie passée en paramètre est modifiée, par l'ajout du joueur rejoignant la partie</div> +</td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code>static java.util.List<<a href="../../info1/network/Player.html" title="class in info1.network">Player</a>></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#listActivePlayers-java.lang.String-">listActivePlayers</a></span>(java.lang.String baseurl)</code> +<div class="block">donne la liste des joueurs actifs connectés sur le serveur</div> +</td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code>static java.util.List<<a href="../../info1/network/Game.html" title="class in info1.network">Game</a>></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#listInitializedGames-java.lang.String-">listInitializedGames</a></span>(java.lang.String baseurl)</code> +<div class="block">donne la liste des parties initialisées sur le serveur</div> +</td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code>static int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#playOneTurn-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.ICoord-">playOneTurn</a></span>(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player, + <a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> shoot)</code> +<div class="block">permet de jouer un tour, c'est-à-dire d'effectuer un tir</div> +</td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code>static boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Network.html#suscribeNewPlayer-java.lang.String-info1.network.Player-">suscribeNewPlayer</a></span>(java.lang.String baseurl, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player)</code> +<div class="block">inscrit un nouveau joueur sur le serveur</div> +</td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="Network--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>Network</h4> +<pre>public Network()</pre> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="getInfo-java.lang.String-info1.network.Game-info1.network.Player-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getInfo</h4> +<pre>public static int getInfo(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player) + throws com.mashape.unirest.http.exceptions.UnirestException, + <a href="../../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></pre> +<div class="block">permet de consulter l'etat d'une partie</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dd><code>game</code> - la partie initialisée</dd> +<dd><code>player</code> - le joueur courant</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>1 si la partie est correctement initiée par le joueur courant ; + -1 si la partie est correctement initiée par un autre joueur ; + 10 si c'est au joueur courant de jouer ; + -10 si ce n'est pas au joueur courant de jouer ; + 100 si la partie est gagnée par le joueur courant ; + -100 si la partie est perdue par le joueur courant + -9999 sinon</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +<dd><code><a href="../../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></code> - si l'id de la partie n'existe pas sur le serveur</dd> +</dl> +</li> +</ul> +<a name="initNewGame-java.lang.String-info1.network.Player-info1.ships.INavyFleet-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>initNewGame</h4> +<pre>public static <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> initNewGame(java.lang.String baseurl, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> initiator, + <a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a> initFleet) + throws com.mashape.unirest.http.exceptions.UnirestException, + <a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a>, + <a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></pre> +<div class="block">initialise une nouvelle partie sur le serveur</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dd><code>initiator</code> - le joueur à l'initiative de la nouvelle partie</dd> +<dd><code>initFleet</code> - la flotte de bateaux du joueur initiateur</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une partie initialisée ; null si la partie n'a pas pu être initialisée</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +<dd><code><a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a></code> - si la flotte de bateaux de l'initiateur n'est pas complete</dd> +<dd><code><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></code> - si les coordonnées d'un des bateaux de la flotte sont incorrectes</dd> +</dl> +</li> +</ul> +<a name="joinGame-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.INavyFleet-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>joinGame</h4> +<pre>public static boolean joinGame(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> guest, + <a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a> guestFleet) + throws com.mashape.unirest.http.exceptions.UnirestException, + <a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a>, + <a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></pre> +<div class="block">permet de rejoindre une partie initialisée sur le serveur + NB : la partie passée en paramètre est modifiée, par l'ajout du joueur rejoignant la partie</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dd><code>game</code> - la partie initialisée</dd> +<dd><code>guest</code> - le joueur rejoignant la partie</dd> +<dd><code>guestFleet</code> - la flotte du joueur rejoignant la partie</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si la joueur a correctement rejoint la partie ; la partie en paramètre sera modifiée</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +<dd><code><a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a></code> - si la flotte du joueur rejoignant la partie n'est pas complete</dd> +<dd><code><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></code> - si les coordonnées d'un des bateaux de la flotte sont incorrectes</dd> +</dl> +</li> +</ul> +<a name="listActivePlayers-java.lang.String-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>listActivePlayers</h4> +<pre>public static java.util.List<<a href="../../info1/network/Player.html" title="class in info1.network">Player</a>> listActivePlayers(java.lang.String baseurl) + throws com.mashape.unirest.http.exceptions.UnirestException</pre> +<div class="block">donne la liste des joueurs actifs connectés sur le serveur</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>la liste des joueurs actifs</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +</dl> +</li> +</ul> +<a name="listInitializedGames-java.lang.String-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>listInitializedGames</h4> +<pre>public static java.util.List<<a href="../../info1/network/Game.html" title="class in info1.network">Game</a>> listInitializedGames(java.lang.String baseurl) + throws com.mashape.unirest.http.exceptions.UnirestException</pre> +<div class="block">donne la liste des parties initialisées sur le serveur</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>la liste des parties initialisées</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +</dl> +</li> +</ul> +<a name="playOneTurn-java.lang.String-info1.network.Game-info1.network.Player-info1.ships.ICoord-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>playOneTurn</h4> +<pre>public static int playOneTurn(java.lang.String baseurl, + <a href="../../info1/network/Game.html" title="class in info1.network">Game</a> game, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player, + <a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> shoot) + throws com.mashape.unirest.http.exceptions.UnirestException, + <a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></pre> +<div class="block">permet de jouer un tour, c'est-à-dire d'effectuer un tir</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dd><code>game</code> - la partie initialisée</dd> +<dd><code>player</code> - le joueur</dd> +<dd><code>shoot</code> - les coordonnées du tir à effectuer</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>-10 si ce n'est pas à mon tour de jouer ; + 0 si le tir ne touche aucun navire adverse ; + 1 si le tir touche un navire adverse ; + 10 si le tir coule un navire adverse ; + 100 si la partie est gagnée, cad si le tir a coulé le dernier navire adverse</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +<dd><code><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></code> - si les coordonnées du tir sont incorrectes</dd> +</dl> +</li> +</ul> +<a name="suscribeNewPlayer-java.lang.String-info1.network.Player-"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>suscribeNewPlayer</h4> +<pre>public static boolean suscribeNewPlayer(java.lang.String baseurl, + <a href="../../info1/network/Player.html" title="class in info1.network">Player</a> player) + throws com.mashape.unirest.http.exceptions.UnirestException</pre> +<div class="block">inscrit un nouveau joueur sur le serveur</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>baseurl</code> - l'url du serveur</dd> +<dd><code>player</code> - le joueur à inscrire</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si l'inscription s'est correctement effectuée ; false si le joueur est déjà inscrit</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>com.mashape.unirest.http.exceptions.UnirestException</code> - si la requete au serveur n'est pas possible</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/network/Player.html" title="class in info1.network"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Network.html" target="_top">Frames</a></li> +<li><a href="Network.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/network/Player.html b/documentation/javadoc/info1/network/Player.html new file mode 100644 index 0000000000000000000000000000000000000000..a675576565e5f94f52187bd5f8aeb0fa68ffba93 --- /dev/null +++ b/documentation/javadoc/info1/network/Player.html @@ -0,0 +1,348 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Player</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Player"; + } + } + catch(err) { + } +//--> +var methods = {"i0":10,"i1":10,"i2":10,"i3":10}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Player.html" target="_top">Frames</a></li> +<li><a href="Player.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.network</div> +<h2 title="Class Player" class="title">Class Player</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>info1.network.Player</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public class <span class="typeNameLabel">Player</span> +extends java.lang.Object</pre> +<div class="block">classe définissant un "joueur" coté serveur</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/network/Player.html#Player-java.lang.String-">Player</a></span>(java.lang.String name)</code> +<div class="block">construit un objet Player</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>org.json.JSONObject</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Player.html#asJSON--">asJSON</a></span>()</code> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON de la forme {"nom":"'player_name'"}</div> +</td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Player.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object o)</code> +<div class="block">vérifie l'égalité</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Player.html#getName--">getName</a></span>()</code> </td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/network/Player.html#toString--">toString</a></span>()</code> </td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="Player-java.lang.String-"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>Player</h4> +<pre>public Player(java.lang.String name)</pre> +<div class="block">construit un objet Player</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>name</code> - le nom du joueur</dd> +</dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="asJSON--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>asJSON</h4> +<pre>public org.json.JSONObject asJSON()</pre> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON de la forme {"nom":"'player_name'"}</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une représentation JSON de l'objet courant</dd> +</dl> +</li> +</ul> +<a name="equals-java.lang.Object-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>public boolean equals(java.lang.Object o)</pre> +<div class="block">vérifie l'égalité</div> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>equals</code> in class <code>java.lang.Object</code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>o</code> - un objet quelconque</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si o est égal à l'objet courant</dd> +</dl> +</li> +</ul> +<a name="getName--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getName</h4> +<pre>public java.lang.String getName()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>le nom du joueur</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>toString</h4> +<pre>public java.lang.String toString()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>toString</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une chaine de caractères représentant l'objet courant</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/Player.html" target="_top">Frames</a></li> +<li><a href="Player.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/network/package-frame.html b/documentation/javadoc/info1/network/package-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..b2582cc1bef9dbeb4d8f288e069e8247c47cbb9f --- /dev/null +++ b/documentation/javadoc/info1/network/package-frame.html @@ -0,0 +1,26 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.network</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<h1 class="bar"><a href="../../info1/network/package-summary.html" target="classFrame">info1.network</a></h1> +<div class="indexContainer"> +<h2 title="Classes">Classes</h2> +<ul title="Classes"> +<li><a href="Game.html" title="class in info1.network" target="classFrame">Game</a></li> +<li><a href="Network.html" title="class in info1.network" target="classFrame">Network</a></li> +<li><a href="Player.html" title="class in info1.network" target="classFrame">Player</a></li> +</ul> +<h2 title="Exceptions">Exceptions</h2> +<ul title="Exceptions"> +<li><a href="BadIdException.html" title="class in info1.network" target="classFrame">BadIdException</a></li> +</ul> +</div> +</body> +</html> diff --git a/documentation/javadoc/info1/network/package-summary.html b/documentation/javadoc/info1/network/package-summary.html new file mode 100644 index 0000000000000000000000000000000000000000..0b83773874bb0abe6db9bdb772dc3f01acb07c2d --- /dev/null +++ b/documentation/javadoc/info1/network/package-summary.html @@ -0,0 +1,169 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.network</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="info1.network"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li class="navBarCell1Rev">Package</li> +<li>Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Package</li> +<li><a href="../../info1/ships/package-summary.html">Next Package</a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Package" class="title">Package info1.network</h1> +</div> +<div class="contentContainer"> +<ul class="blockList"> +<li class="blockList"> +<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> +<caption><span>Class Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Class</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/network/Game.html" title="class in info1.network">Game</a></td> +<td class="colLast"> +<div class="block">Classe définissant une "partie" coté serveur</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../info1/network/Network.html" title="class in info1.network">Network</a></td> +<td class="colLast"> +<div class="block">Classe Network qui défini les méthodes de communication avec le serveur</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/network/Player.html" title="class in info1.network">Player</a></td> +<td class="colLast"> +<div class="block">classe définissant un "joueur" coté serveur</div> +</td> +</tr> +</tbody> +</table> +</li> +<li class="blockList"> +<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation"> +<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Exception</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/network/BadIdException.html" title="class in info1.network">BadIdException</a></td> +<td class="colLast"> +<div class="block">Exception levée si l'id passé lors da construction d'une partie est incorrect</div> +</td> +</tr> +</tbody> +</table> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li class="navBarCell1Rev">Package</li> +<li>Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Package</li> +<li><a href="../../info1/ships/package-summary.html">Next Package</a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/network/package-tree.html b/documentation/javadoc/info1/network/package-tree.html new file mode 100644 index 0000000000000000000000000000000000000000..bd3bc1a927c9df46439b629e9bedfe3178ebb8c9 --- /dev/null +++ b/documentation/javadoc/info1/network/package-tree.html @@ -0,0 +1,144 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.network Class Hierarchy</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="info1.network Class Hierarchy"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li><a href="../../info1/ships/package-tree.html">Next</a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">Hierarchy For Package info1.network</h1> +<span class="packageHierarchyLabel">Package Hierarchies:</span> +<ul class="horizontal"> +<li><a href="../../overview-tree.html">All Packages</a></li> +</ul> +</div> +<div class="contentContainer"> +<h2 title="Class Hierarchy">Class Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">info1.network.<a href="../../info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Game</span></a></li> +<li type="circle">info1.network.<a href="../../info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Network</span></a></li> +<li type="circle">info1.network.<a href="../../info1/network/Player.html" title="class in info1.network"><span class="typeNameLink">Player</span></a></li> +<li type="circle">java.lang.Throwable (implements java.io.Serializable) +<ul> +<li type="circle">java.lang.Exception +<ul> +<li type="circle">info1.network.<a href="../../info1/network/BadIdException.html" title="class in info1.network"><span class="typeNameLink">BadIdException</span></a></li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li><a href="../../info1/ships/package-tree.html">Next</a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/network/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/BadCoordException.html b/documentation/javadoc/info1/ships/BadCoordException.html new file mode 100644 index 0000000000000000000000000000000000000000..1f75210211012f57521a27d861c68798d73bcaf0 --- /dev/null +++ b/documentation/javadoc/info1/ships/BadCoordException.html @@ -0,0 +1,264 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>BadCoordException</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="BadCoordException"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/BadCoordException.html" target="_top">Frames</a></li> +<li><a href="BadCoordException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Class BadCoordException" class="title">Class BadCoordException</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.lang.Throwable</li> +<li> +<ul class="inheritance"> +<li>java.lang.Exception</li> +<li> +<ul class="inheritance"> +<li>info1.ships.BadCoordException</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Serializable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="typeNameLabel">BadCoordException</span> +extends java.lang.Exception</pre> +<div class="block">Exception levée si l'on tente de fabriquer une coordonnée alphanumérique à partir d'une chaine + de caractères incorrecte</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../serialized-form.html#info1.ships.BadCoordException">Serialized Form</a></dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/BadCoordException.html#BadCoordException--">BadCoordException</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Throwable"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Throwable</h3> +<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="BadCoordException--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>BadCoordException</h4> +<pre>public BadCoordException()</pre> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/BadCoordException.html" target="_top">Frames</a></li> +<li><a href="BadCoordException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/CoordsBadShipException.html b/documentation/javadoc/info1/ships/CoordsBadShipException.html new file mode 100644 index 0000000000000000000000000000000000000000..f39488b7f37dad0ea5014c6ed7dca7620a4d1844 --- /dev/null +++ b/documentation/javadoc/info1/ships/CoordsBadShipException.html @@ -0,0 +1,265 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>CoordsBadShipException</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="CoordsBadShipException"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/CoordsBadShipException.html" target="_top">Frames</a></li> +<li><a href="CoordsBadShipException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Class CoordsBadShipException" class="title">Class CoordsBadShipException</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.lang.Throwable</li> +<li> +<ul class="inheritance"> +<li>java.lang.Exception</li> +<li> +<ul class="inheritance"> +<li>info1.ships.CoordsBadShipException</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Serializable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="typeNameLabel">CoordsBadShipException</span> +extends java.lang.Exception</pre> +<div class="block">Exception levée à la création d'un bateau si les coordonnées + du bateau ne définissent pas un bateau correct : + une ligne, une colonne, de la bonne taille, etc.</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../serialized-form.html#info1.ships.CoordsBadShipException">Serialized Form</a></dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/CoordsBadShipException.html#CoordsBadShipException--">CoordsBadShipException</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Throwable"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Throwable</h3> +<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="CoordsBadShipException--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>CoordsBadShipException</h4> +<pre>public CoordsBadShipException()</pre> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/CoordsBadShipException.html" target="_top">Frames</a></li> +<li><a href="CoordsBadShipException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/ICoord.html b/documentation/javadoc/info1/ships/ICoord.html new file mode 100644 index 0000000000000000000000000000000000000000..e4bbf748e5ac175754751413fc1c30983dc9ce3c --- /dev/null +++ b/documentation/javadoc/info1/ships/ICoord.html @@ -0,0 +1,390 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>ICoord</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="ICoord"; + } + } + catch(err) { + } +//--> +var methods = {"i0":18,"i1":18,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/ICoord.html" target="_top">Frames</a></li> +<li><a href="ICoord.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Interface ICoord" class="title">Interface ICoord</h2> +</div> +<div class="contentContainer"> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Superinterfaces:</dt> +<dd>java.lang.Comparable<<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a>></dd> +</dl> +<hr> +<br> +<pre>public interface <span class="typeNameLabel">ICoord</span> +extends java.lang.Comparable<<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a>></pre> +<div class="block">ICoord défini une interface pour manipuler des coordonnées alphanumériques comme "A1", "B6", "J3", etc. + Le premier caractère défini la coordonnée X (de A à J) avec la correspondance suivante : + A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10 + Le second caractère défini la coordonnée Y (de 1 à 10)</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>default org.json.JSONObject</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#asJSON--">asJSON</a></span>()</code> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +</td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>default int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#compareTo-info1.ships.ICoord-">compareTo</a></span>(<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> coord)</code> +<div class="block">compare l'objet courant à l'ojet coord</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object o)</code> +<div class="block">vérifie l'égalité</div> +</td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code>char</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#getAlphaX--">getAlphaX</a></span>()</code> +<div class="block">donne la coordonnée X sous forme alphabétique</div> +</td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#getX--">getX</a></span>()</code> +<div class="block">donne la coordonnée X sous forme numérique, avec la correspondance suivante : + A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10</div> +</td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#getY--">getY</a></span>()</code> +<div class="block">donne la coordonnée Y sous forme numérique</div> +</td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#hashCode--">hashCode</a></span>()</code> </td> +</tr> +<tr id="i7" class="rowColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ICoord.html#toString--">toString</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="asJSON--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>asJSON</h4> +<pre>default org.json.JSONObject asJSON()</pre> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une représentation JSON de l'objet courant</dd> +</dl> +</li> +</ul> +<a name="compareTo-info1.ships.ICoord-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compareTo</h4> +<pre>default int compareTo(<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> coord)</pre> +<div class="block">compare l'objet courant à l'ojet coord</div> +<dl> +<dt><span class="overrideSpecifyLabel">Specified by:</span></dt> +<dd><code>compareTo</code> in interface <code>java.lang.Comparable<<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a>></code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>coord</code> - une autre coordonnée</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un entier positif si l'objet courant est plus grand que coord ; + 0 si coord = l'objet courant ; + un entier négatif l'objet courant plus petit que coord</dd> +</dl> +</li> +</ul> +<a name="equals-java.lang.Object-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>boolean equals(java.lang.Object o)</pre> +<div class="block">vérifie l'égalité</div> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>equals</code> in class <code>java.lang.Object</code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>o</code> - un objet quelconque</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si o est égal à l'objet courant</dd> +</dl> +</li> +</ul> +<a name="getAlphaX--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getAlphaX</h4> +<pre>char getAlphaX()</pre> +<div class="block">donne la coordonnée X sous forme alphabétique</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>le caractère représentant la coordonnée X</dd> +</dl> +</li> +</ul> +<a name="getX--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getX</h4> +<pre>int getX()</pre> +<div class="block">donne la coordonnée X sous forme numérique, avec la correspondance suivante : + A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 10</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>l'entier représentant la coordonnée X</dd> +</dl> +</li> +</ul> +<a name="getY--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getY</h4> +<pre>int getY()</pre> +<div class="block">donne la coordonnée Y sous forme numérique</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>l'entier représentant la coordonnée Y</dd> +</dl> +</li> +</ul> +<a name="hashCode--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>hashCode</h4> +<pre>int hashCode()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un entier "unique" représentant l'objet courant</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>toString</h4> +<pre>java.lang.String toString()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>toString</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une chaine de caractères représentant l'objet courant + sous la forme saisie à la création : "A1", "B6", "J3", etc.</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/ICoord.html" target="_top">Frames</a></li> +<li><a href="ICoord.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/INavyFleet.html b/documentation/javadoc/info1/ships/INavyFleet.html new file mode 100644 index 0000000000000000000000000000000000000000..b85db54b9ed8fda187c681d7e13138e2655c00dc --- /dev/null +++ b/documentation/javadoc/info1/ships/INavyFleet.html @@ -0,0 +1,395 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>INavyFleet</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="INavyFleet"; + } + } + catch(err) { + } +//--> +var methods = {"i0":6,"i1":18,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/INavyFleet.html" target="_top">Frames</a></li> +<li><a href="INavyFleet.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Interface INavyFleet" class="title">Interface INavyFleet</h2> +</div> +<div class="contentContainer"> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<hr> +<br> +<pre>public interface <span class="typeNameLabel">INavyFleet</span></pre> +<div class="block">interface définissant les fonctionnalités d'une flotte de navires</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#add-info1.ships.IShip-">add</a></span>(<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a> IShip)</code> </td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>default org.json.JSONArray</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#asJSON--">asJSON</a></span>()</code> +<div class="block">donne une représentation de l'objet courant sous la forme d'un tableau JSON</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>java.util.List<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#getShips--">getShips</a></span>()</code> +<div class="block">donne la liste triée de tous les bateaux de la flotte</div> +</td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code>java.util.Set<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#getShips-info1.ships.ShipCategory-">getShips</a></span>(<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> shipCategory)</code> +<div class="block">donne l'ensemble de tous les bateaux d'une catégorie donnée</div> +</td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#isBelgianConfiguration--">isBelgianConfiguration</a></span>()</code> +<div class="block">indique si la flotte est dans la configuration "belge" : + 1 cuirassé, 2 croiseurs, 3 torpilleurs, 4 sous-marins</div> +</td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#isComplete--">isComplete</a></span>()</code> </td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#isFrenchConfiguration--">isFrenchConfiguration</a></span>()</code> +<div class="block">indique si la flotte est dans la configuration "française" : + 1 porte-avion, 1 cuirassé, 2 croiseurs, 2 torpilleurs, 1 sous-marin</div> +</td> +</tr> +<tr id="i7" class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#remainingSize--">remainingSize</a></span>()</code> +<div class="block">au départ la taille d'une flotte est de 20 ; plus elle contient de navires, plus sa taille restante diminue</div> +</td> +</tr> +<tr id="i8" class="altColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/INavyFleet.html#toString--">toString</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="add-info1.ships.IShip-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>add</h4> +<pre>int add(<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a> IShip)</pre> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>IShip</code> - le bateau à ajouter à la flotte</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>0 si le bateau est correctement ajouté + -1 si le bateau est déjà présent dans la flotte + -2 si la taille du bateau dépasse la place restante dans la flotte + -3 si le nouveau bateau est positionné sur un autre bateau de la flotte</dd> +</dl> +</li> +</ul> +<a name="asJSON--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>asJSON</h4> +<pre>default org.json.JSONArray asJSON()</pre> +<div class="block">donne une représentation de l'objet courant sous la forme d'un tableau JSON</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une représentation JSON de l'objet courant</dd> +</dl> +</li> +</ul> +<a name="getShips--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getShips</h4> +<pre>java.util.List<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>> getShips()</pre> +<div class="block">donne la liste triée de tous les bateaux de la flotte</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une liste de bateaux</dd> +</dl> +</li> +</ul> +<a name="getShips-info1.ships.ShipCategory-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getShips</h4> +<pre>java.util.Set<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>> getShips(<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> shipCategory)</pre> +<div class="block">donne l'ensemble de tous les bateaux d'une catégorie donnée</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>shipCategory</code> - la catégorie de bateaux à considérer</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un ensemble de bateaux</dd> +</dl> +</li> +</ul> +<a name="isBelgianConfiguration--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isBelgianConfiguration</h4> +<pre>boolean isBelgianConfiguration()</pre> +<div class="block">indique si la flotte est dans la configuration "belge" : + 1 cuirassé, 2 croiseurs, 3 torpilleurs, 4 sous-marins</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si la flotte est dans la configuration "belge"</dd> +</dl> +</li> +</ul> +<a name="isComplete--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isComplete</h4> +<pre>boolean isComplete()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si la flotte est complete</dd> +</dl> +</li> +</ul> +<a name="isFrenchConfiguration--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isFrenchConfiguration</h4> +<pre>boolean isFrenchConfiguration()</pre> +<div class="block">indique si la flotte est dans la configuration "française" : + 1 porte-avion, 1 cuirassé, 2 croiseurs, 2 torpilleurs, 1 sous-marin</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si la flotte est dans la configuration "française"</dd> +</dl> +</li> +</ul> +<a name="remainingSize--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>remainingSize</h4> +<pre>int remainingSize()</pre> +<div class="block">au départ la taille d'une flotte est de 20 ; plus elle contient de navires, plus sa taille restante diminue</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>la taille restante de la flotte</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>toString</h4> +<pre>java.lang.String toString()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>toString</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une chaine de caractères représentant l'objet courant</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/INavyFleet.html" target="_top">Frames</a></li> +<li><a href="INavyFleet.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/IShip.html b/documentation/javadoc/info1/ships/IShip.html new file mode 100644 index 0000000000000000000000000000000000000000..50c5b8edfe56995ebb42d7d3d4c7819683323aa4 --- /dev/null +++ b/documentation/javadoc/info1/ships/IShip.html @@ -0,0 +1,435 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>IShip</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="IShip"; + } + } + catch(err) { + } +//--> +var methods = {"i0":18,"i1":18,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6}; +var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/IShip.html" target="_top">Frames</a></li> +<li><a href="IShip.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Interface IShip" class="title">Interface IShip</h2> +</div> +<div class="contentContainer"> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Superinterfaces:</dt> +<dd>java.lang.Comparable<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>></dd> +</dl> +<hr> +<br> +<pre>public interface <span class="typeNameLabel">IShip</span> +extends java.lang.Comparable<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>></pre> +<div class="block">interface décrivant les fonctionnalités d'un navire</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>default org.json.JSONObject</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#asJSON--">asJSON</a></span>()</code> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +</td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>default int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#compareTo-info1.ships.IShip-">compareTo</a></span>(<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a> autre)</code> +<div class="block">compare le bateau courant avec le bateau autre + un bateau est plus grand qu'un autre si sa taille est plus grande, + sinon si son nom est plus grand (alphabétiquement parlant), + sinon si sa coordonnée de proue est plus grande, + sinon si sa coordonnée de poupe est plus grande</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object o)</code> +<div class="block">vérifie l'égalité</div> +</td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code><a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getBack--">getBack</a></span>()</code> </td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getCategory--">getCategory</a></span>()</code> </td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code>java.util.List<<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a>></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getCoords--">getCoords</a></span>()</code> </td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code><a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getFront--">getFront</a></span>()</code> </td> +</tr> +<tr id="i7" class="rowColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getName--">getName</a></span>()</code> </td> +</tr> +<tr id="i8" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#getSize--">getSize</a></span>()</code> </td> +</tr> +<tr id="i9" class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#hashCode--">hashCode</a></span>()</code> </td> +</tr> +<tr id="i10" class="altColor"> +<td class="colFirst"><code>java.lang.String</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/IShip.html#toString--">toString</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="asJSON--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>asJSON</h4> +<pre>default org.json.JSONObject asJSON()</pre> +<div class="block">donne une représentation de l'objet courant sous la forme d'un objet JSON</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une représentation JSON de l'objet courant</dd> +</dl> +</li> +</ul> +<a name="compareTo-info1.ships.IShip-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>compareTo</h4> +<pre>default int compareTo(<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a> autre)</pre> +<div class="block">compare le bateau courant avec le bateau autre + un bateau est plus grand qu'un autre si sa taille est plus grande, + sinon si son nom est plus grand (alphabétiquement parlant), + sinon si sa coordonnée de proue est plus grande, + sinon si sa coordonnée de poupe est plus grande</div> +<dl> +<dt><span class="overrideSpecifyLabel">Specified by:</span></dt> +<dd><code>compareTo</code> in interface <code>java.lang.Comparable<<a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a>></code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>autre</code> - un autre bateau</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un entier positif si le bateau courant plus grand que l'autre bateau ; + 0 si autre = bateau courant ; + un entier négatif le bateau est plus petit que l'autre bateau</dd> +</dl> +</li> +</ul> +<a name="equals-java.lang.Object-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>boolean equals(java.lang.Object o)</pre> +<div class="block">vérifie l'égalité</div> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>equals</code> in class <code>java.lang.Object</code></dd> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>o</code> - un objet quelconque</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>true si o est égal à l'objet courant</dd> +</dl> +</li> +</ul> +<a name="getBack--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getBack</h4> +<pre><a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> getBack()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne la coordonnée alphanumértique de la poupe du bateau</dd> +</dl> +</li> +</ul> +<a name="getCategory--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getCategory</h4> +<pre><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> getCategory()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>la classe du bateau</dd> +</dl> +</li> +</ul> +<a name="getCoords--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getCoords</h4> +<pre>java.util.List<<a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a>> getCoords()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne la liste de toutes les coordonnées composant le bateau, + de la coordonnée de proue, jusqu'à celle de poupe</dd> +</dl> +</li> +</ul> +<a name="getFront--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getFront</h4> +<pre><a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a> getFront()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne la coordonnée alphanumérique de la proue du bateau</dd> +</dl> +</li> +</ul> +<a name="getName--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getName</h4> +<pre>java.lang.String getName()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne le nom du bateau</dd> +</dl> +</li> +</ul> +<a name="getSize--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getSize</h4> +<pre>int getSize()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne la taille du bateau</dd> +</dl> +</li> +</ul> +<a name="hashCode--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>hashCode</h4> +<pre>int hashCode()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>un entier "unique" représentant l'objet courant</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>toString</h4> +<pre>java.lang.String toString()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code>toString</code> in class <code>java.lang.Object</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>une chaine de caractères représentant l'objet courant</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/IShip.html" target="_top">Frames</a></li> +<li><a href="IShip.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/ShipCategory.html b/documentation/javadoc/info1/ships/ShipCategory.html new file mode 100644 index 0000000000000000000000000000000000000000..8317d146169c1319fc5a487ee197aea6627ad336 --- /dev/null +++ b/documentation/javadoc/info1/ships/ShipCategory.html @@ -0,0 +1,412 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>ShipCategory</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="ShipCategory"; + } + } + catch(err) { + } +//--> +var methods = {"i0":10,"i1":9,"i2":9}; +var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/ShipCategory.html" target="_top">Frames</a></li> +<li><a href="ShipCategory.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li><a href="#enum.constant.summary">Enum Constants</a> | </li> +<li>Field | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#enum.constant.detail">Enum Constants</a> | </li> +<li>Field | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Enum ShipCategory" class="title">Enum ShipCategory</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.lang.Enum<<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a>></li> +<li> +<ul class="inheritance"> +<li>info1.ships.ShipCategory</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Serializable, java.lang.Comparable<<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a>></dd> +</dl> +<hr> +<br> +<pre>public enum <span class="typeNameLabel">ShipCategory</span> +extends java.lang.Enum<<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a>></pre> +<div class="block">Enumeration qui défini les différentes catégories de bateaux</div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>1</dd> +<dt><span class="simpleTagLabel">Author:</span></dt> +<dd>lanoix-a</dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== ENUM CONSTANT SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="enum.constant.summary"> +<!-- --> +</a> +<h3>Enum Constant Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation"> +<caption><span>Enum Constants</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Enum Constant and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#AIRCRAFT_CARRIER">AIRCRAFT_CARRIER</a></span></code> +<div class="block">catégorie de bateaux "Porte-avion"</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#BATTLESHIP">BATTLESHIP</a></span></code> +<div class="block">catégorie de bateaux "Cuirassé"</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#CRUISER">CRUISER</a></span></code> +<div class="block">catégorie de bateaux "Croiseur"</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#DESTROYER">DESTROYER</a></span></code> +<div class="block">catégorie de bateaux "Torpilleur"</div> +</td> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#SUBMARINE">SUBMARINE</a></span></code> +<div class="block">catégorie de bateaux "Sous-marin"</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#getSize--">getSize</a></span>()</code> </td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code>static <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String name)</code> +<div class="block">Returns the enum constant of this type with the specified name.</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>static <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a>[]</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../info1/ships/ShipCategory.html#values--">values</a></span>()</code> +<div class="block">Returns an array containing the constants of this enum type, in +the order they are declared.</div> +</td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Enum"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Enum</h3> +<code>compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>getClass, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ ENUM CONSTANT DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="enum.constant.detail"> +<!-- --> +</a> +<h3>Enum Constant Detail</h3> +<a name="AIRCRAFT_CARRIER"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>AIRCRAFT_CARRIER</h4> +<pre>public static final <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> AIRCRAFT_CARRIER</pre> +<div class="block">catégorie de bateaux "Porte-avion"</div> +</li> +</ul> +<a name="BATTLESHIP"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>BATTLESHIP</h4> +<pre>public static final <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> BATTLESHIP</pre> +<div class="block">catégorie de bateaux "Cuirassé"</div> +</li> +</ul> +<a name="CRUISER"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>CRUISER</h4> +<pre>public static final <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> CRUISER</pre> +<div class="block">catégorie de bateaux "Croiseur"</div> +</li> +</ul> +<a name="DESTROYER"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>DESTROYER</h4> +<pre>public static final <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> DESTROYER</pre> +<div class="block">catégorie de bateaux "Torpilleur"</div> +</li> +</ul> +<a name="SUBMARINE"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>SUBMARINE</h4> +<pre>public static final <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> SUBMARINE</pre> +<div class="block">catégorie de bateaux "Sous-marin"</div> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="getSize--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getSize</h4> +<pre>public int getSize()</pre> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>donne la taille associée à la catégorie de bateaux considérée</dd> +</dl> +</li> +</ul> +<a name="valueOf-java.lang.String-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>valueOf</h4> +<pre>public static <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a> valueOf(java.lang.String name)</pre> +<div class="block">Returns the enum constant of this type with the specified name. +The string must match <i>exactly</i> an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>name</code> - the name of the enum constant to be returned.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the enum constant with the specified name</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd> +<dd><code>java.lang.NullPointerException</code> - if the argument is null</dd> +</dl> +</li> +</ul> +<a name="values--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>values</h4> +<pre>public static <a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a>[] values()</pre> +<div class="block">Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +<pre> +for (ShipCategory c : ShipCategory.values()) + System.out.println(c); +</pre></div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>an array containing the constants of this enum type, in the order they are declared</dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li><a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/ShipCategory.html" target="_top">Frames</a></li> +<li><a href="ShipCategory.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li><a href="#enum.constant.summary">Enum Constants</a> | </li> +<li>Field | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#enum.constant.detail">Enum Constants</a> | </li> +<li>Field | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/UncompleteFleetException.html b/documentation/javadoc/info1/ships/UncompleteFleetException.html new file mode 100644 index 0000000000000000000000000000000000000000..8127dc3f4a3d771d918e1fbe0ad08bb15b9bf03f --- /dev/null +++ b/documentation/javadoc/info1/ships/UncompleteFleetException.html @@ -0,0 +1,258 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>UncompleteFleetException</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="UncompleteFleetException"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/UncompleteFleetException.html" target="_top">Frames</a></li> +<li><a href="UncompleteFleetException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">info1.ships</div> +<h2 title="Class UncompleteFleetException" class="title">Class UncompleteFleetException</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li>java.lang.Object</li> +<li> +<ul class="inheritance"> +<li>java.lang.Throwable</li> +<li> +<ul class="inheritance"> +<li>java.lang.Exception</li> +<li> +<ul class="inheritance"> +<li>info1.ships.UncompleteFleetException</li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd>java.io.Serializable</dd> +</dl> +<hr> +<br> +<pre>public class <span class="typeNameLabel">UncompleteFleetException</span> +extends java.lang.Exception</pre> +<dl> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../serialized-form.html#info1.ships.UncompleteFleetException">Serialized Form</a></dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- ======== CONSTRUCTOR SUMMARY ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.summary"> +<!-- --> +</a> +<h3>Constructor Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> +<caption><span>Constructors</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colOne" scope="col">Constructor and Description</th> +</tr> +<tr class="altColor"> +<td class="colOne"><code><span class="memberNameLink"><a href="../../info1/ships/UncompleteFleetException.html#UncompleteFleetException--">UncompleteFleetException</a></span>()</code> </td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Throwable"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Throwable</h3> +<code>addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString</code></li> +</ul> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.Object</h3> +<code>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ========= CONSTRUCTOR DETAIL ======== --> +<ul class="blockList"> +<li class="blockList"><a name="constructor.detail"> +<!-- --> +</a> +<h3>Constructor Detail</h3> +<a name="UncompleteFleetException--"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>UncompleteFleetException</h4> +<pre>public UncompleteFleetException()</pre> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">Prev Class</span></a></li> +<li>Next Class</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/UncompleteFleetException.html" target="_top">Frames</a></li> +<li><a href="UncompleteFleetException.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li>Field | </li> +<li><a href="#constructor.summary">Constr</a> | </li> +<li><a href="#methods.inherited.from.class.java.lang.Throwable">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li>Field | </li> +<li><a href="#constructor.detail">Constr</a> | </li> +<li>Method</li> +</ul> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/package-frame.html b/documentation/javadoc/info1/ships/package-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..adcf725e4f159e1210a97b70c8b2a17d9b5133e3 --- /dev/null +++ b/documentation/javadoc/info1/ships/package-frame.html @@ -0,0 +1,32 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.ships</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<h1 class="bar"><a href="../../info1/ships/package-summary.html" target="classFrame">info1.ships</a></h1> +<div class="indexContainer"> +<h2 title="Interfaces">Interfaces</h2> +<ul title="Interfaces"> +<li><a href="ICoord.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">ICoord</span></a></li> +<li><a href="INavyFleet.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">INavyFleet</span></a></li> +<li><a href="IShip.html" title="interface in info1.ships" target="classFrame"><span class="interfaceName">IShip</span></a></li> +</ul> +<h2 title="Enums">Enums</h2> +<ul title="Enums"> +<li><a href="ShipCategory.html" title="enum in info1.ships" target="classFrame">ShipCategory</a></li> +</ul> +<h2 title="Exceptions">Exceptions</h2> +<ul title="Exceptions"> +<li><a href="BadCoordException.html" title="class in info1.ships" target="classFrame">BadCoordException</a></li> +<li><a href="CoordsBadShipException.html" title="class in info1.ships" target="classFrame">CoordsBadShipException</a></li> +<li><a href="UncompleteFleetException.html" title="class in info1.ships" target="classFrame">UncompleteFleetException</a></li> +</ul> +</div> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/package-summary.html b/documentation/javadoc/info1/ships/package-summary.html new file mode 100644 index 0000000000000000000000000000000000000000..5699bd427d2b655b9aaf3691d4e781481d42092d --- /dev/null +++ b/documentation/javadoc/info1/ships/package-summary.html @@ -0,0 +1,199 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.ships</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="info1.ships"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li class="navBarCell1Rev">Package</li> +<li>Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/package-summary.html">Prev Package</a></li> +<li>Next Package</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Package" class="title">Package info1.ships</h1> +</div> +<div class="contentContainer"> +<ul class="blockList"> +<li class="blockList"> +<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation"> +<caption><span>Interface Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Interface</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/ships/ICoord.html" title="interface in info1.ships">ICoord</a></td> +<td class="colLast"> +<div class="block">ICoord défini une interface pour manipuler des coordonnées alphanumériques comme "A1", "B6", "J3", etc.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships">INavyFleet</a></td> +<td class="colLast"> +<div class="block">interface définissant les fonctionnalités d'une flotte de navires</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/ships/IShip.html" title="interface in info1.ships">IShip</a></td> +<td class="colLast"> +<div class="block">interface décrivant les fonctionnalités d'un navire</div> +</td> +</tr> +</tbody> +</table> +</li> +<li class="blockList"> +<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation"> +<caption><span>Enum Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Enum</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships">ShipCategory</a></td> +<td class="colLast"> +<div class="block">Enumeration qui défini les différentes catégories de bateaux</div> +</td> +</tr> +</tbody> +</table> +</li> +<li class="blockList"> +<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation"> +<caption><span>Exception Summary</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Exception</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/ships/BadCoordException.html" title="class in info1.ships">BadCoordException</a></td> +<td class="colLast"> +<div class="block">Exception levée si l'on tente de fabriquer une coordonnée alphanumérique à partir d'une chaine + de caractères incorrecte</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships">CoordsBadShipException</a></td> +<td class="colLast"> +<div class="block">Exception levée à la création d'un bateau si les coordonnées + du bateau ne définissent pas un bateau correct : + une ligne, une colonne, de la bonne taille, etc.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships">UncompleteFleetException</a></td> +<td class="colLast"> </td> +</tr> +</tbody> +</table> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li class="navBarCell1Rev">Package</li> +<li>Class</li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/package-summary.html">Prev Package</a></li> +<li>Next Package</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/package-summary.html" target="_top">Frames</a></li> +<li><a href="package-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/info1/ships/package-tree.html b/documentation/javadoc/info1/ships/package-tree.html new file mode 100644 index 0000000000000000000000000000000000000000..182e46615a735e26a01a78355ce38acb685048d4 --- /dev/null +++ b/documentation/javadoc/info1/ships/package-tree.html @@ -0,0 +1,165 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>info1.ships Class Hierarchy</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="info1.ships Class Hierarchy"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/package-tree.html">Prev</a></li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">Hierarchy For Package info1.ships</h1> +<span class="packageHierarchyLabel">Package Hierarchies:</span> +<ul class="horizontal"> +<li><a href="../../overview-tree.html">All Packages</a></li> +</ul> +</div> +<div class="contentContainer"> +<h2 title="Class Hierarchy">Class Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">java.lang.Throwable (implements java.io.Serializable) +<ul> +<li type="circle">java.lang.Exception +<ul> +<li type="circle">info1.ships.<a href="../../info1/ships/BadCoordException.html" title="class in info1.ships"><span class="typeNameLink">BadCoordException</span></a></li> +<li type="circle">info1.ships.<a href="../../info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">CoordsBadShipException</span></a></li> +<li type="circle">info1.ships.<a href="../../info1/ships/UncompleteFleetException.html" title="class in info1.ships"><span class="typeNameLink">UncompleteFleetException</span></a></li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<h2 title="Interface Hierarchy">Interface Hierarchy</h2> +<ul> +<li type="circle">java.lang.Comparable<T> +<ul> +<li type="circle">info1.ships.<a href="../../info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">ICoord</span></a></li> +<li type="circle">info1.ships.<a href="../../info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">IShip</span></a></li> +</ul> +</li> +<li type="circle">info1.ships.<a href="../../info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">INavyFleet</span></a></li> +</ul> +<h2 title="Enum Hierarchy">Enum Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) +<ul> +<li type="circle">info1.ships.<a href="../../info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">ShipCategory</span></a></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../overview-summary.html">Overview</a></li> +<li><a href="package-summary.html">Package</a></li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="../../index-files/index-1.html">Index</a></li> +<li><a href="../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li><a href="../../info1/network/package-tree.html">Prev</a></li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="../../index.html?info1/ships/package-tree.html" target="_top">Frames</a></li> +<li><a href="package-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/overview-frame.html b/documentation/javadoc/overview-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..1dc7fb214d82bfc1038f8c829e97618075dbd050 --- /dev/null +++ b/documentation/javadoc/overview-frame.html @@ -0,0 +1,22 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Overview List</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<div class="indexHeader"><span><a href="allclasses-frame.html" target="packageFrame">All Classes</a></span></div> +<div class="indexContainer"> +<h2 title="Packages">Packages</h2> +<ul title="Packages"> +<li><a href="info1/network/package-frame.html" target="packageFrame">info1.network</a></li> +<li><a href="info1/ships/package-frame.html" target="packageFrame">info1.ships</a></li> +</ul> +</div> +<p> </p> +</body> +</html> diff --git a/documentation/javadoc/overview-summary.html b/documentation/javadoc/overview-summary.html new file mode 100644 index 0000000000000000000000000000000000000000..90a86a6a95501469743c66c60780d059143c087e --- /dev/null +++ b/documentation/javadoc/overview-summary.html @@ -0,0 +1,135 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Overview</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Overview"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li class="navBarCell1Rev">Overview</li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> +<li><a href="overview-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="contentContainer"> +<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Packages table, listing packages, and an explanation"> +<caption><span>Packages</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Package</th> +<th class="colLast" scope="col">Description</th> +</tr> +<tbody> +<tr class="altColor"> +<td class="colFirst"><a href="info1/network/package-summary.html">info1.network</a></td> +<td class="colLast"> </td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><a href="info1/ships/package-summary.html">info1.ships</a></td> +<td class="colLast"> </td> +</tr> +</tbody> +</table> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li class="navBarCell1Rev">Overview</li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-summary.html" target="_top">Frames</a></li> +<li><a href="overview-summary.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/overview-tree.html b/documentation/javadoc/overview-tree.html new file mode 100644 index 0000000000000000000000000000000000000000..99a4c8b24c7ae447b2ddd208c877910ae31e23f6 --- /dev/null +++ b/documentation/javadoc/overview-tree.html @@ -0,0 +1,170 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Class Hierarchy</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Class Hierarchy"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> +<li><a href="overview-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 class="title">Hierarchy For All Packages</h1> +<span class="packageHierarchyLabel">Package Hierarchies:</span> +<ul class="horizontal"> +<li><a href="info1/network/package-tree.html">info1.network</a>, </li> +<li><a href="info1/ships/package-tree.html">info1.ships</a></li> +</ul> +</div> +<div class="contentContainer"> +<h2 title="Class Hierarchy">Class Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">info1.network.<a href="info1/network/Game.html" title="class in info1.network"><span class="typeNameLink">Game</span></a></li> +<li type="circle">info1.network.<a href="info1/network/Network.html" title="class in info1.network"><span class="typeNameLink">Network</span></a></li> +<li type="circle">info1.network.<a href="info1/network/Player.html" title="class in info1.network"><span class="typeNameLink">Player</span></a></li> +<li type="circle">java.lang.Throwable (implements java.io.Serializable) +<ul> +<li type="circle">java.lang.Exception +<ul> +<li type="circle">info1.ships.<a href="info1/ships/BadCoordException.html" title="class in info1.ships"><span class="typeNameLink">BadCoordException</span></a></li> +<li type="circle">info1.network.<a href="info1/network/BadIdException.html" title="class in info1.network"><span class="typeNameLink">BadIdException</span></a></li> +<li type="circle">info1.ships.<a href="info1/ships/CoordsBadShipException.html" title="class in info1.ships"><span class="typeNameLink">CoordsBadShipException</span></a></li> +<li type="circle">info1.ships.<a href="info1/ships/UncompleteFleetException.html" title="class in info1.ships"><span class="typeNameLink">UncompleteFleetException</span></a></li> +</ul> +</li> +</ul> +</li> +</ul> +</li> +</ul> +<h2 title="Interface Hierarchy">Interface Hierarchy</h2> +<ul> +<li type="circle">java.lang.Comparable<T> +<ul> +<li type="circle">info1.ships.<a href="info1/ships/ICoord.html" title="interface in info1.ships"><span class="typeNameLink">ICoord</span></a></li> +<li type="circle">info1.ships.<a href="info1/ships/IShip.html" title="interface in info1.ships"><span class="typeNameLink">IShip</span></a></li> +</ul> +</li> +<li type="circle">info1.ships.<a href="info1/ships/INavyFleet.html" title="interface in info1.ships"><span class="typeNameLink">INavyFleet</span></a></li> +</ul> +<h2 title="Enum Hierarchy">Enum Hierarchy</h2> +<ul> +<li type="circle">java.lang.Object +<ul> +<li type="circle">java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) +<ul> +<li type="circle">info1.ships.<a href="info1/ships/ShipCategory.html" title="enum in info1.ships"><span class="typeNameLink">ShipCategory</span></a></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li class="navBarCell1Rev">Tree</li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?overview-tree.html" target="_top">Frames</a></li> +<li><a href="overview-tree.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/package-list b/documentation/javadoc/package-list new file mode 100644 index 0000000000000000000000000000000000000000..9d5aec62715f06e102d83643c5bca1f0f9cea75a --- /dev/null +++ b/documentation/javadoc/package-list @@ -0,0 +1,2 @@ +info1.network +info1.ships diff --git a/documentation/javadoc/script.js b/documentation/javadoc/script.js new file mode 100644 index 0000000000000000000000000000000000000000..b34635693143ac308ba6d22c29554e5631f64b74 --- /dev/null +++ b/documentation/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>"; + } + } +} diff --git a/documentation/javadoc/serialized-form.html b/documentation/javadoc/serialized-form.html new file mode 100644 index 0000000000000000000000000000000000000000..aec183b93f1afd56b55674d07640e6a87d8e91f2 --- /dev/null +++ b/documentation/javadoc/serialized-form.html @@ -0,0 +1,153 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="fr"> +<head> +<!-- Generated by javadoc (1.8.0_265) on Fri Jun 18 17:16:24 CEST 2021 --> +<title>Serialized Form</title> +<meta name="date" content="2021-06-18"> +<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> +<script type="text/javascript" src="script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="Serialized Form"; + } + } + catch(err) { + } +//--> +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> +<li><a href="serialized-form.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<div class="header"> +<h1 title="Serialized Form" class="title">Serialized Form</h1> +</div> +<div class="serializedFormContainer"> +<ul class="blockList"> +<li class="blockList"> +<h2 title="Package">Package info1.network</h2> +<ul class="blockList"> +<li class="blockList"><a name="info1.network.BadIdException"> +<!-- --> +</a> +<h3>Class <a href="info1/network/BadIdException.html" title="class in info1.network">info1.network.BadIdException</a> extends java.lang.Exception implements Serializable</h3> +</li> +</ul> +</li> +<li class="blockList"> +<h2 title="Package">Package info1.ships</h2> +<ul class="blockList"> +<li class="blockList"><a name="info1.ships.BadCoordException"> +<!-- --> +</a> +<h3>Class <a href="info1/ships/BadCoordException.html" title="class in info1.ships">info1.ships.BadCoordException</a> extends java.lang.Exception implements Serializable</h3> +</li> +<li class="blockList"><a name="info1.ships.CoordsBadShipException"> +<!-- --> +</a> +<h3>Class <a href="info1/ships/CoordsBadShipException.html" title="class in info1.ships">info1.ships.CoordsBadShipException</a> extends java.lang.Exception implements Serializable</h3> +</li> +<li class="blockList"><a name="info1.ships.UncompleteFleetException"> +<!-- --> +</a> +<h3>Class <a href="info1/ships/UncompleteFleetException.html" title="class in info1.ships">info1.ships.UncompleteFleetException</a> extends java.lang.Exception implements Serializable</h3> +</li> +</ul> +</li> +</ul> +</div> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="overview-summary.html">Overview</a></li> +<li>Package</li> +<li>Class</li> +<li><a href="overview-tree.html">Tree</a></li> +<li><a href="index-files/index-1.html">Index</a></li> +<li><a href="help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev</li> +<li>Next</li> +</ul> +<ul class="navList"> +<li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> +<li><a href="serialized-form.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<a name="skip.navbar.bottom"> +<!-- --> +</a></div> +<!-- ======== END OF BOTTOM NAVBAR ======= --> +</body> +</html> diff --git a/documentation/javadoc/stylesheet.css b/documentation/javadoc/stylesheet.css new file mode 100644 index 0000000000000000000000000000000000000000..98055b22d6d5bed7792d6857aa760cf914c62653 --- /dev/null +++ b/documentation/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/documentation/package_network.png b/documentation/package_network.png new file mode 100644 index 0000000000000000000000000000000000000000..6dd3022395777c757e161907212ed8e1a1d1e6aa Binary files /dev/null and b/documentation/package_network.png differ diff --git a/documentation/package_ships.png b/documentation/package_ships.png new file mode 100644 index 0000000000000000000000000000000000000000..c53d051944e62807b00b7e47716adda25e06657d Binary files /dev/null and b/documentation/package_ships.png differ diff --git a/game_infos.json b/game_infos.json new file mode 100644 index 0000000000000000000000000000000000000000..bd12e39c68e9936c6a6d322908446c3841728541 --- /dev/null +++ b/game_infos.json @@ -0,0 +1,6 @@ +{ +"pseudo":177013 + p joue :57 + p gagne :2 + p perdu :8 +} \ No newline at end of file diff --git a/img/.DS_Store b/img/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5656d65335db90f8e01d0522eb6e2688319ad8da Binary files /dev/null and b/img/.DS_Store differ diff --git a/img/.gitkeep b/img/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/img/.jpg b/img/.jpg new file mode 100644 index 0000000000000000000000000000000000000000..07b2f7ce3ea48b65560e0d0b9b7aaaf54f0f698c Binary files /dev/null and b/img/.jpg differ diff --git a/img/French_battleship_Brennus_NH_64443.jpg b/img/French_battleship_Brennus_NH_64443.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fa691b98d4cd09203f61c4b217ede8e3e7662674 Binary files /dev/null and b/img/French_battleship_Brennus_NH_64443.jpg differ diff --git a/img/a.gif b/img/a.gif new file mode 100644 index 0000000000000000000000000000000000000000..4c939dc294a5296ab4dba6437db9cc80a4cb9cb3 Binary files /dev/null and b/img/a.gif differ diff --git a/img/azurain.png b/img/azurain.png new file mode 100644 index 0000000000000000000000000000000000000000..8b37054cd68ce74e26d981282a497393bfa1284d Binary files /dev/null and b/img/azurain.png differ diff --git a/img/crois.png b/img/crois.png new file mode 100644 index 0000000000000000000000000000000000000000..d01f0cbbf670ce24581dd4e014c5c7fbef0bbf37 Binary files /dev/null and b/img/crois.png differ diff --git a/img/cuir.png b/img/cuir.png new file mode 100644 index 0000000000000000000000000000000000000000..f733996d260d9f5071429bcb2701f3edafeb8364 Binary files /dev/null and b/img/cuir.png differ diff --git a/img/gifGoMenu.gif b/img/gifGoMenu.gif new file mode 100644 index 0000000000000000000000000000000000000000..75c58373aaef7eb42ca1ed3d072c0993c49edf19 Binary files /dev/null and b/img/gifGoMenu.gif differ diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7c7f832f0b4c09b74ce7708b09eb61f49cce72cc Binary files /dev/null and b/img/logo.png differ diff --git a/img/loose.gif b/img/loose.gif new file mode 100644 index 0000000000000000000000000000000000000000..4f3ed4dd37f76da0e2a02c7028f93fd06af6493c Binary files /dev/null and b/img/loose.gif differ diff --git a/img/minilog.png b/img/minilog.png new file mode 100644 index 0000000000000000000000000000000000000000..ac12f55d2c34378dd01e19ecdc06c8d757afb29f Binary files /dev/null and b/img/minilog.png differ diff --git a/img/sous.png b/img/sous.png new file mode 100644 index 0000000000000000000000000000000000000000..8653947e915f9fcd4376d18f695b8f14e98c2be1 Binary files /dev/null and b/img/sous.png differ diff --git a/img/torp.png b/img/torp.png new file mode 100644 index 0000000000000000000000000000000000000000..c5afce0f7d38f97949646d7adfbcd846310ac94d Binary files /dev/null and b/img/torp.png differ diff --git a/img/unnamed.jpg b/img/unnamed.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c214fbeccf7a4b3243f19e50f9eab1c0d1443556 Binary files /dev/null and b/img/unnamed.jpg differ diff --git a/img/win.gif b/img/win.gif new file mode 100644 index 0000000000000000000000000000000000000000..ce2b5b18a2ab8ac1c2892aad8175ec38d7f4b998 Binary files /dev/null and b/img/win.gif differ diff --git a/lib/battleship-library-1.0.jar b/lib/battleship-library-1.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..5001f7faa2a8ca4c4a8853bbe6181ee329bf5306 Binary files /dev/null and b/lib/battleship-library-1.0.jar differ diff --git a/sound/bruitPlouf.wav b/sound/bruitPlouf.wav new file mode 100644 index 0000000000000000000000000000000000000000..b923dcd001ca9e4ab1e7c7a7bdef32f0e1979e80 Binary files /dev/null and b/sound/bruitPlouf.wav differ diff --git a/sound/explosionCoule.wav b/sound/explosionCoule.wav new file mode 100644 index 0000000000000000000000000000000000000000..2f6feb37979b61000eee8f942c6e167652bd8f98 Binary files /dev/null and b/sound/explosionCoule.wav differ diff --git a/sound/explosionTouche.wav b/sound/explosionTouche.wav new file mode 100644 index 0000000000000000000000000000000000000000..16017b91fe8aba37aef19622d1368f9204f2d20d Binary files /dev/null and b/sound/explosionTouche.wav differ diff --git a/sound/loseTheme.wav b/sound/loseTheme.wav new file mode 100644 index 0000000000000000000000000000000000000000..29c7c26d3df4878d615456e3224c9b352cfb78e3 Binary files /dev/null and b/sound/loseTheme.wav differ diff --git a/sound/winningTheme.wav b/sound/winningTheme.wav new file mode 100644 index 0000000000000000000000000000000000000000..d1845950258cfd714185043cfe969afeedfa0608 Binary files /dev/null and b/sound/winningTheme.wav differ diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f3a5ec95183024f1a2875e057f52d72512b169f9 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/Appli.java b/src/Appli.java new file mode 100644 index 0000000000000000000000000000000000000000..6403b9b606d2b8f0563c14ccdcf8034be9156621 --- /dev/null +++ b/src/Appli.java @@ -0,0 +1,23 @@ +//import controleur.ButtonCreateFleetControleur; +import controleur.*; +import vue.FenLog; + +public class Appli { + public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0"; + + public static void main(String[] args){ + FenLog l = new FenLog(); + l.setVisible(true); + + //lie les différents listeners aux controleurs + l.fixeListenerCase(new ButtonCreateFleetControleur(l), new ButtonCreateFleetControleur(l)); + l.fixeListenerResetFlotte(new ButtonResetFleetControleur(l)); + l.fixeListenerCase(new ButtonGrilleHautControleur(l)); + l.fixeListenerb(new CoControleur(l, HTTP_LOCALHOST)); + l.fixeListenerJoin(new JoinControleur(l, HTTP_LOCALHOST)); + l.fixeListenerCreate(new CreateControleur(l, HTTP_LOCALHOST)); + l.fixeListenerPos(new PosControleur(l, HTTP_LOCALHOST)); + l.fixeListenerGoMenu(new GoMenuControleur(l)); + l.fixeListenerRefresh(new RefreshControleur(l,HTTP_LOCALHOST)); + } +} diff --git a/src/controleur/.DS_Store b/src/controleur/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..6c3631b877850bf702d92961e2d3b5d72ca53435 Binary files /dev/null and b/src/controleur/.DS_Store differ diff --git a/src/controleur/ButtonCreateFleetControleur.java b/src/controleur/ButtonCreateFleetControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..572f5f4aed24716c34c8b0e45357b164b9b0a7a2 --- /dev/null +++ b/src/controleur/ButtonCreateFleetControleur.java @@ -0,0 +1,431 @@ +package controleur; + +import java.awt.Color; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.concurrent.TimeUnit; + +import javax.swing.ButtonModel; +import javax.swing.JButton; +import javax.swing.JToggleButton; + +import info1.ships.AircraftCarrier; +import info1.ships.BadCoordException; +import info1.ships.Battleship; +import info1.ships.Coord; +import info1.ships.CoordsBadShipException; +import info1.ships.Cruiser; +import info1.ships.Destroyer; +import info1.ships.ICoord; +import info1.ships.IShip; +import info1.ships.Submarine; +import vue.*; + +public class ButtonCreateFleetControleur implements ActionListener, MouseListener{ + private FenLog log; + + + public ButtonCreateFleetControleur(FenLog log) { + this.log=log; + } + + @Override + public void actionPerformed(ActionEvent e) { + JButton recup = (JButton) e.getSource(); + Coord coords; + try { + coords = new Coord(recup.getName()); + + if (log.getTmpCoords().isEmpty() && log.getEtapeCreation() != 6 && log.getEtapeCreation() < 14) { + log.getTmpCoords().add(coords); + log.setMessage("Maintenant selectionnez l'arrière du bateau.", 0); + }else { + switch (log.getEtapeCreation()) { + // FRANCE + case 1: + try { + IShip n_ship = new Battleship("Cuirassé", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du cuirassé réussie. <br> Placez votre premier croiseur (Longueur : 3).", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 4 cases.</p>", 1); + } + break; + case 2: + try { + IShip n_ship = new Cruiser("Croiseur 1", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + if (n_ship.getCoords().size() == 3) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du premier croiseur réussie. <br> Placez votre deuxième croiseur (Longueur : 3).", 0); + log.increaseEtapeCreation(); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 3 cases.</p>", 1); + } + break; + case 3: + try { + IShip n_ship = new Cruiser("Croiseur 2", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + + if (n_ship.getCoords().size() == 3) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du deuxièle croiseur réussie. <br> Placez votre premier destroyeur (Longueur : 2).", 0); + log.increaseEtapeCreation(); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 3 cases.</p>", 1); + } + break; + case 4: + try { + IShip n_ship = new Destroyer("Destroyeur 1", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du premier destroyeur réussie. <br> Placez votre deuxième déstroyeur (Longueur : 2).", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 2 cases.</p>", 1); + } + break; + case 5: + try { + IShip n_ship = new Destroyer("Destroyeur 2", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du deuxième destroyeur. <br> Placez votre sous-marin (longueur : 1).", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 2 cases.</p>", 1); + } + break; + + case 6: + try { + IShip n_ship = new Submarine("Sous marin", coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + log.setMessage("Création du sous-marin réussie. <br> Placez votre porte avion (Longueur : 5).", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 1 cases.</p>", 1); + } + break; + case 7: + try { + IShip n_ship = new AircraftCarrier("Porte avion", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du porte avion réussie.", 0); + + if (log.getFlotte().isFrenchConfiguration()) { + log.setMessage("Votre flotte Française a était créé.", 0); + log.increaseEtapeCreation(); + log.repaint(); + log.goMenu(); + }else { + log.setMessage("Votre flotte Française n'a pas était créé. Veuillez ré-essayer.", 1); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 5 cases.</p>", 1); + } + break; + // BELGIQUE + case 8: + try { + IShip n_ship = new Battleship("Cuirassé", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + + log.setMessage("Création du cuirassé réussie. <br> Placez votre premier croiseur. (Longueur : 3)", 0); + log.increaseEtapeCreation(); + } + + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 4 cases.</p>", 1); + } + break; + + case 9: + try { + IShip n_ship = new Cruiser("Croiseur 1", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (n_ship.getCoords().size() == 3) { + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + this.Colorize(n_ship); + log.setMessage("Création du premier croiseur réussie. <br> Placez votre second croiseur. (Longueur : 3)", 0); + log.increaseEtapeCreation(); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. La création a échoué. Le bateau doit avoir une longueur de 3 cases.</p>", 1); + } + break; + + case 10: + try { + IShip n_ship = new Cruiser("Croiseur 2", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (n_ship.getCoords().size() == 3) { + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + log.setMessage("Création du second croiseur réussie. <br> Placez votre premier torpieur. (Longueur : 2)", 0); + log.increaseEtapeCreation(); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. La création a échoué. Le bateau doit avoir une longueur de 3 cases.</p>", 1); + } + break; + + case 11: + try { + IShip n_ship = new Destroyer("Torpieur 1", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + log.setMessage("Création du premier torpieur réussie. <br> Placez votre second torpieur. (Longueur : 2)", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 2 cases.</p>", 1); + } + break; + + case 12: + try { + IShip n_ship = new Destroyer("Torpieur 2", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + log.setMessage("Création du second torpilleur réussie. <br> Placez votre troisième torpieur. (Longueur : 2)", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 2 cases.</p>", 1); + } + break; + + + case 13: + try { + IShip n_ship = new Destroyer("Torpieur 3", log.getTmpCoords().get(0).toString(), coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + log.setMessage("Création du troisième torpilleur réussie. <br> Placez votre premier sous-marin. (Longueur : 1)", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 2 cases.</p>", 1); + } + break; + + case 14: + try { + IShip n_ship = new Submarine("Sous-marin 1", coords.toString()); + + //if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + + log.setMessage("Création du premier sous-marin réussie. <br> Placez votre second sous-marin. (Longueur : 1)", 0); + log.increaseEtapeCreation(); + //} + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 1 cases.</p>", 1); + } + break; + + case 15: + try { + IShip n_ship = new Submarine("Sous-marin 2", coords.toString()); + + //if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + + log.setMessage("Création du second sous-marin réussie. <br> Placez votre troisème sous-marin. (Longueur : 1)", 0); + log.increaseEtapeCreation(); + //} + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 1 cases.</p>", 1); + } + break; + + + case 16: + try { + IShip n_ship = new Submarine("Sous-marin 3", coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + + log.setMessage("Création du troisième sous-marin réussie. <br> Placez votre quatrième sous-marin. (Longueur : 1)", 0); + log.increaseEtapeCreation(); + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 1 cases.</p>", 1); + } + break; + case 17: + try { + IShip n_ship = new Submarine("Sous-marin 4", coords.toString()); + + if (!isTaken(n_ship)) { + log.getFlotte().add(n_ship); + + this.Colorize(n_ship); + + log.setMessage("Création du quatrième sous-marin réussie.", 0); + log.increaseEtapeCreation(); + + if (log.getFlotte().isBelgianConfiguration()) { + log.setMessage("Votre flotte Belge a était créé. Bonne chance !", 0); + log.increaseEtapeCreation(); + log.repaint(); + log.goMenu(); + }else { + log.setMessage("Votre flotte Belge n'a pas était créé. Veuillez ré-essayer.", 1); + } + } + } + catch(BadCoordException | CoordsBadShipException e1) { + log.setMessage("<p style='color: #e74c3c;'>La création a échoué. Le bateau doit avoir une longueur de 1 cases.</p>", 1); + } + break; + + default: + log.goMenu(); + break; + } + + if (!log.getTmpCoords().isEmpty()) { + log.getTmpCoords().remove(0); + } + } + } catch (BadCoordException e1) { + e1.printStackTrace(); + } + } + + public void Colorize(IShip n_ship ) { + for (ICoord c : n_ship.getCoords()) { + if(c.equals(n_ship.getCoords().get(0))){ + log.getButtonGrilleHaut()[c.getX()-1][c.getY()-1].setBackground(new Color(0x95a5a6)); + } + else { + log.getButtonGrilleHaut()[c.getX()-1][c.getY()-1].setBackground(new Color(0x455A64));; + } + } + } + + @Override + public void mouseEntered(MouseEvent e) { + JButton but = (JButton) e.getSource(); + + if (!but.getBackground().equals(new Color(0x455A64)) && !but.getBackground().equals(new Color(0x95a5a6))) { + but.setBackground(new Color(0x2c3e50)); + } + + } + + @Override + public void mouseExited(MouseEvent e) { + JButton but = (JButton) e.getSource(); + + if (!but.getBackground().equals(new Color(0x455A64)) && !but.getBackground().equals(new Color(0x95a5a6))) { + but.setBackground(new Color(0x2980b9)); + } + } + + public Boolean isTaken(IShip n_ship) { + int t = 0; + Boolean taken = false; + while (taken == false && t < log.getFlotte().getShips().size()) { + for (int h = 0; h < n_ship.getCoords().size(); h++) { + if (log.getFlotte().getShips().get(t).getCoords().contains(n_ship.getCoords().get(h))) { + taken = true; + log.setMessage("<p style='color: orange;'>Les bateaux ne peuvent pas se chevaucher.</p>", 1); + log.getTmpCoords().removeAll(log.getTmpCoords()); + } + } + t++; + } + + return taken; + } + + @Override + public void mouseClicked(MouseEvent e) { + } + + @Override + public void mousePressed(MouseEvent e) { + // TODO Auto-generated method stub + + } + + @Override + public void mouseReleased(MouseEvent e) { + } + +} diff --git a/src/controleur/ButtonGrilleHautControleur.java b/src/controleur/ButtonGrilleHautControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..8c337c71b37ffc24ba2ae84df4a544d1c9e02ed2 --- /dev/null +++ b/src/controleur/ButtonGrilleHautControleur.java @@ -0,0 +1,155 @@ +package controleur; + +import java.awt.event.*; +import java.io.File; +import java.io.IOException; + +import javax.sound.sampled.Clip; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import javax.swing.*; + +import info1.network.Network; +import info1.network.Player; +import info1.ships.Coord; + +import vue.FenLog; + +public class ButtonGrilleHautControleur implements ActionListener{ + + private FenLog log; + public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0"; + private Clip clip; + public ButtonGrilleHautControleur(FenLog log) { + this.log=log; + } + + @Override + public void actionPerformed(ActionEvent e) { + int v = -10; + LocalSave l = new LocalSave("game_infos.json"); + log.disabledButton(); + JButton recup = (JButton) e.getSource(); + Coord coords; + log.setResultatCoup("Chargement du tir..."); + try { + coords = new Coord(recup.getName()); + int t = Network.getInfo(HTTP_LOCALHOST, log.getG(), log.getPL()); + + if(t == -10){ + log.setResultatCoup("L'ennemie prépare son coup"); + } + else if(t == -100) { + log.setResultatCoup("perdu"); + l.adddef(); + log.goEndGame(0); + } + else { + int tour = log.getCompt(); + if(tour > 0 || log.getPL() == log.getG().getGuest()){ + for(Player p : Network.listActivePlayers(HTTP_LOCALHOST)){ + String[] n = p.getName().split(":"); + boolean init = !(log.getPL() == log.getG().getInitiator()); + String s = log.getG().toString()+init+log.getCompt(); + if(n[0] == s){ + log.tir_recu(n[1], recup); + } + } + } + v = Network.playOneTurn(HTTP_LOCALHOST,log.getG(),log.getPL(),coords); + if(v == 0){ + log.setResultatCoup("loupé"); + log.colorizeNone(recup); + try { + File soundFile = new File("sound/bruitPlouf.wav"); //chargement d'un seul son + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); // mise en place du son venant du dossier soundBD + clip = AudioSystem.getClip(); // association de CLIP + clip.open(audioInputStream); //overture du clip audio + clip.start(); + } catch (UnsupportedAudioFileException e1) { + e1.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } catch (LineUnavailableException e3) { + e3.printStackTrace(); + } + } + if(v == 1){ + log.setResultatCoup("touché"); + log.colorizeTouch(recup); + log.setdam(2); + try { + File soundFile = new File("sound/explosionTouche.wav"); //chargement d'un seul son + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); // mise en place du son venant du dossier soundBD + clip = AudioSystem.getClip(); // association de CLIP + clip.open(audioInputStream); //overture du clip audio + clip.start(); + } catch (UnsupportedAudioFileException e1) { + e1.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } catch (LineUnavailableException e3) { + e3.printStackTrace(); + } + } + if(v == 10){ + log.setResultatCoup("coulé"); + log.colorizeCoule(recup); + log.setdam(2); + try { + File soundFile = new File("sound/explosionCoule.wav"); //chargement d'un seul son + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); // mise en place du son venant du dossier soundBD + clip = AudioSystem.getClip(); // association de CLIP + clip.open(audioInputStream); //overture du clip audio + clip.start(); + } catch (UnsupportedAudioFileException e1) { + e1.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } catch (LineUnavailableException e3) { + e3.printStackTrace(); + } + + } + if(v == 100){ + log.colorizeCoule(recup); + log.setResultatCoup("gagné"); + try { + File soundFile = new File("sound/winningTheme.wav"); //chargement d'un seul son + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); // mise en place du son venant du dossier soundBD + clip = AudioSystem.getClip(); // association de CLIP + clip.open(audioInputStream); //overture du clip audio + clip.start(); + } catch (UnsupportedAudioFileException e1) { + e1.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } catch (LineUnavailableException e3) { + e3.printStackTrace(); + } + l.advic(); + log.goEndGame(1); + + } + boolean init = log.getPL() == log.getG().getInitiator(); + String s = log.getG().toString()+init+log.getCompt()+":"+coords.toString(); + Network.suscribeNewPlayer(HTTP_LOCALHOST, new Player(s)); + log.incrCompt(); + + } + + log.enabledButton(); + if(log.getEnnemy() == "..." && log.getPL() == log.getG().getInitiator()){ + log.setEnnemy(log.getG().getGuest().getName()); + } + + } + catch(Exception e1){ + + } + } + +} diff --git a/src/controleur/ButtonResetFleetControleur.java b/src/controleur/ButtonResetFleetControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..411186a83d7cce50c9f9e910c8c58531431fac49 --- /dev/null +++ b/src/controleur/ButtonResetFleetControleur.java @@ -0,0 +1,38 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import vue.FenLog; + +public class ButtonResetFleetControleur implements ActionListener { + private FenLog log; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public ButtonResetFleetControleur(FenLog l) { + this.log = l; + } + + /** + * Reinitialise la flotte au moment du clic sur le bouton + */ + @Override + public void actionPerformed(ActionEvent e) { + log.resetGrilleColorButton(); + + log.getTmpCoords().removeAll(log.getTmpCoords()); + + if (log.getConfig() == 0) { + log.resetEtape(); + }else { + log.resetEtape(); + } + + log.resetFlotte(); + } + +} diff --git a/src/controleur/CoControleur.java b/src/controleur/CoControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..4bb40f814b2af17d2a03ae1d0218a3330416365d --- /dev/null +++ b/src/controleur/CoControleur.java @@ -0,0 +1,59 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JOptionPane; + +import com.mashape.unirest.http.exceptions.UnirestException; + +import vue.FenLog; +import info1.network.Network; +import info1.network.Player; + +public class CoControleur implements ActionListener { + private FenLog log; + private String n; + private LocalSave local_sav = new LocalSave("game_infos.json"); + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public CoControleur(FenLog l, String s){ + this.log = l; + this.n = s; + } + + /** + * Crée un nouveau player au moment du clic sur le bouton + */ + public void actionPerformed(ActionEvent e) { + String t = log.getName(); + if(t.length() <= 25){ + Player p = new Player(t); + log.SetPl(p); + + local_sav.createPseudo(t); + + /*try { + local_sav.getPseudo(); + } catch (IOException e2) { + e2.printStackTrace(); + }*/ + + try { + Network.suscribeNewPlayer(this.n, p); + log.goCreateFlotte(log.getConfig()); + //log.goMenu(); + } catch (UnirestException e1) { + e1.printStackTrace(); + } + } + else{ + JOptionPane.showMessageDialog(null, "Le nom est limité à 25 charactères"); + } + } + +} diff --git a/src/controleur/CreateControleur.java b/src/controleur/CreateControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..0c4369b01338e1cc0a647f21412c9b7d8ebfe3c3 --- /dev/null +++ b/src/controleur/CreateControleur.java @@ -0,0 +1,55 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JOptionPane; + +import com.mashape.unirest.http.exceptions.UnirestException; + +import vue.FenLog; +import info1.network.Game; +import info1.network.*; +import info1.ships.BadCoordException; +import info1.ships.UncompleteFleetException; + +public class CreateControleur implements ActionListener { + private FenLog log; + private String n; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public CreateControleur(FenLog l, String s){ + this.log = l; + this.n = s; + } + + /** + * Créer une game au moment du clic sur le bouton + */ + public void actionPerformed(ActionEvent e) { + if(log.getFlotte() != null){ + try { + Game g = Network.initNewGame(n, log.getPL(), log.getFlotte()); + log.setG(g); + + log.resetGrilleEnnemi(); + + log.goCombat(); + log.setEnnemy("..."); + LocalSave l = new LocalSave("game_infos.json"); + l.addp(); + } catch (UnirestException | UncompleteFleetException | BadCoordException e1) { + e1.printStackTrace(); + } + } + else{ + JOptionPane.showMessageDialog(null, "vous devez definir votre flotte"); + } + + } + +} \ No newline at end of file diff --git a/src/controleur/GoMenuControleur.java b/src/controleur/GoMenuControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..ec591f77ffd2343fb0ab6a553450ce8d7171f9d9 --- /dev/null +++ b/src/controleur/GoMenuControleur.java @@ -0,0 +1,28 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import vue.FenLog; + +public class GoMenuControleur implements ActionListener { + private FenLog log; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public GoMenuControleur(FenLog log) { + this.log = log; + } + + /** + * appelle la méthode goMenu() au moment du clic sur le bouton + */ + @Override + public void actionPerformed(ActionEvent e) { + log.goMenu(); + } + +} diff --git a/src/controleur/JoinControleur.java b/src/controleur/JoinControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..62a86b852193a4f5c9e520cd6d34192ef5eab41b --- /dev/null +++ b/src/controleur/JoinControleur.java @@ -0,0 +1,57 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JOptionPane; + +import com.mashape.unirest.http.exceptions.UnirestException; + +import vue.FenLog; +import info1.network.Game; +import info1.network.*; +import info1.ships.BadCoordException; +import info1.ships.UncompleteFleetException; + +public class JoinControleur implements ActionListener { + private FenLog log; + private String n; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public JoinControleur(FenLog l, String s){ + this.log = l; + this.n = s; + } + + /** + * rejoins une partie au moment du clic sur le bouton + */ + public void actionPerformed(ActionEvent e) { + if(log.getFlotte() != null){ + try { + Game g = log.getSelectGame(); + Network.joinGame(n, g, log.getPL(), log.getFlotte()); + log.setG(g); + + log.resetGrilleEnnemi(); + + log.goCombat(); + LocalSave l = new LocalSave("game_infos.json"); + log.setEnnemy(g.getInitiator().getName()); + l.addp(); + + } catch (UnirestException | UncompleteFleetException | BadCoordException e1) { + e1.printStackTrace(); + } + } + else{ + JOptionPane.showMessageDialog(null, "vous devez definir votre flotte"); + } + + } + +} \ No newline at end of file diff --git a/src/controleur/LocalSave.java b/src/controleur/LocalSave.java new file mode 100644 index 0000000000000000000000000000000000000000..cc8e544fecb2b2a0e8f8765f51de0529da3865cf --- /dev/null +++ b/src/controleur/LocalSave.java @@ -0,0 +1,198 @@ +package controleur; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; + + +public class LocalSave { + private String path; + + public LocalSave(String path) { + this.path = path; + } + + + public static String getInfos(int i) throws Exception { + + try { + BufferedReader in = new BufferedReader(new FileReader("game_infos.json")); + String line; + int j = 0; + while ((line = in.readLine()) != "}") + { + if(i == 1 && j == 1){ + String[] parts = line.split(":"); + in.close(); + return parts[1] ; + } + if(i == 2 && j == 2){ + String[] parts = line.split(":"); + in.close(); + return parts[1] ; + } + if(i == 3 && j == 3){ + String[] parts = line.split(":"); + in.close(); + return parts[1] ; + } + if(i == 4 && j == 4){ + String[] parts = line.split(":"); + in.close(); + return parts[1] ; + } + j++; + } + in.close(); + } catch (FileNotFoundException e) { + + + e.printStackTrace(); + } + return null; + + } + + public void createPseudo(String n_pseudo) { + File file = new File(path); + String j = "0"; + String g = "0"; + String p = "0"; + try { + if(file.exists()){ + j = LocalSave.getInfos(2); + g = LocalSave.getInfos(3); + p = LocalSave.getInfos(4); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + String file_s = "{\n\"pseudo\":"+ n_pseudo+"\n p joue :"+j+"\n p gagne :"+g+"\n p perdu :"+p+"\n}"; + + + try { + if (!file.exists()) + file.createNewFile(); + FileWriter writer = new FileWriter(file); + writer.write(file_s); + writer.flush(); + writer.close(); + } catch (IOException e) { + System.out.println("Erreur: impossible de creer le fichier '"+ path + "'"); + } + } + + public void advic() { + File file = new File(path); + String n = "177013"; + String j = "0"; + String g = "0"; + String p = "0"; + try { + if(file.exists()){ + n = LocalSave.getInfos(1); + j = LocalSave.getInfos(2); + g = LocalSave.getInfos(3); + p = LocalSave.getInfos(4); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + int g1 = Integer.parseInt(g)+1; + + String file_s = "{\n\"pseudo\":"+ n+"\n p joue :"+j+"\n p gagne :"+g1+"\n p perdu :"+p+"\n}"; + + + try { + if (!file.exists()) + file.createNewFile(); + FileWriter writer = new FileWriter(file); + writer.write(file_s); + writer.flush(); + writer.close(); + } catch (IOException e) { + System.out.println("Erreur: impossible de creer le fichier '" + + path + "'"); + } + } + + public void addp() { + File file = new File(path); + String n = "177013"; + String j = "0"; + String g = "0"; + String p = "0"; + try { + if(file.exists()){ + n = LocalSave.getInfos(1); + j = LocalSave.getInfos(2); + g = LocalSave.getInfos(3); + p = LocalSave.getInfos(4); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + int j1 = Integer.parseInt(j)+1; + + String file_s = "{\n\"pseudo\":"+ n+"\n p joue :"+j1+"\n p gagne :"+g+"\n p perdu :"+p+"\n}"; + + + try { + if (!file.exists()) + file.createNewFile(); + FileWriter writer = new FileWriter(file); + writer.write(file_s); + writer.flush(); + writer.close(); + } catch (IOException e) { + System.out.println("Erreur: impossible de creer le fichier '" + + path + "'"); + } + } + + + public void adddef() { + File file = new File(path); + String n = "177013"; + String j = "0"; + String g = "0"; + String p = "0"; + try { + if(file.exists()){ + n = LocalSave.getInfos(1); + j = LocalSave.getInfos(2); + g = LocalSave.getInfos(3); + p = LocalSave.getInfos(4); + } + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + int p1 = Integer.parseInt(p)+1; + + String file_s = "{\n\"pseudo\":"+ n+"\n p joue :"+j+"\n p gagne :"+g+"\n p perdu :"+p1+"\n}"; + + + try { + if (!file.exists()) + file.createNewFile(); + FileWriter writer = new FileWriter(file); + writer.write(file_s); + writer.flush(); + writer.close(); + } catch (IOException e) { + System.out.println("Erreur: impossible de creer le fichier '" + + path + "'"); + } + } +} diff --git a/src/controleur/PosControleur.java b/src/controleur/PosControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..16de7197f8a5d336ce52c65a35c6bfd6523feaba --- /dev/null +++ b/src/controleur/PosControleur.java @@ -0,0 +1,27 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import vue.FenLog; + +public class PosControleur implements ActionListener { + private FenLog log; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public PosControleur(FenLog l, String s){ + this.log = l; + } + + /** + * Crée la flotte au moment du clic sur le bouton + */ + public void actionPerformed(ActionEvent e) { + log.goCreateFlotte(log.getConfig()); + } + +} \ No newline at end of file diff --git a/src/controleur/RefreshControleur.java b/src/controleur/RefreshControleur.java new file mode 100644 index 0000000000000000000000000000000000000000..88ddcd9cb8ecca5c43a27f764ab35844b6c366fb --- /dev/null +++ b/src/controleur/RefreshControleur.java @@ -0,0 +1,27 @@ +package controleur; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import vue.FenLog; + +public class RefreshControleur implements ActionListener { +private FenLog log; + + /** + * + * @param l la vue où se situe le bouton + * @param s l'adresse du serveur + */ + public RefreshControleur(FenLog l,String s){ + this.log = l; + } + + /** + * appelle la methode refreshPartie() de la vue au moment du clic sur le bouton + */ + public void actionPerformed(ActionEvent e) { + log.refreshPartie(); + + } +} diff --git a/src/info1.7z b/src/info1.7z new file mode 100644 index 0000000000000000000000000000000000000000..79881cf1a141007ad1933f67aa53b53d48af0fd7 Binary files /dev/null and b/src/info1.7z differ diff --git a/src/info1.zip b/src/info1.zip new file mode 100644 index 0000000000000000000000000000000000000000..7db454e0633b50dacd053aeff4ad7b0310de97d0 Binary files /dev/null and b/src/info1.zip differ diff --git a/src/info1/ships/AircraftCarrier.java b/src/info1/ships/AircraftCarrier.java new file mode 100644 index 0000000000000000000000000000000000000000..1d6fa9751f4fea508664b41812f8c22a334e9fbe --- /dev/null +++ b/src/info1/ships/AircraftCarrier.java @@ -0,0 +1,19 @@ +package info1.ships; + +/** + * Classe définissant une navire de catégorie "Porte-Avion" (taille 5) + */ + +public class AircraftCarrier extends Ship { + + public AircraftCarrier(String name, String xyFront, String xyBack) + throws BadCoordException, CoordsBadShipException { + super(name, xyFront, xyBack); + } + + @Override + public ShipCategory getCategory() { + return ShipCategory.AIRCRAFT_CARRIER; + } + +} diff --git a/src/info1/ships/Battleship.java b/src/info1/ships/Battleship.java new file mode 100644 index 0000000000000000000000000000000000000000..7cddd6b644d1b51cee286a04bf9fc71e5f74dcde --- /dev/null +++ b/src/info1/ships/Battleship.java @@ -0,0 +1,20 @@ +package info1.ships; + +/** + * classe définissant un navire de catégorie "Cuirassé" (taille 4) + * @author lanoix-a + */ + +public class Battleship extends Ship { + + public Battleship(String name, String xyFront, String xyBack) + throws BadCoordException, CoordsBadShipException { + super(name, xyFront, xyBack); + } + + @Override + public ShipCategory getCategory() { + return ShipCategory.BATTLESHIP; + } + +} diff --git a/src/info1/ships/Coord.java b/src/info1/ships/Coord.java new file mode 100644 index 0000000000000000000000000000000000000000..ed9de4fc972f95218a922c7392fe99a3a8747dc5 --- /dev/null +++ b/src/info1/ships/Coord.java @@ -0,0 +1,167 @@ +package info1.ships; + + +/** + * une implementation de l'interface ICoord manipulant des coordonnées alphanumériques comme "A1", "B6", "J3", etc. + */ + +public class Coord implements ICoord { + + private String xy; + + /** + * NB : LA SIGNATURE DU CONSTRUCTEUR DOIT ETRE RESPECTEE + * + * constructeur d'un objet Coord + * @param xy la coordonnée aphanumérique sous la forme d'une chaine de caractères + * @throws BadCoordException si la chaine de caractère ne permet pas de définir une coordonnée alphanumérique + */ + public Coord(String xy) throws BadCoordException { + CharSequence x = xy.subSequence(0, 1); + CharSequence y = xy.subSequence(1, xy.length()); + + int int_x; + + switch (x.toString()) { + case "A": + int_x = 1; + break; + case "B": + int_x = 2; + break; + case "C": + int_x = 3; + break; + case "D": + int_x = 4; + break; + case "E": + int_x = 5; + break; + case "F": + int_x = 6; + break; + case "G": + int_x = 7; + break; + case "H": + int_x = 8; + break; + case "I": + int_x = 9; + break; + case "J": + int_x = 10; + break; + default: + int_x = 12; + break; + } + + if ((int_x >= 1 && int_x <= 10) && (Integer.parseInt(y.toString()) >= 1 && Integer.parseInt(y.toString()) <= 10)) { + this.xy = xy; + }else { + throw new BadCoordException(); + } + } + + @Override + public char getAlphaX() { + CharSequence c = xy.subSequence(0, 1); + return c.charAt(0); + } + + public static String findAlphaX(int n_x) { + + switch (n_x) { + case 1: + return "A"; + case 2: + return "B"; + case 3: + return "C"; + case 4: + return "D"; + case 5: + return "E"; + case 6: + return "F"; + case 7: + return "G"; + case 8: + return "H"; + case 9: + return "I"; + case 10: + return "J"; + default: + return "O"; + } + } + + @Override + public int getX() { + CharSequence x = xy.subSequence(0, 1); + + switch (x.toString()) { + case "A": + return 1; + case "B": + return 2; + case "C": + return 3; + case "D": + return 4; + case "E": + return 5; + case "F": + return 6; + case "G": + return 7; + case "H": + return 8; + case "I": + return 9; + default: + return 10; + } + } + + @Override + public int getY() { + CharSequence y = xy.subSequence(1, xy.length()); + return Integer.parseInt(y.toString()); + } + + @Override + public String toString() { + return this.xy; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((xy == null) ? 0 : xy.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Coord other = (Coord) obj; + if (xy == null) { + if (other.xy != null) + return false; + } else if (!xy.equals(other.xy)) + return false; + return true; + } + + +} diff --git a/src/info1/ships/Cruiser.java b/src/info1/ships/Cruiser.java new file mode 100644 index 0000000000000000000000000000000000000000..adcdf50d69447fd3166b1591cb331b6b09f9850f --- /dev/null +++ b/src/info1/ships/Cruiser.java @@ -0,0 +1,21 @@ +package info1.ships; + + +/** + * Classe définissant un navire de catégorie "Croiseur" (taille 3) + * @author lanoix-a + */ + +public class Cruiser extends Ship { + + public Cruiser(String name, String xyFront, String xyBack) + throws BadCoordException, CoordsBadShipException { + super(name, xyFront, xyBack); + } + + @Override + public ShipCategory getCategory() { + return ShipCategory.CRUISER; + } + +} diff --git a/src/info1/ships/Destroyer.java b/src/info1/ships/Destroyer.java new file mode 100644 index 0000000000000000000000000000000000000000..902599049e467865a42ff96bab2716e1699243ea --- /dev/null +++ b/src/info1/ships/Destroyer.java @@ -0,0 +1,21 @@ +package info1.ships; + + +/** + * classe définissant un navire de catégorie "Tropilleur" (taille 2) + * @author lanoix-a + */ + +public class Destroyer extends Ship { + + public Destroyer(String name, String xyFront, String xyBack) + throws BadCoordException, CoordsBadShipException { + super(name, xyFront, xyBack); + } + + @Override + public ShipCategory getCategory() { + return ShipCategory.DESTROYER; + } + +} diff --git a/src/info1/ships/NavyFleet.java b/src/info1/ships/NavyFleet.java new file mode 100644 index 0000000000000000000000000000000000000000..8895b1d1d387a9308bc234703a5cae32d13fb7e4 --- /dev/null +++ b/src/info1/ships/NavyFleet.java @@ -0,0 +1,133 @@ +package info1.ships; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + + +/** + * Classe définissant une flotte de navires + */ + +public class NavyFleet implements INavyFleet { + + private int size; + private List<IShip> flotte; + + /** + * NB : LA SIGNATURE DU CONSTRUCTEUR DOIT ETRE RESPECTEE + * + * Construit une nouvelle flotte + */ + public NavyFleet() { + this.size = 20; + flotte=new ArrayList<IShip>(); + } + + @Override + public int remainingSize() { + return this.size; + } + + @Override + public boolean isComplete() { + return size==0; + } + + + @Override + public int add(IShip IShip) { + if(this.flotte.contains(IShip)){ + return -1; + } + else{ + if(IShip.getSize() > this.size){ + return -2; + } + else{ + for(IShip b : this.flotte){ + for(ICoord c1 : b.getCoords()){ + for(ICoord c2: IShip.getCoords()) { + if(c1.equals(c2)) { + return -3; + } + } + } + } + } + flotte.add(IShip); + size=size-IShip.getSize(); + return 0; + } + } + + @Override + public List<IShip> getShips() { + Collections.sort(this.flotte); + return this.flotte; + } + + @Override + public Set<IShip> getShips(ShipCategory shipCategory) { + Set<IShip> l = new HashSet<>() ; + for(IShip b : this.flotte){ + if(b.getCategory()==shipCategory){ + l.add(b); + } + } + return l; + } + + @Override + public boolean isBelgianConfiguration() { + if(this.getShips(ShipCategory.BATTLESHIP).size() == 1){ + if(this.getShips(ShipCategory.CRUISER).size() == 2){ + if(this.getShips(ShipCategory.DESTROYER).size() == 3){ + if(this.getShips(ShipCategory.SUBMARINE).size() == 4){ + return true; + } + } + } + } + return false; + } + + @Override + public boolean isFrenchConfiguration() { + if(this.getShips(ShipCategory.BATTLESHIP).size() == 1){ + if(this.getShips(ShipCategory.CRUISER).size() == 2){ + if(this.getShips(ShipCategory.DESTROYER).size() == 2){ + if(this.getShips(ShipCategory.SUBMARINE).size() == 1){ + if(this.getShips(ShipCategory.AIRCRAFT_CARRIER).size() == 1){ + return true; + } + } + } + } + } + return false; + } + + public IShip findShip(ICoord xy){ + for(IShip b : flotte){ + for(ICoord c : b.getCoords()){ + if(c.equals(xy)){ + return b; + } + } + } + return null; + } + + @Override + public String toString() { + String s = null; + for(IShip b : this.flotte){ + s = s + b.toString(); + } + return s; + } + +} diff --git a/src/info1/ships/Ship.java b/src/info1/ships/Ship.java new file mode 100644 index 0000000000000000000000000000000000000000..5990ec4d21a3a8e3b6b4f1bb02dd110b01244895 --- /dev/null +++ b/src/info1/ships/Ship.java @@ -0,0 +1,204 @@ +package info1.ships; + +import java.util.ArrayList; +import java.util.List; + + +import vue.FenLog; + +/** + * une implémentation "abstraite" d'un bateau quelconque, de taille indéterminée + */ + + +public abstract class Ship implements IShip { + + private String name; + private Coord front; + private Coord back; + private List<ICoord> coords; + private int or; + private int t; + + /** + * NB : LA SIGNATURE DU CONSTRUCTEUR DOIT ETRE RESPECTEE + * + * construit un bateau quelconque + * @param name le nom du bateau + * @param ayFront la coordonnée de la proue du bateau + * @param ayBack la coordonnée de la poupe du bateau + * @throws BadCoordException si l'une des coordonnées données ne définit pas une coordonnée alphanumérique correcte + * @throws CoordsBadShipException si les coordonnées données ne permettent pas de définir un bateau correct : + * une ligne, une colonne, de la bonne taille, etc. + */ + public Ship(String name, String ayFront, String ayBack) + throws BadCoordException, CoordsBadShipException { + this.name = name; + + this.front = new Coord(ayFront); + this.back = new Coord(ayBack); + + int size_h = Math.abs(this.front.getX() - this.back.getX()) + 1; + int size_v = Math.abs(this.front.getY() - this.back.getY()) + 1; + + if (this.front.getX() == this.back.getX()) { + t = size_v; + this.or = 2; + }else { + t = size_h; + this.or = 1; + } + + if (this.getCategory() == ShipCategory.AIRCRAFT_CARRIER && t != 5) { + throw new CoordsBadShipException(); + } + + if (this.getCategory() == ShipCategory.BATTLESHIP && t != 4) { + throw new CoordsBadShipException(); + } + + if (this.getCategory() == ShipCategory.CRUISER && (t != 4 && t != 3)) { + throw new CoordsBadShipException(); + } + + if (this.getCategory() == ShipCategory.DESTROYER && t != 2) { + throw new CoordsBadShipException(); + } + + if (this.getCategory() == ShipCategory.SUBMARINE && t != 1) { + throw new CoordsBadShipException(); + } + + List<ICoord> l = new ArrayList<>(); + String[] alpha = {"", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}; + + if(or == 1){ + if(this.back.getX() > this.front.getX()){ + for (int i = this.front.getX(); i <= this.back.getX(); i++) { + try { + l.add(new Coord(alpha[i] + this.front.getY())); + } catch (BadCoordException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + else{ + for (int i = this.front.getX(); i >= this.back.getX(); i--) { + try { + l.add(new Coord(alpha[i] + this.front.getY())); + } catch (BadCoordException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } else{ + if(this.back.getY() > this.front.getY()){ + for (int i = this.front.getY(); i <= this.back.getY(); i++) { + try { + l.add(new Coord(this.front.getAlphaX() + String.valueOf(i))); + } catch (BadCoordException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + else{ + for (int i = this.front.getY(); i >= this.back.getY(); i--) { + try { + l.add(new Coord(this.front.getAlphaX() + String.valueOf(i))); + } catch (BadCoordException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + } + + this.coords = l; + } + + + @Override + public List<ICoord> getCoords() { + return coords; + } + + @Override + public ICoord getFront() { + return this.front; + } + + @Override + public ICoord getBack() { + return this.back; + } + + @Override + public String getName() { + return this.name; + } + + @Override + public int getSize() { + return this.t; + } + + @Override + public String toString() { + return this.name + this.front.toString() + this.back.toString(); + } + + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Ship other = (Ship) obj; + if (back == null) { + if (other.back != null) + return false; + } else if (!back.equals(other.back)) + return false; + if (coords == null) { + if (other.coords != null) + return false; + } else if (!coords.equals(other.coords)) + return false; + if (front == null) { + if (other.front != null) + return false; + } else if (!front.equals(other.front)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (or != other.or) + return false; + if (t != other.t) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((back == null) ? 0 : back.hashCode()); + result = prime * result + ((coords == null) ? 0 : coords.hashCode()); + result = prime * result + ((front == null) ? 0 : front.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + or; + result = prime * result + t; + return result; + } + + +} diff --git a/src/info1/ships/Submarine.java b/src/info1/ships/Submarine.java new file mode 100644 index 0000000000000000000000000000000000000000..44ef03dd5de3fd031df05891037269ac40afb4c3 --- /dev/null +++ b/src/info1/ships/Submarine.java @@ -0,0 +1,20 @@ +package info1.ships; + +/** + * Classe définissant un navire de catégorie "sous-marin" (taille 1) + * @author lanoix-a + */ + +public class Submarine extends Ship { + + public Submarine(String name, String xy) + throws BadCoordException, CoordsBadShipException { + super(name, xy, xy); + } + + @Override + public ShipCategory getCategory() { + return ShipCategory.SUBMARINE; + } + +} diff --git a/src/vue/FenLog.java b/src/vue/FenLog.java new file mode 100644 index 0000000000000000000000000000000000000000..28f801359744953d9f2fe2f1fb4160d99d1ad9dc --- /dev/null +++ b/src/vue/FenLog.java @@ -0,0 +1,1323 @@ +package vue; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GraphicsDevice; +import java.awt.GridLayout; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.event.ActionListener; +import java.awt.event.MouseListener; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.awt.GraphicsEnvironment; + +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.LineUnavailableException; +import javax.sound.sampled.UnsupportedAudioFileException; +import javax.swing.*; + +import com.mashape.unirest.http.exceptions.UnirestException; + +import controleur.LocalSave; +import info1.network.*; +import info1.ships.*; + +public class FenLog extends JFrame{ + private static final long serialVersionUID = 1L; + public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0"; + private JPanel p; + private JLabel l; + private JTextField txt; + private JButton b; + private Player pl; + private JPanel c1; + private JButton join; + private JButton create; + private JButton refresh; + private JComboBox<Game> list; + private JButton pos; + private NavyFleet flotte = new NavyFleet(); + private Game g; + private int compteur_t; + private JComboBox<String> config; + private JProgressBar barreVieJoueur1; + private JProgressBar barreVieJoueur2; + private Clip clip; + private String ennemy = "..."; + private JLabel joueur2; + private GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + + private static Color color = new Color(41, 128, 185); + private static Color color2 = new Color(0x2c3e50); + private static Color color3 = new Color(52, 73, 94); + private static Color color4 = new Color(0x2c3e50); + private static Color buttonColor = new Color(0x34495e); + private static String fontColor = "#ecf0f1"; + private static String fontColorOpacity = "rgb(230, 234, 235)"; + + private Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + + private JPanel p_right; + private JPanel p_left; + + private JButton[][] buttonGrilleHaut; + private JLabel labelHaut; + private JLabel labelGauche; + + private JButton[][] buttonGrilleCreateFlotte; + + + private JButton[][] buttonGrilleC; + private JButton[][] buttonGrilleBas; + private JPanel grilleC; + private JLabel resultatCoup; + private JLabel resultatTir; + private JLabel porteAvions ; + private JProgressBar barreViePorteAvions; + private JLabel croiseur; + private JProgressBar barreVieCroiseur; + private JLabel cuirasse; + private JProgressBar barreVieCuirasse; + private JLabel sousMarin; + private JProgressBar barreVieSousMarin; + private JLabel torpilleur; + private JProgressBar barreVieTorpilleur; + + private JButton go_menu_button = new JButton("<html><p style='color: "+ fontColor +";'><u>Retour</u></p></html>"); + + private ArrayList<Coord> tmp_coords = new ArrayList<>(); + private int etape = 1; + private JPanel principalHaut = new JPanel(); // panel qui contiendra la grille et les lettres + private JButton bu_reset = new JButton("<html><p style='color : "+ fontColor +";'>Réinitialiser</p></html>"); + private JLabel creation_mess = new JLabel(); + + /** + * pconstruit la fenetre d'accueil ou l'on choisis son pseudo et sa configuration de jeu + */ + public FenLog(){ + try { + UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() ); + } catch (Exception e) { + e.printStackTrace(); + } + //creer titre et logo de la fenetre + this.setTitle("Bataille Navale"); + ImageIcon icon = new ImageIcon("img/minilog.png"); + JLabel img=new JLabel(icon); + JLabel blanc = new JLabel(); + blanc.setMaximumSize(new Dimension(10,20)); + this.setIconImage(icon.getImage()); + this.setBackground(color4); + p = new JPanel(new GridLayout(1,2)); + p_left=new JPanel(); + p_left.add(img); + p_right=new JPanel(); + p.setBackground(color4); + l = new JLabel("<html><p style='color: "+ fontColor +";'>Entre ton nom</p></html>"); + JLabel l2 = new JLabel("<html><p style='margin-top: 10px; color: "+ fontColor +";'>Choisi ta configuration :</p></html>"); + + //creer pname, plus tard elle sera égale au nom stocké dans le Json + String pname = null; + try { + pname = LocalSave.getInfos(1); + } catch (Exception e) { + e.printStackTrace(); + } + + //ajoute a config les option française et belge + config = new JComboBox<>(); + config.addItem("Française"); + config.addItem("Belge"); + + //parametre de config + config.setMaximumSize(new Dimension(500,20)); + config.setBackground(new Color(233, 240, 255)); + txt = new JTextField(pname); + + //textfield qui va afficher le joueur suivis de comment sera faite la fenetre (couleur et dimension) + txt.setMaximumSize(new Dimension(500,20)); + txt.setBackground(new Color(233, 240, 255)); + + //creation du button + b = new JButton("<html><p style='color : "+ fontColor +";'>Créer ma flotte</p></html>"); + b.setBackground(buttonColor); + + //ajout et placement des différents composant dans les panels + l.setAlignmentX(Component.CENTER_ALIGNMENT); + l2.setAlignmentX(Component.CENTER_ALIGNMENT); + txt.setAlignmentX(Component.CENTER_ALIGNMENT); + b.setAlignmentX(Component.CENTER_ALIGNMENT); + config.setAlignmentX(Component.CENTER_ALIGNMENT); + p_right.add(blanc); + p_right.add(l); + p_right.add(txt); + p_right.add(l2); + p_right.add(config); + p_right.add(b); + p_right.setLayout(new BoxLayout(p_right,1)); + p_right.setBackground(color4); + p_left.setBackground(color4); + + p.add(p_left); + p.add(p_right); + this.setContentPane(p); + + this.setPreferredSize(new Dimension(380, 200)); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + int x = (int) ((dimension.getWidth() - 300) / 2); + int y = (int) ((dimension.getHeight() - 200) / 2); + this.setLocation(x, y); + this.pack(); + this.setVisible(true); + + //creer les button du panneau de choix de partie + this.join = new JButton("<html><p style='color : "+ fontColor +";'>join</p></html>"); + this.join.setBackground(buttonColor); + this.create = new JButton("<html><p style='color : "+ fontColor +";'>créer</p></html>"); + this.create.setBackground(buttonColor); + this.pos = new JButton("<html><p style='color : "+ fontColor +";'>flotte</p></html>"); + this.pos.setBackground(buttonColor); + this.refresh = new JButton("<html><p style='color : "+ fontColor +";'>rafraichir</p></html>"); + refresh.setBackground(color3); + + // GRILLE + String[] alphabet = {"A" ,"B", "C", "D", "E", "F", "G", "H", "I", "J"}; // alphabet utilisés pour les grilles + String tmp; + + String[] chiffres = {" ","1","2","3","4","5","6","7","8","9","10"}; // chiffres utilisés pour les grilles + String temp; + + // ainsi que les chiffres + principalHaut.setLayout(new BorderLayout()); + + JPanel PanelGaucheGH = new JPanel(); // panel qui contient les lettres du la grille + // du dessus + PanelGaucheGH.setLayout(new GridLayout(10,1)); + PanelGaucheGH.setBackground(color4); + + for(int i=0; i<10; i++) { // mise en place des lettres + tmp=alphabet[i]; + labelGauche = new JLabel("<html><p style='color : "+ fontColor +";'>" + tmp + "</p></html>"); + labelGauche.setHorizontalAlignment(SwingConstants.CENTER); + PanelGaucheGH.add(labelGauche); + } + + principalHaut.add(PanelGaucheGH, BorderLayout.WEST); // ajout du panel des lettres + // à celui qui contient la grille du dessus + + JPanel PanelHautGH = new JPanel(); //panel qui contiendra les chiffres de la + // grille du dessus + PanelHautGH.setLayout(new GridLayout(1,10)); + PanelHautGH.setBackground(color4); + + String espace = chiffres[0]; + labelHaut = new JLabel(espace); + PanelHautGH.add(labelHaut); + for(int i=1; i<11; i++) { // mise en place des chiffres + temp=chiffres[i]; + labelHaut = new JLabel("<html><p style='color : "+ fontColor +";'>" + temp + "</p></html>"); + labelHaut.setVerticalAlignment(SwingConstants.CENTER); + PanelHautGH.add(labelHaut); + } + + principalHaut.add(PanelHautGH, BorderLayout.NORTH); // ajout du panel des chiffres + // à celui qui contient la grille de dessus + + JPanel grilleHaut = new JPanel(); // panel qui contient la grille + grilleHaut.setLayout(new GridLayout(10,10)); + grilleHaut.setBackground(color4); + principalHaut.add(grilleHaut, BorderLayout.CENTER); + + buttonGrilleCreateFlotte = new JButton[10][10]; + for(int i=0; i<10; i++) { // remplissage de la grille + for(int j=0; j<10; j++) { + buttonGrilleCreateFlotte[i][j] = new JButton("<html><p style='color : "+ fontColor +";'></p></html>"); + grilleHaut.add(buttonGrilleCreateFlotte[i][j]); + buttonGrilleCreateFlotte[i][j].setBackground(new Color(0x2980b9)); + int x1 = i+1; + int y1 = j+1; + buttonGrilleCreateFlotte[i][j].setName(Coord.findAlphaX(x1)+""+y1); + } + } + + //autregrille + grilleC = new JPanel(); // panel qui contient la grille + grilleC.setLayout(new GridLayout(10,10)); + grilleC.setBackground(color2); + + buttonGrilleC = new JButton[10][10]; + for(int i=0; i<10; i++) { // remplissage de la grille + for(int j=0; j<10; j++) { + buttonGrilleC[i][j] = new JButton(" "); + grilleC.add(buttonGrilleC[i][j]); + buttonGrilleC[i][j].setBackground(color); + x = i + 1; + y = j + 1; + buttonGrilleC[i][j].setName(Coord.findAlphaX(x) + "" + y); + } + } + } + + /** + * getter qui retourne la partie + * @return la partie selectionné + */ + public Game getSelectGame(){ + return (Game) this.list.getSelectedItem(); + } + + + /** + * getter qui retourne le nom du joueur + * @return le nom + */ + public String getName(){ + return txt.getText(); + } + + + /** + * setter de la partie + * + * @param g la game à ajouter + */ + public void setG(Game g){ + this.g = g; + } + + + /** + * getter qui retourne le joueur + * @return le player + */ + public Player getPL(){ + return this.pl; + } + + + /** + * retourne la flotte + * @return la Flotte de bateaux + */ + public NavyFleet getFlotte(){ + return this.flotte; + } + + + /** + * setter du player + * + * @param p le player à ajouter + */ + public void SetPl(Player p){ + this.pl = p; + } + + + /** + * met la string s dans le JTextField + * + * @param s la chaine à afficher + */ + public void setTxt(String s){ + this.txt.setText(s); + } + + + /** + * fixe le bouton pour créer la flotte à son controleur + * + * @param action le controleur a fix sur le bouton + */ + public void fixeListenerb(ActionListener action) { + b.addActionListener(action); + } + + + /** + * fixe le bouton join à son controleur + * + * @param action le controleur du bouton join + */ + public void fixeListenerJoin(ActionListener action) { + join.addActionListener(action); + } + + + /** + * fixe le bouton create à son controleur + * + * @param action le controleur du bouton create + */ + public void fixeListenerCreate(ActionListener action) { + create.addActionListener(action); + } + + + /** + * fixe le bouton pos à son controleur + * + * @param action le controleur du bouton Pos + */ + public void fixeListenerPos(ActionListener action) { + pos.addActionListener(action); + } + + /** + * fixe le bouton refresh à son controleur + * + * @param action le controleur du bouton refresh + */ + public void fixeListenerRefresh(ActionListener action) { + refresh.addActionListener(action); + } + + /** + * Acutalise la liste des parties disponible + * + */ + public void refreshPartie() { + try { + list.removeAllItems(); + List<Game> lp = Network.listInitializedGames(HTTP_LOCALHOST); + for(Game g : lp){ + this.list.addItem(g); + } + } catch (UnirestException e) { + e.printStackTrace(); + } + } + + /** + * permet de creer la fenetre pour définir sa flotte + * + * @param config entier correspondant à l'index selectionner dans la JComboBox de configuration + */ + public void goCreateFlotte(int config) { + this.getContentPane().removeAll(); + this.repaint(); + + // DEF CONFIG + if (!flotte.isBelgianConfiguration() && !flotte.isFrenchConfiguration()) { + this.resetEtape(); + }else { + etape = 18; + setMessage("La flotte à déjà était créé. Pour en créer une autre, cliquez sur 'réinitialiser' ou cliquez sur une case pour revenir en arrière.", 0); + } + + // CONSTRUCTION DE LA VUE + p = new JPanel(); + p.setLayout(new GridLayout(1, 3)); + + // PANEL DE GAUCHE + // IMAGE DES BATEAUX + ImageIcon azurain_icon = new ImageIcon("img/azurain.png"); + JLabel azurain_img = new JLabel(azurain_icon); + + ImageIcon crois_icon = new ImageIcon("img/crois.png"); + JLabel crois_img = new JLabel(crois_icon); + + ImageIcon cuir_icon = new ImageIcon("img/cuir.png"); + JLabel cuir_img = new JLabel(cuir_icon); + + ImageIcon sous_icon = new ImageIcon("img/sous.png"); + JLabel sous_img = new JLabel(sous_icon); + + ImageIcon torp_icon = new ImageIcon("img/torp.png"); + JLabel torp_img = new JLabel(torp_icon); + + JPanel left = new JPanel(); + GridLayout left_l = new GridLayout(6, 1); + left.setLayout(left_l); + left.setBackground(color4); + + + JPanel infos = new JPanel(new GridLayout(2,1)); + infos.setBackground(color4); + infos.add(creation_mess); + infos.add(bu_reset); + + left.add(azurain_img); + left.add(crois_img); + + left.add(infos, BorderLayout.SOUTH); + + left.add(cuir_img); + left.add(sous_img); + left.add(torp_img); + + bu_reset.setBackground(color4); + + + p.add(left); + + // GRILLE + JPanel droite_grille = new JPanel(new BorderLayout()); + droite_grille.setBackground(color4); + + droite_grille.add(principalHaut, BorderLayout.CENTER); + + + + p.add(droite_grille); + + this.setContentPane(p); + + this.setPreferredSize(new Dimension(1050, 600)); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + int x = (int) ((dimension.getWidth() - 1050) / 2); + int y = (int) ((dimension.getHeight() - 600) / 2); + this.setLocation(x, y); + this.pack(); + this.setVisible(true); + + + } + + /** + * permet de creer la fenetre de menu + */ + public void goMenu(){ + //creation de la vue + this.getContentPane().removeAll(); + this.repaint(); + ImageIcon icon = new ImageIcon("img/gifGoMenu.gif"); + JLabel img = new JLabel(icon); + p = new JPanel(); + p.setBackground(color4); + p.setLayout(new BorderLayout()); + c1 = new JPanel(); + JPanel c2 = new JPanel(); + c2.setLayout(new BorderLayout()); + + //permet d'aller chercher les parties dispo sur le reseau + try { + List<Game> lp = Network.listInitializedGames(HTTP_LOCALHOST); + this.list = new JComboBox<Game>(); + for(Game g : lp){ + this.list.addItem(g); + } + } catch (UnirestException e) { + e.printStackTrace(); + } + + //parametre la fenetre et place les composants + this.list.setBackground(new Color(233, 240, 255)); + this.list.setPreferredSize(new Dimension(250,25)); + c1.setBackground(color4); + c1.add(pos); + c1.add(refresh); + c1.add(list); + c1.add(join); + c1.add(create); + c2.add(c1, BorderLayout.NORTH); + + //affiche le nombre de partie joué, gagné et perdu avec ce qui a été stocker dans le Json + try { + JLabel ply = new JLabel("<html><p style='margin: 10px; width: 600; color: "+ fontColorOpacity +"; text-align: center;'>Joueur: "+ LocalSave.getInfos(1)+" Partie jouées: "+LocalSave.getInfos(2)+" Partie gagnées: "+LocalSave.getInfos(3)+" partie perdues: "+LocalSave.getInfos(4)+"</p></html>"); + c2.add(ply, BorderLayout.SOUTH); + } catch (Exception e) { + e.printStackTrace(); + } + c2.setBackground(color3); + p.add(c2, BorderLayout.NORTH); + p.add(img, BorderLayout.CENTER); + + this.setContentPane(p); + + this.setPreferredSize(new Dimension(600, 400)); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + int x = (int) ((dimension.getWidth() - 600) / 2); + int y = (int) ((dimension.getHeight() - 400) / 2); + this.setLocation(x, y); + this.pack(); + this.setVisible(true); + } + + /** + * creation de la fenetre de combat + */ + public void goCombat() { + this.getContentPane().removeAll(); + this.repaint(); + + ImageIcon icon = new ImageIcon("img/minilog.png"); + JLabel img=new JLabel(icon); + this.setIconImage(icon.getImage()); + + JPanel principalBataille = new JPanel(); // panel qui contient la fenetre de la bataille + principalBataille.setLayout(new GridLayout(3,1)); + principalBataille.setBorder(BorderFactory.createTitledBorder("<html><p style='font-size: 14px; color : "+ fontColor +";'> Bataille Navale </p></html>")); + principalBataille.setBackground(color4); + + String[] alphabet = {"A" ,"B", "C", "D", "E", "F", "G", "H", "I", "J"}; // alphabet utilises pour les grilles + String tmp; + + String[] chiffres = {" ","1","2","3","4","5","6","7","8","9","10"}; // chiffres utilises pour les grilles + String temp; + + JPanel principalHaut = new JPanel(); // panel qui contiendra la grille et les lettres + // ainsi que les chiffres + principalHaut.setLayout(new BorderLayout()); + principalBataille.add(principalHaut); + + JPanel PanelGaucheGH = new JPanel(); // panel qui contient les lettres du la grille + // du dessus + PanelGaucheGH.setLayout(new GridLayout(10,1)); + PanelGaucheGH.setBackground(color4); + + for(int i=0; i<10; i++) { // mise en place des lettres + tmp=alphabet[i]; + labelGauche = new JLabel("<html><p style='color : "+ fontColor +";'> " + tmp + " </p></html>"); + labelGauche.setHorizontalAlignment(SwingConstants.CENTER); + PanelGaucheGH.add(labelGauche); + } + + principalHaut.add(PanelGaucheGH, BorderLayout.WEST); // ajout du panel des lettres + principalHaut.setBackground(color4); + // a celui qui contient la grille du dessus + + JPanel PanelHautGH = new JPanel(); //panel qui contiendra les chiffres de la + // grille du dessus + PanelHautGH.setLayout(new GridLayout(1,10)); + PanelHautGH.setBackground(color4); + + String espace = chiffres[0]; + labelHaut = new JLabel(espace); + PanelHautGH.add(labelHaut); + for(int i=1; i<11; i++) { // mise en place des chiffres + temp=chiffres[i]; + labelHaut = new JLabel("<html><p style='color : "+ fontColor +";'> " + temp + " </p></html>"); + labelHaut.setVerticalAlignment(SwingConstants.CENTER); + PanelHautGH.add(labelHaut); + } + + principalHaut.add(PanelHautGH, BorderLayout.NORTH); // ajout du panel des chiffres + // a celui qui contient la grille de dessus + + JPanel grilleHaut = new JPanel(); // panel qui contient la grille + grilleHaut.setLayout(new GridLayout(10,10)); + grilleHaut.setBackground(color4); + principalHaut.add(grilleHaut, BorderLayout.CENTER); + + buttonGrilleHaut = new JButton[10][10]; + for(int i=0; i<10; i++) { // remplissage de la grille + for(int j=0; j<10; j++) { + buttonGrilleHaut[i][j] = new JButton("<html><p style='color : "+ fontColor +";'> </p></html>"); + grilleHaut.add(buttonGrilleHaut[i][j]); + buttonGrilleHaut[i][j].setBackground(color); + int x = i + 1; + int y = j + 1; + buttonGrilleHaut[i][j].setName(Coord.findAlphaX(x) + "" + y); + } + } + + JPanel principalCentre = new JPanel(); // panel qui contient un label au centre + principalCentre.setLayout(new GridLayout(2, 1)); + principalBataille.add(principalCentre); + + + JPanel resultatTirInfoTir = new JPanel(); // panel qui comprend un label et l'info du tir + resultatTirInfoTir.setLayout(new GridLayout(1,2)); + principalCentre.add(resultatTirInfoTir, BorderLayout.CENTER); + resultatTirInfoTir.setBackground(color4); + + resultatTir = new JLabel("<html><p style='font-size: 12px; color : "+ fontColor +";'>Resultat du coup: </p></html>"); // JLabel purement esthetique pour le fonctionnement du jeux + resultatTir.setHorizontalAlignment(SwingConstants.RIGHT); + resultatTirInfoTir.add(resultatTir); + + resultatCoup = new JLabel(); //JTextArea qui indique le resulstat de notre coup + resultatTirInfoTir.add(resultatCoup); + + JPanel principalBas = new JPanel(); // panel qui contient la grille de dessous, les chiffres + // de la grille de dessous ainsi que les lettres + principalBas.setLayout(new BorderLayout()); + principalBataille.add(principalBas, BorderLayout.SOUTH); + + JPanel PanelHautGB = new JPanel(); // panel qui contient les les lettres de la grille + // du dessous + PanelHautGB.setLayout(new GridLayout(10,1)); + PanelHautGB.setBackground(color4); + + for(int i=0; i<10; i++) { // mise en place de lettres + tmp=alphabet[i]; + labelHaut = new JLabel("<html><p style='color : "+ fontColor +";'> " + tmp + " </p></html>"); + labelHaut.setHorizontalAlignment(SwingConstants.CENTER); + PanelHautGB.add(labelHaut); + } + + principalBas.add(PanelHautGB, BorderLayout.WEST); // ajout du panel qui contient les + // lettre a celui qui contient la grille du dessous + principalBas.setBackground(color4); + principalHaut.add(grilleC, BorderLayout.CENTER); + + JPanel PanelGaucheGB = new JPanel(); // panel qui contient les chiffres de la grille + // de dessous + PanelGaucheGB.setLayout(new GridLayout(1,10)); + PanelGaucheGB.setBackground(color4); + + PanelGaucheGB.add(new JLabel(" ")); + + for(int i=1; i<11; i++) { // mise en place des chiffres + temp=chiffres[i]; + labelGauche = new JLabel("<html><p style='color : "+ fontColor +";'> " + temp + " </p></html>"); + labelGauche.setVerticalAlignment(SwingConstants.CENTER); + PanelGaucheGB.add(labelGauche); + } + + principalBas.add(PanelGaucheGB, BorderLayout.NORTH); // ajout du panel qui contient + //les chiffres a celui qui contient la grille du dessous + + JPanel grilleBas = new JPanel(); // panel qui contient la grille du dessous + grilleBas.setLayout(new GridLayout(10,10)); + grilleBas.setBackground(color4); + principalBas.add(grilleBas, BorderLayout.CENTER); + + buttonGrilleBas = new JButton[10][10]; + for(int i=0; i<10; i++) { // remplissage de la grille + for(int j=0; j<10; j++) { + buttonGrilleBas[i][j] = new JButton("<html><p style='color : "+ fontColor +";'></p></html>"); + + grilleBas.add(buttonGrilleBas[i][j]); + int x = i + 1; + int y = j + 1; + String s=Coord.findAlphaX(x) + "" + y; + Coord c; + try { + c = new Coord(s); + //coloration des cases de la grille en fonction de si elle contient un bateau ou non + if(flotte.findShip(c)!=null) { + if(c.equals(flotte.findShip(c).getCoords().get(0))) { + buttonGrilleBas[i][j].setBackground(new Color(0x95a5a6)); + } + else { + buttonGrilleBas[i][j].setBackground(new Color(0x455A64)) +; + } + } + else { + buttonGrilleBas[i][j].setBackground(color); + + } + } + catch (BadCoordException e) { + e.printStackTrace(); + } + + + } + } + + + + JPanel principal = new JPanel(); // panel qui contient la fenetre + principal.setLayout(new GridLayout(1,2)); + principal.add(principalBataille); + principalBataille.setBackground(color2); + + + JPanel gestionBateaux = new JPanel(); // panel qui va gerer les bateaux + gestionBateaux.setLayout(new GridLayout(3,1)); + principal.add(gestionBateaux, BorderLayout.EAST); + gestionBateaux.setBorder(BorderFactory.createLoweredBevelBorder()); + + JPanel placementRadar = new JPanel(); + placementRadar.setBackground(Color.black); + placementRadar.setLayout(new FlowLayout()); + gestionBateaux.add(placementRadar); + + ImageIcon gifRadar = new ImageIcon("img/a.gif"); // affichage de l'image du porte-avion + JLabel radar = new JLabel(gifRadar); + placementRadar.add(radar); + + JPanel bateaux = new JPanel(); + bateaux.setLayout(new GridLayout(5,2)); + gestionBateaux.add(bateaux); + + if(this.flotte.isFrenchConfiguration()){ + ImageIcon imgPorteAvions = new ImageIcon("img/azurain.png"); // affichage de l'image du porte-avion + porteAvions = new JLabel(imgPorteAvions); + bateaux.add(porteAvions); + JLabel InfoViePorteAvion = new JLabel("<html><p style='color : "+ fontColor +";'>vie porte-avions</p></html>"); + InfoViePorteAvion.setVerticalAlignment(SwingConstants.CENTER); + bateaux.add(InfoViePorteAvion); + + JPanel AffichageVieporteAvions = new JPanel(); // panel qui contient la barre de vie du porte-avions + AffichageVieporteAvions.setLayout(new FlowLayout()); + bateaux.add(AffichageVieporteAvions); + + barreViePorteAvions = new JProgressBar(0,5); // barre de vie du porte-avions + barreViePorteAvions.setValue(5); + barreViePorteAvions.setForeground(new Color(58, 160, 255)); + barreViePorteAvions.setStringPainted(true); + AffichageVieporteAvions.add(barreViePorteAvions); + AffichageVieporteAvions.setBackground(color3); + } + + ImageIcon imgCroiseur = new ImageIcon("img/crois.png"); // affichage de l'image du croiseur + croiseur = new JLabel(imgCroiseur); + bateaux.add(croiseur); + JLabel InfoVieCroiseur = new JLabel("<html><p style='color : "+ fontColor +";'>vie croiseur</p></html>"); + bateaux.add(InfoVieCroiseur); + + JPanel AffichageVieCroiseur = new JPanel(); // panel qui contient la barre de vie du croiseur + AffichageVieCroiseur.setLayout(new FlowLayout()); + bateaux.add(AffichageVieCroiseur); + + barreVieCroiseur = new JProgressBar(0,3); // barre de vie du croiseur + barreVieCroiseur.setValue(3); + barreVieCroiseur.setForeground(new Color(58, 160, 255)); + barreVieCroiseur.setStringPainted(true); + AffichageVieCroiseur.add(barreVieCroiseur); + AffichageVieCroiseur.setBackground(color3); + + ImageIcon imgCuirasse = new ImageIcon("img/cuir.png"); // affichage de l'image du cuirasse + cuirasse = new JLabel(imgCuirasse); + bateaux.add(cuirasse); + JLabel InfoVieCuirasse = new JLabel("<html><p style='color : "+ fontColor +";'>vie cuirassé</p></html>"); + bateaux.add(InfoVieCuirasse); + + JPanel AffichageVieCuirasse = new JPanel(); // panel qui contient la barre de vie du cuirasse + AffichageVieCuirasse.setLayout(new FlowLayout()); + bateaux.add(AffichageVieCuirasse); + + barreVieCuirasse = new JProgressBar(0,2); // barre de vie du cuirasse + barreVieCuirasse.setValue(2); + barreVieCuirasse.setForeground(new Color(58, 160, 255)); + barreVieCuirasse.setStringPainted(true); + AffichageVieCuirasse.add(barreVieCuirasse); + AffichageVieCuirasse.setBackground(color3); + + ImageIcon imgSousMarin = new ImageIcon("img/sous.png"); // affichage de l'image du sous-marin + sousMarin = new JLabel(imgSousMarin); + bateaux.add(sousMarin); + JLabel InfoVieSousMarin = new JLabel("<html><p style='color : "+ fontColor +";'>vie sous-marins</p></html>"); + bateaux.add(InfoVieSousMarin); + + JPanel AffichageVieSousMarin = new JPanel(); // affichage de l'image du sous-marin + AffichageVieSousMarin.setLayout(new FlowLayout()); + bateaux.add(AffichageVieSousMarin); + + if(this.flotte.isFrenchConfiguration()){ + barreVieSousMarin = new JProgressBar(0,1); // barre de vie du sous-marin + barreVieSousMarin.setValue(1); + }else{ + barreVieSousMarin = new JProgressBar(0,4); // barre de vie du sous-marin + barreVieSousMarin.setValue(4); + } + barreVieSousMarin.setForeground(new Color(58, 160, 255)); + barreVieSousMarin.setStringPainted(true); + AffichageVieSousMarin.add(barreVieSousMarin); + AffichageVieSousMarin.setBackground(color3); + + ImageIcon imgTorpilleur = new ImageIcon("img/torp.png"); // affichage de l'image du torpilleur + torpilleur = new JLabel(imgTorpilleur); + bateaux.add(torpilleur); + JLabel InfoVieTorpilleur = new JLabel("<html><p style='color : "+ fontColor +";'>vie torpilleurs</p></html>"); + bateaux.add(InfoVieTorpilleur); + + JPanel AffichageTorpilleur = new JPanel(); // affichage de l'image du torpilleur + AffichageTorpilleur.setLayout(new FlowLayout()); + bateaux.add(AffichageTorpilleur); + AffichageTorpilleur.setBackground(color3); + bateaux.setBackground(color3); + if(this.flotte.isFrenchConfiguration()){ + barreVieTorpilleur = new JProgressBar(0,4); // barre de vie du torpilleur + barreVieTorpilleur.setValue(4); + }else{ + barreVieTorpilleur = new JProgressBar(0,6); // barre de vie du sous-marin + barreVieTorpilleur.setValue(6); + } + barreVieTorpilleur.setForeground(new Color(58, 160, 255)); + barreVieTorpilleur.setStringPainted(true); + AffichageTorpilleur.add(barreVieTorpilleur); + AffichageTorpilleur.setBackground(color3); + + JPanel vieJoueurNom = new JPanel(); // panel qui contient un JLabel indiquant la vie des joueurs + vieJoueurNom.setBackground(color4); + vieJoueurNom.setLayout(new GridLayout(4,2)); + gestionBateaux.add(vieJoueurNom); + vieJoueurNom.setBorder(BorderFactory.createTitledBorder("<html><p style='color : "+ fontColor +";'>barre de vie des joueurs</p></html>")); + + + //gestion des barres de vie des joueurs + UIManager.put("ProgressBar.selectionForeground",Color.WHITE); + JLabel joueur1 = new JLabel("<html><p style='color : "+ fontColor +";'>Votre flotte: </p></html>"); // creation de la barre de vie du joueur n 1 + vieJoueurNom.add(joueur1); + barreVieJoueur1 = new JProgressBar(0,20); + barreVieJoueur1.setValue(20); + barreVieJoueur1.setForeground(new Color(17,185,17)); + barreVieJoueur1.setStringPainted(true); + vieJoueurNom.add(barreVieJoueur1); + + joueur2 = new JLabel("<html><p style='color : "+ fontColor +";'>Flotte de "+ getEnnemy()+"</p></html>"); // creation de la barre de vie du joueur n 2 vieJoueurNom.add(joueur2); + barreVieJoueur2 = new JProgressBar(0,20); + vieJoueurNom.add(joueur2); + barreVieJoueur2.setValue(20); + barreVieJoueur2.setStringPainted(true); + barreVieJoueur2.setForeground(new Color(17,185,17)); + vieJoueurNom.add(barreVieJoueur2); + + // Bouton retour au menu précédent + JPanel tools_buttons = new JPanel(new BorderLayout()); + go_menu_button.setBackground(color4); + tools_buttons.setBackground(color4); + tools_buttons.add(go_menu_button); + principalCentre.add(tools_buttons); + + //affichage de la fenetre + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + this.getContentPane().add(principal); // affiche la fenetre + int screenWidth = (int) GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth(); + int screenHeight = (int) GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight(); + this.setPreferredSize(new Dimension(screenWidth, screenHeight-50)); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.pack(); + this.setLocation(0, 0); + this.setVisible(true); + } + + /** + * desactive les boutons de la grille du haut + */ + public void disabledButton() { + for(int i=0;i<10;i++) { + for(int j=0;j<10;j++) { + buttonGrilleHaut[i][j].disable(); + } + } + } + + /** + * active les boutons de la grille du haut + */ + public void enabledButton() { + for(int i=0;i<10;i++) { + for(int j=0;i<10;i++) { + buttonGrilleHaut[i][j].enable(); + } + } + } + + /** + * geter d'une liste de coordonnées pour la création de la flotte + * @return tmp_coords la liste de coordonnées + */ + public ArrayList<Coord> getTmpCoords() { + return tmp_coords; + } + + /** + * retourne à quel etape de placement des bateaux on se trouve + * @return etape le numero d'etape + */ + public int getEtapeCreation() { + return etape; + } + + /** + * incremente la variable d'etape de creation de la flotte + */ + public void increaseEtapeCreation() { + etape++; + } + + /** + * geter de la grille de bouton de la creation de la flotte + * @return buttonGrilleCreateFlotte le tableau de boutons représentant la grille + */ + public JButton[][] getButtonGrilleHaut() { + return buttonGrilleCreateFlotte; + } + + /** + * fixe les boutons de la grille + * @param action + * @param mouse + */ + public void fixeListenerCase(ActionListener action, MouseListener mouse) { + for(int i=0; i<10 ;i++) { + for(int j=0; j<10; j++) { + buttonGrilleCreateFlotte[i][j].addActionListener(action); + buttonGrilleCreateFlotte[i][j].addMouseListener(mouse); + } + } + } + + /** + * fixe les bouttons de la grille de combat de l'adversaire à son controleur + * @param action le controleur des boutons de la grille haute de la vu combat + */ + public void fixeListenerCase(ActionListener action) { + for(int i=0; i<10 ;i++) { + for(int j=0; j<10; j++) { + buttonGrilleC[i][j].addActionListener(action); + } + } + } + + /** + * fixe le bouton de reinitialisation de la flotte à son controleur + ** @param action le controleur de la flotte + */ + public void fixeListenerResetFlotte(ActionListener action) { + bu_reset.addActionListener(action); + } + + /** + * affiche les informations et les consignes au moment de la création de la flotte + * @param mess le message à afficher + * @param isError entier qui indique si le message doit être affiché comme info ou comme erreur + */ + public void setMessage(String mess, int isError) { + if (isError == 1) { + creation_mess.setText("<html>" + mess + "</html>"); + } + else{ + creation_mess.setText("<html><p style='margin: 10px 10px 20px 10px; text-align: center; width: 400px; font-size: 11px; color: #ecf0f1;'>" + mess + "</p></html>"); + } + } + + /** + *colorie le bouton en blanc,est appelé quand il y a rien + * @param button le bouton à colorier + */ + public void colorizeNone(JButton button) { + button.setBackground(new Color(0x227093)); + } + + /** + * donne la config de jeu choisie + * @return l'index de l'item selectionner dans la JComboBox + */ + public int getConfig(){ + return this.config.getSelectedIndex(); + } + + /** + * getter du TextArea qui affiche le resultat du coup + * @return le JLabel resultatCoup + */ + public JLabel getResultatCoup() { + return resultatCoup; + } + + /** + * setter du TextArea qui affiche le resultat du coup + * @param info la string à afficher + */ + public void setResultatCoup(String info) { + resultatCoup.setText("<html><p style='margin-left: 5px; font-size: 12px; font-weight: lighter; color : "+ fontColor +";'>" + info + "</p></html>"); + } + + /** + * colorie le bouton selon le resultat (rouge si touche) + * @param button le bouton à colorier + */ + public void colorizeTouch(JButton button) { + button.setBackground(new Color(0xff7675)); + } + + /** + * colorie le bouton selon le resultat (gris si coule) + * @param button le bouton à colorier + */ + public void colorizeCoule(JButton button) { + button.setBackground(new Color(0xd63031)); + } + + /** + * getter de la barre de vie du porte-avions + * @return la Barre de vie + */ + public JProgressBar getBarrePorteAvions() { + return barreViePorteAvions; + } + + /** + * getter de la barre de vie du croiseur + * @return la Barre de vie + */ + public JProgressBar getBarreCroiseur() { // getter de la barre due vie du croiseur + return barreVieCroiseur; + } + + /** + * getter de la barre de vie du cuirassé + * @return la Barre de vie + */ + public JProgressBar getBarreCuirasse() { // getter de la barre due vie du cuirasse + return barreVieCuirasse; + } + + /** + * getter de la barre de vie du sous-marins + * @return la Barre de vie + */ + public JProgressBar getBarreSousMarin() { // getter de la barre due vie du sous-arin + return barreVieSousMarin; + } + + /** + * getter de la barre de vie du torpilleurs + * @return la Barre de vie + */ + public JProgressBar getBarreTorpilleur() { // getter de la barre due vie du torpilleur + return barreVieTorpilleur; + } + + /** + * reinitialise l'étape de placement du bateau lors de la création de la flotte + */ + public void resetEtape() { + this.setMessage("Cliquez sur 1 case pour placer l'avant de votre cuirassé (longueur : 4)", 0); + if (getConfig() == 0) { + this.etape = 1; + }else { + this.etape = 8; + } + } + + /** + * reinitialise la flotte + */ + public void resetFlotte() { + this.flotte = new NavyFleet(); + } + + /** + * reinitialise la couleur des bouttons au moment de la création de la flotte + */ + public void resetGrilleColorButton() { + for(int i=0;i<10;i++) { + for(int j=0;j<10;j++) { + buttonGrilleCreateFlotte[i][j].setBackground(color); + } + } + } + + /** + * fix le bouton go_menu à son controleur + * @param action le controleur de go_menu + */ + public void fixeListenerGoMenu(ActionListener action) { + go_menu_button.addActionListener(action); + } + + /** + * geter de la game courante + * @return g la game courante + */ + public Game getG(){ + return this.g; + } + + /** + * geter du compteur de tour pendant le combat + * @return compteur_t le compteur; + */ + public int getCompt(){ + return this.compteur_t; + } + + /** + * recupère le tir pour mettre à jour les barres de vies + * @param pos la position du tir + * @param cible le bouton ciblé + * @throws BadCoordException + */ + public void tir_recu(String pos, JButton cible) throws BadCoordException{ + IShip ship = this.flotte.findShip(new Coord(pos)); + if(ship == null){ + this.colorizeNone(cible); + } + else{ + this.setdam(1); + this.colorizeTouch(cible); + if(ship.getCategory() == ShipCategory.BATTLESHIP){ + int v = this.barreVieCuirasse.getValue()-1; + this.barreVieCuirasse.setValue(v); + } + if(ship.getCategory() == ShipCategory.CRUISER){ + int v = this.barreVieCroiseur.getValue()-1; + this.barreVieCroiseur.setValue(v); + } + if(ship.getCategory() == ShipCategory.DESTROYER){ + int v = this.barreVieTorpilleur.getValue()-1; + this.barreVieTorpilleur.setValue(v); + } + if(ship.getCategory() == ShipCategory.SUBMARINE){ + int v = this.barreVieSousMarin.getValue()-1; + this.barreVieSousMarin.setValue(v); + } + if(ship.getCategory() == ShipCategory.AIRCRAFT_CARRIER){ + int v = this.barreViePorteAvions.getValue()-1; + this.barreViePorteAvions.setValue(v); + } + } + } + + /** + * decremente la barre de vie des joueurs 1 ou 2 de 1 + * @param i 1 si l'update est sur le joueur 1 et 2 si l'update est sur le joueur 2 + */ + public void setdam(int i){ + if(i == 1){ + int v = barreVieJoueur1.getValue()-1; + barreVieJoueur1.setValue(v); + majVie(barreVieJoueur1); + } + if(i == 2){ + int v = barreVieJoueur2.getValue()-1; + barreVieJoueur2.setValue(v); + majVie(barreVieJoueur2); + } + } + + /** + * met à jour la barre de vie des joueurs + * @param vie la barre de vie à mettre à jour + */ + public void majVie(JProgressBar vie){ + if(vie.getValue()*5 > 60 ){ + vie.setForeground(new Color(17,185,17)); + } + else if(vie.getValue()*5 > 30){ + vie.setForeground(new Color(247, 183, 49)); + } + else if(vie.getValue()*5 > 10){ + vie.setForeground(new Color(255,137,33)); + } + else{ + vie.setForeground(new Color(238,40,40)); + } + } + + /** + * incremente le compteur de tours + */ + public void incrCompt(){ + this.compteur_t++; + } + + /** + * reinitialise la grille de l'ennemi + */ + public void resetGrilleEnnemi() { + for(int i=0;i<10;i++) { + for(int j=0;j<10;j++) { + buttonGrilleC[i][j].setBackground(new Color(0x2980b9));; + } + } + } + + /** + * Intialise une partie sur le serveur + * @return true si la partie à été correctement initialiser, false sinon + * @throws UnirestException + * @throws BadIdException + */ + public boolean partieInitialiser() throws UnirestException, BadIdException { + return Network.getInfo(HTTP_LOCALHOST, g, pl)==1; + + } + /** + * Rejoint une partie + * @return true si la partie à été rejoint,false sinon + * @throws UnirestException + * @throws BadIdException + */ + public boolean partieJoin() throws UnirestException, BadIdException { + return Network.getInfo(HTTP_LOCALHOST, g, pl)==-1; + + } + /** + * Affiche un nouveau panel pour avertir que l'on à gagné ou perdu + * @param state à 0 si le joueur à perdu, 1 sinon + */ + public void goEndGame(int state) { + this.getContentPane().removeAll(); + this.repaint(); + + JPanel principal = new JPanel(); + principal.setLayout(new GridLayout(3, 1)); + principal.setBackground(new Color(0x15222f)); + + go_menu_button.setBackground(new Color(0x15222f)); + + ImageIcon icon; // Définition du GIF + JLabel label; // Définition du texte + + if (state == 1) { + // Le joueur à gagné + icon = new ImageIcon("img/win.gif"); + label = new JLabel("<html><p style='font-size: 80px; color: #27ae60;'>Gagné !!!</p></html>"); + }else{ + // Le joueur à perdu + icon = new ImageIcon("img/loose.gif"); + label = new JLabel("<html><p style='font-size: 80px; color: #e74c3c;'>¯\\_(ツ)_/¯</p></html>"); + try { + File soundFile = new File("sound/loseTheme.wav"); //chargement d'un seul son + AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(soundFile); // mise en place du son venant du dossier soundBD + clip = AudioSystem.getClip(); // association de CLIP + clip.open(audioInputStream); //overture du clip audio + clip.start(); + } catch (UnsupportedAudioFileException e1) { + e1.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } catch (LineUnavailableException e3) { + e3.printStackTrace(); + } + } + // Définition du Label contenant le GIF + JLabel gif = new JLabel(icon); + + // Récupération de la taille de l'écran de l'utilisateur + int screenWidth = (int) GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth(); + int screenHeight = (int) GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight(); + + // Définition de la largeur du label + label.setPreferredSize(new Dimension(screenWidth, 70)); + label.setHorizontalAlignment(SwingConstants.CENTER); + + // Ajout de tout les éléments + principal.add(label); + principal.add(gif); + principal.add(go_menu_button); + + // Intégration au panel principal + this.add(principal); + + + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + this.getContentPane().add(principal); // affiche la fenetre + this.setPreferredSize(new Dimension(screenWidth, screenHeight-50)); + this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + this.pack(); + this.setLocation(0, 0); + this.setVisible(true); + } + public void setEnnemy(String n){ + this.ennemy = n; + this.majEnnemy(); + } + public void majEnnemy(){ + joueur2.setText("<html><p style='color : "+ fontColor +";'>Flotte de "+ getEnnemy()+"</p></html>"); // creation de la barre de vie du joueur n 2 + + } + + public String getEnnemy(){ + return this.ennemy; + } + +} diff --git a/test/CoordTest.java b/test/CoordTest.java new file mode 100644 index 0000000000000000000000000000000000000000..cc099b2c4ab595a6d2c136818ba3983accb3ae0d --- /dev/null +++ b/test/CoordTest.java @@ -0,0 +1,217 @@ +import info1.ships.BadCoordException; +import info1.ships.Coord; +import info1.ships.ICoord; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + + +/** + * Des cas de tests pour la classe Coord + * + * @author Arnaud LANOIX + * @version 1.0 + */ + + +public class CoordTest { + + + @Test + public void testCoord1() throws Exception { + ICoord c = new Coord("A5"); + assertEquals(1, c.getX()); + assertEquals('A', c.getAlphaX()); + assertEquals(5, c.getY()); + } + + @Test + public void testCoord2() throws Exception { + ICoord c = new Coord("E5"); + assertEquals(5, c.getX()); + assertEquals('E', c.getAlphaX()); + assertEquals(5, c.getY()); + } + + @Test + public void testCoord3() throws Exception { + ICoord c = new Coord("J5"); + assertEquals(10, c.getX()); + assertEquals('J', c.getAlphaX()); + assertEquals(5, c.getY()); + } + + @Test + public void testCoord4() throws Exception { + ICoord c = new Coord("E1"); + assertEquals(5, c.getX()); + assertEquals('E', c.getAlphaX()); + assertEquals(1, c.getY()); + } + + @Test + public void testCoord5() throws Exception { + ICoord c = new Coord("E10"); + assertEquals(5, c.getX()); + assertEquals('E', c.getAlphaX()); + assertEquals(10, c.getY()); + } + + + @Test + public void testCoordException() throws Exception { + assertThrows(BadCoordException.class, () ->new Coord("15")); + } + + + @Test + public void testCoordException2() throws Exception { + try { + new Coord("05"); + fail("Exception expected!!!"); + } + catch(BadCoordException e) { + assertTrue(true); + } + } + + @Test + public void testCoordException3() throws Exception { + assertThrows(BadCoordException.class, () ->new Coord("95")); + } + + @Test + public void testCoordException4() throws Exception { + assertThrows(BadCoordException.class, () ->new Coord("K5")); + } + + @Test + public void testCoordException5() throws Exception { + assertThrows(BadCoordException.class, () ->new Coord("E0")); + } + + @Test + public void testCoordException6() throws Exception { + assertThrows(BadCoordException.class, () ->new Coord("E11")); + } + + + @Test + public void testEgaliteCoords1()throws Exception { + ICoord c = new Coord("E5"); + assertTrue(c.equals(c)); + } + + @Test + public void testEgaliteCoords2()throws Exception { + ICoord c = new Coord("E5"); + assertTrue(c.equals(new Coord("E5"))); + } + + @Test + public void testNonEgaliteCoords1()throws Exception { + ICoord c = new Coord("E5"); + assertFalse(c.equals(new Coord("A5"))); + } + + @Test + public void testNonEgaliteCoords2()throws Exception { + ICoord c = new Coord("E5"); + assertFalse(c.equals(new Coord("E1"))); + } + + + @Test + public void testComparaisonCoord_1() throws Exception { + ICoord c1 = new Coord("E5"); + ICoord c2 = new Coord("I9"); + assertTrue(c1.compareTo(c2) < 0); + } + + @Test + public void testComparaisonCoord_2() throws Exception { + ICoord c1 = new Coord("E5"); + ICoord c2 = new Coord("E9"); + assertTrue(c1.compareTo(c2) < 0); + } + + @Test + public void testComparaisonCoord_3() throws Exception { + ICoord c1 = new Coord("E5"); + ICoord c2 = new Coord("I5"); + assertTrue(c1.compareTo(c2) < 0); + } + + @Test + public void testComparaisonCoord_4() throws Exception { + ICoord c1 = new Coord("E5"); + ICoord c2 = new Coord("E3"); + assertTrue(c1.compareTo(c2) > 0); + } + + @Test + public void testEgalite_compare_Coords1()throws Exception { + ICoord c = new Coord("E5"); + assertTrue(c.compareTo(c) == 0); + } + + @Test + public void testEgalite_compare_Coords2()throws Exception { + ICoord c = new Coord("E5"); + assertTrue(c.compareTo(new Coord("E5")) == 0); + } + + @Test + public void testNonEgalite_compare_Coords1()throws Exception { + ICoord c = new Coord("E5"); + assertFalse(c.compareTo(new Coord("A5")) == 0); + } + + @Test + public void testNonEgalite_compare_Coords2()throws Exception { + ICoord c = new Coord("E5"); + assertFalse(c.compareTo(new Coord("E1")) == 0); + } + + @Test + public void testHashCode() throws Exception { + ICoord c = new Coord("E5"); + ICoord c2 = new Coord("E5"); + assertTrue(c.hashCode() == c2.hashCode()); + } + + @Test + public void testHashCode2() throws Exception { + ICoord c = new Coord("E5"); + assertTrue(c.hashCode() == c.hashCode()); + } + + @Test + public void testHashCodeNot() throws Exception { + ICoord c = new Coord("E5"); + ICoord c2 = new Coord("E1"); + assertFalse(c.hashCode() == c2.hashCode()); + } + + + @Test + public void testHashCodeNot2() throws Exception { + ICoord c = new Coord("E5"); + ICoord c2 = new Coord("F5"); + assertFalse(c.hashCode() == c2.hashCode()); + } + + @Test + public void testToString() throws Exception { + ICoord c = new Coord("E5"); + assertEquals("E5", c.toString()); + } + + @Test + public void testToStringNot() throws Exception { + ICoord c = new Coord("E5"); + assertNotEquals("e5", c.toString()); + } + + +} \ No newline at end of file diff --git a/test/NavyFleetTest.java b/test/NavyFleetTest.java new file mode 100644 index 0000000000000000000000000000000000000000..82ba4cf3e58430d6bbb68c0cb95b8d2783bb3083 --- /dev/null +++ b/test/NavyFleetTest.java @@ -0,0 +1,413 @@ +import info1.ships.*; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.*; + + +/** + * Des cas de tests pour la classe NavyFleet + * + * @author Arnaud LANOIX + * @version 1.0 + */ + +public class NavyFleetTest { + + INavyFleet maFlotte; + IShip monPorteAvion, monCuirasse, monSousMarin, monCroiseur, monTorpilleur, autreTorpilleur, autreCroiseur; + + @BeforeEach + public void init() throws Exception { + maFlotte = new NavyFleet(); + monPorteAvion = new AircraftCarrier("un porteavion", "E5", "E9"); + monCuirasse = new Battleship("un cuirassé", "B2", "E2"); + monSousMarin = new Submarine("un sous-marin", "G10"); + monCroiseur = new Cruiser("un croiseur", "B8", "B6"); + monTorpilleur = new Destroyer("un torpilleur", "H3", "H4"); + autreTorpilleur = new Destroyer("un autre torpilleur", "D9", "C9"); + autreCroiseur = new Cruiser("un autre croiseur", "J8", "H8"); + } + + @Test + public void testInit() { + assertEquals(20, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout1bateau() throws Exception { + assertEquals(0, maFlotte.add(monPorteAvion)); + assertEquals(15, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout2bateaux() throws Exception { + maFlotte.add(monPorteAvion); + assertEquals(0, maFlotte.add(monCuirasse)); + assertEquals(11, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout3bateaux() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + assertEquals(0, maFlotte.add(monSousMarin)); + assertEquals(10, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout4bateaux() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + assertEquals(0, maFlotte.add(monCroiseur)); + assertEquals(7, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout5bateaux() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + assertEquals(0, maFlotte.add(monTorpilleur)); + assertEquals(5, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + } + + @Test + public void testAjout6bateaux() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + assertEquals(0, maFlotte.add(autreTorpilleur)); + assertEquals(3, maFlotte.remainingSize()); + assertFalse(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + } + + @Test + public void testAjoutFlotteComplete() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreTorpilleur); + assertEquals(0, maFlotte.add(autreCroiseur)); + assertEquals(0, maFlotte.remainingSize()); + assertTrue(maFlotte.isComplete()); + System.out.println(maFlotte.toString()); + } + + @Test + public void testAjout_tailleDepassee() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreTorpilleur); + int sizeBeforeAdd = maFlotte.remainingSize(); + assertEquals(-2, maFlotte.add(new AircraftCarrier("tester", "J8", "F8"))); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout_BateauDejaPresent_1() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + int sizeBeforeAdd = maFlotte.remainingSize(); + assertEquals(-1, maFlotte.add(monCuirasse)); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout_BateauDejaPresent_2() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + int sizeBeforeAdd = maFlotte.remainingSize(); + assertEquals(-1, maFlotte.add(new AircraftCarrier("un porteavion", "E5", "E9"))); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout_BateauSurXPositionnes_1() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + int sizeBeforeAdd = maFlotte.remainingSize(); + IShip tester = new Battleship("tester", "E2", "E5"); + assertEquals(-3, maFlotte.add(tester)); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout_BateauSurXPositionnes_2() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + int sizeBeforeAdd = maFlotte.remainingSize(); + IShip tester = new Cruiser("tester", "E6", "E8"); + assertEquals(-3, maFlotte.add(tester)); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + + } + + @Test + public void testAjout_BateauSurXPositionnes_3() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + int sizeBeforeAdd = maFlotte.remainingSize(); + IShip tester = new Cruiser("tester", "H10", "F10"); + assertEquals(-3, maFlotte.add(tester)); + assertEquals(sizeBeforeAdd, maFlotte.remainingSize()); + System.out.println(maFlotte.toString()); + } + + @Test + public void testJsonNavyFleet() throws Exception { + NavyFleet f = new NavyFleet(); + f.add(new AircraftCarrier("monPorteAvion", "E5", "E9")); + f.add(new Battleship("monCuirasse", "B2", "E2")); + f.add(new Submarine("monSousMarin", "G10")); + f.add(new Cruiser("monCroiseur", "B8", "B6")); + f.add(new Destroyer("monTorpilleur", "H3", "H4")); + f.add(new Destroyer("autreTorpilleur", "D9", "C9")); + f.add(new Cruiser("autreCroiseur", "J8", "H8")); + assertEquals("[" + + "{\"bateau\":\"monSousMarin\"," + + "\"coordonnees\":[{\"x\":6,\"y\":9}]}," + + "{\"bateau\":\"autreTorpilleur\"," + + "\"coordonnees\":[{\"x\":3,\"y\":8},{\"x\":2,\"y\":8}]}," + + "{\"bateau\":\"monTorpilleur\"," + + "\"coordonnees\":[{\"x\":7,\"y\":2},{\"x\":7,\"y\":3}]}," + + "{\"bateau\":\"autreCroiseur\"," + + "\"coordonnees\":[{\"x\":9,\"y\":7},{\"x\":8,\"y\":7},{\"x\":7,\"y\":7}]}," + + "{\"bateau\":\"monCroiseur\"," + + "\"coordonnees\":[{\"x\":1,\"y\":7},{\"x\":1,\"y\":6},{\"x\":1,\"y\":5}]}," + + "{\"bateau\":\"monCuirasse\"," + + "\"coordonnees\":[{\"x\":1,\"y\":1},{\"x\":2,\"y\":1},{\"x\":3,\"y\":1},{\"x\":4,\"y\":1}]}," + + "{\"bateau\":\"monPorteAvion\"," + + "\"coordonnees\":[{\"x\":4,\"y\":4},{\"x\":4,\"y\":5},{\"x\":4,\"y\":6},{\"x\":4,\"y\":7},{\"x\":4,\"y\":8}]}" + + "]", + f.asJSON().toString()); + } + + @Test + public void testListeTrieeBateaux() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + List<IShip> expected = Arrays.asList(monSousMarin, autreTorpilleur, monTorpilleur, autreCroiseur, monCroiseur, monCuirasse, monPorteAvion); + assertIterableEquals(expected, maFlotte.getShips()); + } + + @Test void testCategoriePorteAvion() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + Set<IShip> set = maFlotte.getShips(ShipCategory.AIRCRAFT_CARRIER); + assertEquals(1, set.size()); + assertTrue(set.contains(monPorteAvion)); + } + + @Test void testCategorieCuirasse() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + Set<IShip> set = maFlotte.getShips(ShipCategory.BATTLESHIP); + assertEquals(1, set.size()); + assertTrue(set.contains(monCuirasse)); + } + + @Test void testCategorieCroiseur() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + Set<IShip> set = maFlotte.getShips(ShipCategory.CRUISER); + assertEquals(2, set.size()); + assertTrue(set.contains(monCroiseur)); + assertTrue(set.contains(autreCroiseur)); + } + + @Test void testCategorieTorpilleur() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + Set<IShip> set = maFlotte.getShips(ShipCategory.DESTROYER); + assertEquals(2, set.size()); + assertTrue(set.contains(monTorpilleur)); + assertTrue(set.contains(autreTorpilleur)); + } + + @Test void testCategorieSousmarin() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monSousMarin); + maFlotte.add(monCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreCroiseur); + maFlotte.add(autreTorpilleur); + Set<IShip> set = maFlotte.getShips(ShipCategory.SUBMARINE); + assertEquals(1, set.size()); + assertTrue(set.contains(monSousMarin)); + } + + /* flotte belge = + 1 cuirassé, 2 croiseurs, 3 torpilleurs, 4 sous-marins + */ + + + // TODO tests isBelgianConfiguration() + + @Test void testEstBelge_OK() throws Exception { + assertEquals(0,maFlotte.add(monCuirasse)); + assertEquals(0,maFlotte.add(monCroiseur)); + assertEquals(0,maFlotte.add(autreCroiseur)); + assertEquals(0,maFlotte.add(monTorpilleur)); + assertEquals(0,maFlotte.add(autreTorpilleur)); + assertEquals(0,maFlotte.add(new Destroyer("encoreUnTorpilleur", "A5", "B5"))); + assertEquals(0,maFlotte.add(monSousMarin)); + assertEquals(0,maFlotte.add(new Submarine("autre Sous Marin", "J2"))); + assertEquals(0,maFlotte.add(new Submarine("encore autre Sous Marin", "J4"))); + assertEquals(0,maFlotte.add(new Submarine("et un dernier Sous Marin", "J6"))); + assertTrue(maFlotte.isComplete()); + assertTrue(maFlotte.isBelgianConfiguration()); + } + + @Test void testEstBelge_OK_2() throws Exception { + assertEquals(0,maFlotte.add(new Destroyer("encoreUnTorpilleur", "A5", "B5"))); + assertEquals(0,maFlotte.add(monCuirasse)); + assertEquals(0,maFlotte.add(new Submarine("et un dernier Sous Marin", "J6"))); + assertEquals(0,maFlotte.add(autreCroiseur)); + assertEquals(0,maFlotte.add(monTorpilleur)); + assertEquals(0,maFlotte.add(monCroiseur)); + assertEquals(0,maFlotte.add(new Submarine("encore autre Sous Marin", "J4"))); + assertEquals(0,maFlotte.add(monSousMarin)); + assertEquals(0,maFlotte.add(autreTorpilleur)); + assertEquals(0,maFlotte.add(new Submarine("autre Sous Marin", "J2"))); + assertTrue(maFlotte.isBelgianConfiguration()); + } + + @Test void testEstBelge_KO_1() throws Exception { + assertEquals(0,maFlotte.add(new Destroyer("encoreUnTorpilleur", "A5", "B5"))); + assertEquals(0,maFlotte.add(monCuirasse)); + assertEquals(0,maFlotte.add(new Submarine("et un dernier Sous Marin", "J6"))); + assertEquals(0,maFlotte.add(autreCroiseur)); + assertEquals(0,maFlotte.add(monTorpilleur)); + assertEquals(0,maFlotte.add(monSousMarin)); + assertEquals(0,maFlotte.add(autreTorpilleur)); + assertEquals(0,maFlotte.add(new Submarine("autre Sous Marin", "J2"))); + assertFalse(maFlotte.isBelgianConfiguration()); + } + + @Test void testEstBelge_KO_2() throws Exception { + assertEquals(0,maFlotte.add(monCuirasse)); + assertEquals(0,maFlotte.add(new Submarine("et un dernier Sous Marin", "J6"))); + assertEquals(0,maFlotte.add(autreCroiseur)); + assertEquals(0,maFlotte.add(monTorpilleur)); + assertEquals(0,maFlotte.add(monCroiseur)); + assertEquals(0,maFlotte.add(new Submarine("encore autre Sous Marin", "J4"))); + assertEquals(0,maFlotte.add(monSousMarin)); + assertEquals(0,maFlotte.add(autreTorpilleur)); + assertEquals(0,maFlotte.add(new Submarine("autre Sous Marin", "J2"))); + assertFalse(maFlotte.isBelgianConfiguration()); + } + + @Test void testEstBelge_KO_francaise() throws Exception { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monCroiseur); + maFlotte.add(autreCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreTorpilleur); + maFlotte.add(monSousMarin); + assertFalse(maFlotte.isBelgianConfiguration()); + } + + + /* + flotte française = + 1 porte-avion, 1 cuirassé, 2 croiseurs, 2 torpilleurs, 1 sous-marin + + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monCroiseur); + maFlotte.add(autreCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreTorpilleur); + maFlotte.add(monSousMarin); + + */ + + // TODO tests isFrenchConfiguration() + + @Test + public void testEstFrancaise_OK() { + maFlotte.add(monPorteAvion); + maFlotte.add(monCuirasse); + maFlotte.add(monCroiseur); + maFlotte.add(autreCroiseur); + maFlotte.add(monTorpilleur); + maFlotte.add(autreTorpilleur); + maFlotte.add(monSousMarin); + assertTrue(maFlotte.isFrenchConfiguration()); + } + + +} diff --git a/test/RunningGameTest.java b/test/RunningGameTest.java new file mode 100644 index 0000000000000000000000000000000000000000..39e4fa131fbe78a77cf3ef2a1afbb31f21297935 --- /dev/null +++ b/test/RunningGameTest.java @@ -0,0 +1,338 @@ +import info1.network.BadIdException; +import info1.network.Game; +import info1.network.Network; +import info1.network.Player; +import info1.ships.*; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * + * Classe de tests démontrant le déroulement d'une partie en utilisant la librairie Network. + * + * ATTENTION : necessite d'avoir développer les classes du package info1.ships.* + * + * @author Arnaud Lanoix + * @version 2.0 + */ + +public class RunningGameTest { + + public static final String HTTP_LOCALHOST = "http://37.187.38.219/api/v0"; + + static Player joueur1; + static Player joueur2; + + static INavyFleet flotte1; + static INavyFleet flotte2; + + @BeforeAll + public static void init() throws Exception { + + joueur1 = new Player("Joueur"+Math.random()); + joueur2 = new Player("Joueur"+Math.random()); + + flotte1 = new NavyFleet(); + flotte2 = new NavyFleet(); + + Network.suscribeNewPlayer(HTTP_LOCALHOST, joueur1); + Network.suscribeNewPlayer(HTTP_LOCALHOST, joueur2); + + flotte1.add(new AircraftCarrier("monPorteAvion", "E5", "E9")); + flotte1.add(new Battleship("monCuirasse", "B2", "E2")); + flotte1.add(new Submarine("monSousMarin", "G10")); + flotte1.add(new Cruiser("monCroiseur", "B8", "B6")); + flotte1.add(new Destroyer("monTorpilleur", "H3", "H4")); + flotte1.add(new Destroyer("autreTorpilleur", "D9", "C9")); + flotte1.add(new Cruiser("autreCroiseur", "J8", "H8")); + + flotte2.add(new AircraftCarrier("monPorteAvion", "E5", "E9")); + flotte2.add(new Battleship("monCuirasse", "B2", "E2")); + flotte2.add(new Submarine("monSousMarin", "G10")); + flotte2.add(new Cruiser("monCroiseur", "B8", "B6")); + flotte2.add(new Destroyer("monTorpilleur", "H3", "H4")); + flotte2.add(new Destroyer("autreTorpilleur", "D9", "C9")); + flotte2.add(new Cruiser("autreCroiseur", "J8", "H8")); + } + + @AfterAll + public static void finish() throws Exception { + } + + @Test + public void info_init() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertEquals(1, Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-1,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + } + + @Test + public void info_init2() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur2, flotte1); + assertEquals(-1, Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(1,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + } + + @Test void info_badId() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur2, flotte1); + assertThrows(BadIdException.class, + () -> Network.getInfo(HTTP_LOCALHOST, new Game(Integer.MAX_VALUE), joueur1)); + } + + @Test + public void info_join() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + } + + + @Test + public void play_nontouche() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + assertEquals(0, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("A1"))); + } + + @Test + public void play_touche1() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E5"))); + } + + @Test + public void play_touche2() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("C9"))); + } + + @Test + public void play_touche3() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D2"))); + } + + @Test + public void play_toucheCoule_pa() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // AircraftCarrier("monPorteAvion", "E5", "E9")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E5"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E6"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E7"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E9"))); + } + + @Test + public void info_toucheCoule_pa() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // AircraftCarrier("monPorteAvion", "E5", "E9")); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E5")); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E6")); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E7")); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E8")); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E9")); + assertEquals(-10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + assertEquals(10,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + } + + + + + + @Test + public void play_toucheCoule_cu() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Battleship("monCuirasse", "B2", "E2")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("C2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E2"))); + } + + + @Test + public void play_toucheCoule_sb() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Submarine("monSousMarin", "G10")); + + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("G10"))); + } + + @Test + public void play_toucheCoule_cr1() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Cruiser("monCroiseur", "B8", "B6")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B7"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B6"))); + } + + @Test + public void play_toucheCoule_de1() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Destroyer("monTorpilleur", "H3", "H4")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H3"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H4"))); + } + + @Test + public void play_toucheCoule_de2() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Destroyer("autreTorpilleur", "D9", "C9")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D9"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("C9"))); + } + + @Test + public void play_toucheCoule_cr2() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + // Cruiser("autreCroiseur", "J8", "H8")); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("J8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("I8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H8"))); + } + + @Test + public void play_toucheCouler_gagne() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("J8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("I8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H8"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D9"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("C9"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H3"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H4"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B7"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B6"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("G10"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("C2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("B2"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E2"))); + + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E5"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E6"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E7"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(100, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("E9"))); + + assertEquals(-100,Network.getInfo(HTTP_LOCALHOST, jeu, joueur2)); + assertEquals(100,Network.getInfo(HTTP_LOCALHOST, jeu, joueur1)); + } + + @Test + public void play_toucheCoule_pasMonTour() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + assertEquals(-10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1"))); + } + + @Test + public void play_toucheCoule_pasMonTour2() throws Exception { + Game jeu = Network.initNewGame(HTTP_LOCALHOST, joueur1, flotte1); + assertTrue(Network.joinGame(HTTP_LOCALHOST, jeu, joueur2, flotte2)); + + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("J8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(1, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("I8"))); + Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur2, new Coord("A1")); + assertEquals(10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("H8"))); + + assertEquals(-10, Network.playOneTurn(HTTP_LOCALHOST, jeu, joueur1, new Coord("D9"))); + } + +} diff --git a/test/ShipTest.java b/test/ShipTest.java new file mode 100644 index 0000000000000000000000000000000000000000..10051eeacf548d5647ded7454c1c8ea247361ba6 --- /dev/null +++ b/test/ShipTest.java @@ -0,0 +1,338 @@ +import info1.ships.*; +import org.json.JSONObject; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * Des cas de tests pour tester les différents bateaux + * + * @author Arnaud LANOIX + * @version 1.0 + */ + + +class ShipTest { + + @Test + public void testCreationPorteAvion1() throws Exception { + new AircraftCarrier("qsdfg", "E5","E9"); + } + + @Test + public void testCreationPorteAvion2() throws Exception { + new AircraftCarrier("qsdfg","E9","E5"); + } + + @Test + public void testCreationPorteAvion3() throws Exception { + new AircraftCarrier("qsdfg","J6","J10"); + } + + @Test + public void testCreationPorteAvion4() throws Exception { + new AircraftCarrier("qsdfg","A1","A5"); + } + + @Test + public void testCreationPorteAvion5() throws Exception { + new AircraftCarrier("qsdfg","A1","E1"); } + + @Test + public void testCreationPorteAvion6() throws Exception { + new AircraftCarrier("qsdfg","G5","C5"); + } + + @Test void testSizePorteVavion() throws Exception { + IShip ship = new AircraftCarrier("qsdfg","A1","E1"); + assertEquals(ShipCategory.AIRCRAFT_CARRIER.getSize(), ship.getSize()); + } + + @Test void testSizeCuirasse() throws Exception { + IShip ship = new Battleship("qsdfg","A1","D1"); + assertEquals(ShipCategory.BATTLESHIP.getSize(), ship.getSize()); + } + + @Test void testSizeCroiseur() throws Exception { + IShip ship = new Cruiser("qsdfg","A1","C1"); + assertEquals(ShipCategory.CRUISER.getSize(), ship.getSize()); + } + + @Test void testSizeTorpilleur() throws Exception { + IShip ship = new Destroyer("qsdfg","A1","B1"); + assertEquals(ShipCategory.DESTROYER.getSize(), ship.getSize()); + } + + @Test void testSizeSousMarin() throws Exception { + IShip ship = new Submarine("qsdfg","A1"); + assertEquals(ShipCategory.SUBMARINE.getSize(), ship.getSize()); + } + + @Test + public void testMauvaiseCreationPorteAvionBad1() throws Exception { + assertThrows(CoordsBadShipException.class, + () ->new AircraftCarrier("qsdfg","E5","E8")); + } + + @Test + public void testMauvaiseCreationPorteAvionBad2() throws Exception { + assertThrows(CoordsBadShipException.class, + () ->new AircraftCarrier("qsdfg","E8","E5")); + } + + @Test + public void testMauvaiseCreationPorteAvionBad3() throws Exception { + assertThrows(CoordsBadShipException.class, + () ->new AircraftCarrier("qsdfg","E4","E9")); + } + + @Test + public void testMauvaiseCreationPorteAvionBad4() throws Exception { + assertThrows(CoordsBadShipException.class, + () ->new AircraftCarrier("qsdfg","G5","D5")); + } + + @Test + public void testCreationSousMarin() throws Exception { + new Submarine("XAZERTY","E5"); + } + + @Test + public void testMauvaiseCreationSousMarin() throws Exception { + assertThrows(BadCoordException.class, + () ->new Submarine("qsdfg", "E11")); + } + + @Test + public void testEgalite2PorteAvions() throws Exception { + IShip pa = new AircraftCarrier("monPorteAvion", "E5","E9"); + assertTrue(pa.equals(pa)); + } + + @Test + public void testEgalite2PorteAvions_2() throws Exception { + IShip pa = new AircraftCarrier("monPorteAvion", "E5","E9"); + assertTrue(pa.equals(new AircraftCarrier("monPorteAvion","E5","E9"))); + } + + @Test + public void testNonEgalite2PorteAvions_positionsDiff() throws Exception { + IShip pa = new AircraftCarrier("monPorteAvion", "E5","E9"); + assertFalse(pa.equals(new AircraftCarrier("monPorteAvion","J2","F2"))); + } + + @Test + public void testEgalite2sousMarins() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertTrue(sb.equals(sb)); + } + + @Test + public void testEgalite2sousMarins_2() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertTrue(sb.equals(new Submarine("monSousMarin", "G10"))); + } + + @Test + public void testPasEgalite2sousMarins() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertFalse(sb.equals(new Submarine("AZE", "G10"))); + } + + @Test + public void testPasEgalite2sousMarins_2() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertFalse(sb.equals(new Submarine("monSousMarin", "A10"))); + } + + @Test + public void testPasEgalite2sousMarins_3() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertFalse(sb.equals(new Submarine("monSousMarin", "G8"))); + } + + @Test + public void testPasEgalite1sousMarin1Croiseur_1() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertFalse(sb.equals(new Cruiser("monSousMarin", "G10", "E10"))); + } + + @Test + public void testPasEgalite1sousMarin1Croiseur_2() throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + assertFalse(sb.equals(new Cruiser("monSousMarin", "E10", "G10"))); + } + + @Test + public void testPasEgalite1Croiseur1SouMarin_1() throws Exception { + IShip sb = new Cruiser("monSousMarin", "G10", "E10"); + assertFalse(sb.equals(new Submarine("monSousMarin", "G10"))); + } + + @Test + public void testPasEgalite1Croiseur1sousMarin_2() throws Exception { + IShip sb = new Cruiser("monSousMarin", "E10", "G10"); + assertFalse(sb.equals(new Submarine("monSousMarin", "G10"))); + } + + @Test + public void testComparaison_sousmarinCroiseur()throws Exception { + IShip sb = new Submarine("monSousMarin", "G10"); + Ship cr = new Cruiser("monSousMarin", "G10", "E10"); + assertTrue(sb.compareTo(cr) < 0); + } + + @Test + public void testComparaison_CroiseurSousmarin()throws Exception { + Ship sb = new Submarine("monSousMarin", "G10"); + IShip cr = new Cruiser("monSousMarin", "G10", "E10"); + assertTrue(cr.compareTo(sb) > 0); + } + + @Test + public void testComparaison_CroiseurIdentique()throws Exception { + IShip cr1 = new Cruiser("monSousMarin", "G10", "E10"); + Ship cr2 = new Cruiser("monSousMarin", "G10", "E10"); + assertTrue(cr1.compareTo(cr2) == 0); + } + + @Test + public void testComparaison_CroiseurSame()throws Exception { + Ship cr1 = new Cruiser("monSousMarin", "G10", "E10"); + assertTrue(cr1.compareTo(cr1) == 0); + } + + @Test + public void testComparaison_2CroiseursNomDiff()throws Exception { + IShip cr1 = new Cruiser("aaa", "G10", "E10"); + Ship cr2 = new Cruiser("zzz", "G10", "E10"); + assertTrue(cr1.compareTo(cr2) < 0); + } + + @Test + public void testComparaison_2CroiseursNomIdentique()throws Exception { + IShip cr1 = new Cruiser("abc", "C3", "E3"); + Ship cr2 = new Cruiser("abc", "G10", "E10"); + assertTrue(cr1.compareTo(cr2) < 0); + } + + @Test + public void testListCoord_1() throws Exception { + IShip cr1 = new Cruiser("abc", "C3", "E3"); + List<ICoord> expected = Arrays.asList( + new Coord("C3"), new Coord("D3"), new Coord("E3") + ); + + assertIterableEquals(expected,cr1.getCoords()); + } + + @Test + public void testListCoord_2() throws Exception { + IShip cr1 = new Cruiser("abc", "E3", "C3"); + Object[] expected = {new Coord("E3"), new Coord("D3"), new Coord("C3")}; + + assertArrayEquals(expected,cr1.getCoords().toArray()); + } + + @Test + public void testListCoord_3() throws Exception { + IShip ship = new AircraftCarrier("abc", "C5", "G5"); + List<ICoord> expected = Arrays.asList( + new Coord("C5"), new Coord("D5"), new Coord("E5"), new Coord("F5"), new Coord("G5") + ); + + assertIterableEquals(expected, ship.getCoords()); + } + + @Test + public void testListCoord_4() throws Exception { + System.out.println("::::::"); + IShip ship = new AircraftCarrier("abc", "C3", "C7"); + List<ICoord> expected = Arrays.asList( + new Coord("C3"), new Coord("C4"), new Coord("C5"), new Coord("C6"), new Coord("C7") + ); + + System.out.println("----" + expected); + System.out.println(ship.getCoords()); + + assertIterableEquals(expected, ship.getCoords()); + } + + @Test + public void testListCoord_5() throws Exception { + + IShip ship = new AircraftCarrier("abc", "C7", "C3"); + List<ICoord> expected = Arrays.asList( + new Coord("C7"), new Coord("C6"), new Coord("C5"), new Coord("C4"), new Coord("C3") + ); + + assertIterableEquals(expected, ship.getCoords()); + } + + @Test + public void testListCoord_6() throws Exception { + IShip ship = new Submarine("abc", "C3"); + List<ICoord> expected = Arrays.asList( + new Coord("C3") + ); + assertIterableEquals(expected, ship.getCoords()); + } + + @Test + public void testJSonShip_1() throws Exception { + IShip ship = new Submarine("monSousMarin", "G10"); + JSONObject jObj = ship.asJSON(); + System.out.println(jObj.toString()); + assertEquals("{\"bateau\":\"monSousMarin\"," + + "\"coordonnees\":[{\"x\":6,\"y\":9}]}", + jObj.toString()); + + } + + @Test + public void testJSonShip_2() throws Exception { + IShip ship = new Cruiser("cruiser", "E10", "G10"); + JSONObject jObj = ship.asJSON(); + System.out.println(jObj.toString()); + assertEquals("{\"bateau\":\"cruiser\"," + + "\"coordonnees\":[{\"x\":4,\"y\":9}," + + "{\"x\":5,\"y\":9}," + + "{\"x\":6,\"y\":9}]}", + jObj.toString()); + } + + @Test + public void testJSonShip_3() throws Exception { + IShip ship = new AircraftCarrier("abc", "C3", "C7"); + JSONObject jObj = ship.asJSON(); + System.out.println(jObj.toString()); + assertEquals("{\"bateau\":\"abc\"," + + "\"coordonnees\":[{\"x\":2,\"y\":2}," + + "{\"x\":2,\"y\":3}," + + "{\"x\":2,\"y\":4}," + + "{\"x\":2,\"y\":5}," + + "{\"x\":2,\"y\":6}]}", + jObj.toString()); + } + + @Test + public void testJSonShip_4() throws Exception { + IShip ship = new AircraftCarrier("abc", "C7", "C3"); + JSONObject jObj = ship.asJSON(); + System.out.println(jObj.toString()); + assertEquals("{\"bateau\":\"abc\"," + + "\"coordonnees\":[" + + "{\"x\":2,\"y\":6}," + + "{\"x\":2,\"y\":5}," + + "{\"x\":2,\"y\":4}," + + "{\"x\":2,\"y\":3}," + + "{\"x\":2,\"y\":2}" + + "]}", + jObj.toString()); + } + + +} \ No newline at end of file