Commit 69c9ed76 authored by Jarlaxe's avatar Jarlaxe

premier draw

parent fd5f6cbe
package src.Boards;
import src.Cells.Cell;
public abstract class Board {
public final int nbOfCells=0;
public Cell[] theCells;
Board(){
}
abstract void initBoard();
Cell getCell(int index){
return null;
}
int getNbOfCells(){
return 0;
}
}
\ No newline at end of file
package src.Boards;
public class ClassicalBoard extends Board{
@Override
void initBoard() {
// TODO Auto-generated method stub
}
}
\ No newline at end of file
package src.Cells;
import src.Player;
public class Cell {
public Player occupant;
public boolean canMove(){
return true;
}
}
\ No newline at end of file
package src.Cells;
public class TrapCell extends Cell{
@Override
public boolean canMove() {
return false;
}
}
\ No newline at end of file
package src;
import java.util.ArrayList;
import src.Boards.Board;
import src.Cells.Cell;
public class Game {
ArrayList<Player> thePlayers;
Board board;
Game(Board board){
}
void addPlayer(Player p){
thePlayers.add(p);
}
boolean endGame(){
return board.theCells[board.nbOfCells-1].occupant != null;
}
void play(){
while(endGame()){
Player currentPlayer = new Player();
Cell playerCell = currentPlayer.getCell();
if (playerCell.canMove()){
// tour du joueur
}
}
}
}
\ No newline at end of file
package src;
import src.Cells.Cell;
public class Player {
Cell position;
Cell getCell(){
return position;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment