reorganize ex6
This commit is contained in:
18
src/Ex6/README.md
Normal file
18
src/Ex6/README.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Architecture
|
||||||
|
|
||||||
|
- The main package contains the logic.
|
||||||
|
- The network package contains the protocol implementation details.
|
||||||
|
|
||||||
|
# Running the program
|
||||||
|
|
||||||
|
## Launch server
|
||||||
|
|
||||||
|
Run Serveur.java
|
||||||
|
|
||||||
|
## Launch Client
|
||||||
|
|
||||||
|
Run Client.java
|
||||||
|
|
||||||
|
## Launch Server + Client
|
||||||
|
|
||||||
|
Run App.java
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Ex6;
|
package Ex6.main;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package Ex6;
|
package Ex6.main;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import Ex6.Jeu.EtatCase;
|
import Ex6.main.Jeu.EtatCase;
|
||||||
import Ex6.network.Connexion;
|
import Ex6.network.Connexion;
|
||||||
import Ex6.network.packets.EndGamePacket;
|
import Ex6.network.packets.EndGamePacket;
|
||||||
import Ex6.network.packets.InvalidMovePacket;
|
import Ex6.network.packets.InvalidMovePacket;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Ex6;
|
package Ex6.main;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@@ -88,7 +88,7 @@ public class Jeu {
|
|||||||
/**
|
/**
|
||||||
* Apply a move for the current player.
|
* Apply a move for the current player.
|
||||||
* Be aware that the move is not checked and should be done before.
|
* Be aware that the move is not checked and should be done before.
|
||||||
* @see Ex6.Jeu.checkWin
|
* @see Ex6.main.Jeu.checkWin
|
||||||
* @param cellIndex index of the cell to replace.
|
* @param cellIndex index of the cell to replace.
|
||||||
* @return EtatCase.Vide if no one won.
|
* @return EtatCase.Vide if no one won.
|
||||||
*/
|
*/
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package Ex6;
|
package Ex6.main;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
|
||||||
import Ex6.Jeu.EtatCase;
|
import Ex6.main.Jeu.EtatCase;
|
||||||
import Ex6.network.Connexion;
|
import Ex6.network.Connexion;
|
||||||
import Ex6.network.packets.EndGamePacket;
|
import Ex6.network.packets.EndGamePacket;
|
||||||
import Ex6.network.packets.InvalidMovePacket;
|
import Ex6.network.packets.InvalidMovePacket;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package Ex6;
|
package Ex6.main;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
@@ -22,7 +22,7 @@ public class Serveur {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a TicTacTo server on the specified port
|
* Start a TicTacToe server on the specified port
|
||||||
* @param port the port to listen to
|
* @param port the port to listen to
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
Reference in New Issue
Block a user