Commit 2981c443 authored by dkonam's avatar dkonam

Merge branch 'Data/Structures' into Data/develop

parents 6e9d6017 2ab5580e
......@@ -5,6 +5,7 @@
*/
package com.utclo23.data.facade;
import com.utclo23.data.structure.Coordinate;
import com.utclo23.data.structure.Event;
import com.utclo23.data.structure.Game;
import com.utclo23.data.structure.LightPublicUser;
......@@ -84,7 +85,7 @@ public class DataFacade implements IDataCom, IDataIHMTable, IDataIHMMain{
}
@Override
public boolean attack(Integer[] coords) {
public boolean attack(Coordinate coords) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
......
......@@ -16,7 +16,7 @@ import java.util.ArrayList;
public interface IDataIHMTable {
public ArrayList<Ship> getShips();
public void setShip(Ship ship);
public boolean attack(Integer[] coords);
public boolean attack(Coordinate coords);
public void leaveGame();
public ArrayList<Ship> getInitialBoardFromGameId(UID gameid);
public ArrayList<Event> getPreviousBoard();
......
......@@ -9,7 +9,7 @@ package com.utclo23.data.structure;
*
* @author lucillefargeau
*/
public class Coordonnees {
public class Coordinate {
private int x;
private int y;
......@@ -29,7 +29,7 @@ public class Coordonnees {
this.y = y;
}
public Coordonnees(int x, int y) {
public Coordinate(int x, int y) {
this.x = x;
this.y = y;
}
......
......@@ -11,14 +11,12 @@ package com.utclo23.data.structure;
*/
public class Mine extends Event {
private Player owner;
private Integer[] coord;
private Coordinate coord;
public Mine(Player owner, int x, int y)
public Mine(Player owner, Coordinate coord)
{
this.owner = owner;
this.coord = new Integer[2];
this.coord[0] = x;
this.coord[1] = y;
this.coord = coord;
}
......@@ -30,11 +28,11 @@ public class Mine extends Event {
this.owner = owner;
}
public Integer[] getCoord() {
public Coordinate getCoord() {
return coord;
}
public void setCoord(Integer[] coord) {
public void setCoord(Coordinate coord) {
this.coord = coord;
}
......
......@@ -14,9 +14,9 @@ import java.util.ArrayList;
public class Ship {
private ShipType type;
private Player owner;
private ArrayList<Integer[]> listCoord;
private ArrayList<Coordinate> listCoord;
public Ship(ShipType type, Player owner, ArrayList<Integer[]> listCoord) {
public Ship(ShipType type, Player owner, ArrayList<Coordinate> listCoord) {
this.type = type;
this.owner = owner;
this.listCoord = listCoord;
......@@ -38,11 +38,11 @@ public class Ship {
this.owner = owner;
}
public ArrayList<Integer[]> getListCoord() {
public ArrayList<Coordinate> getListCoord() {
return listCoord;
}
public void setListCoord(ArrayList<Integer[]> listCoord) {
public void setListCoord(ArrayList<Coordinate> listCoord) {
this.listCoord = listCoord;
}
......
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