-The rest of the game engine. I screwed up the commit last time.
This commit is contained in:
40
src/controller/PlayerController.java
Normal file
40
src/controller/PlayerController.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package controller;
|
||||
|
||||
import model.Board.TileColor;
|
||||
import model.CellPointer;
|
||||
import model.Move;
|
||||
|
||||
public class PlayerController {
|
||||
private final CellPointer cell = new CellPointer(0, 0);
|
||||
private TileColor color = TileColor.BLUE;
|
||||
private boolean ready = false;
|
||||
|
||||
public void denyMove() {
|
||||
ready = false;
|
||||
}
|
||||
|
||||
public TileColor getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public Move getMove() {
|
||||
ready = false;
|
||||
return new Move(cell, color);
|
||||
|
||||
}
|
||||
|
||||
public boolean isReady() {
|
||||
return ready;
|
||||
}
|
||||
|
||||
public void setCell(int row, int col) {
|
||||
cell.r = row;
|
||||
cell.c = col;
|
||||
|
||||
ready = true;
|
||||
}
|
||||
|
||||
public void setColor(TileColor clr) {
|
||||
color = clr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user