Add some classes

This commit is contained in:
2025-10-10 16:25:35 +07:00
parent 1e164bd2ff
commit a1c197b5d5
8 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package org.main.client;
public class Cell{
boolean isPopulated;
Pawn populatingObject;
Cell(){
this.isPopulated = false;
this.populatingObject = null;
}
Pawn getObject(){
return this.populatingObject;
}
void setObject(Pawn object){
this.populatingObject = object;
}
}

View File

@@ -1 +1,10 @@
package org.main.client;
public class Field{
Cell[] ringCells;
Field(){
this.ringCells[28] = new Cell();
}
}

View File

@@ -0,0 +1,5 @@
package org.main.client;
public interface GameConnectable{
void Connect();
}

View File

@@ -0,0 +1,7 @@
package org.main.client;
public class LocalGame implements GameConnectable{
public void Connect(){
//TODO: implement game starting code
}
}

View File

@@ -1 +1,27 @@
package org.main.client;
import java.io.BufferedReader;
import java.io.IOException;
public class Menu{
void DisplayMenu(char menuEntry){
if(menuEntry == 0){
System.out.println("1. ");
}
}
void RotateEntries(BufferedReader br){
char choice = 0;
while(choice != 5){
try{
choice = br.readLine().charAt(0);
} catch(IOException e){
System.out.println("Input/output error while reading symbol from console");
}
this.DisplayMenu(choice);
}
}
}

View File

@@ -1 +1,32 @@
package org.main.client;
public class Pawn{
Cell currentCell;
Cell homeCell;
String command;
boolean isOnField;
boolean isInHome;
Pawn(String command, Cell[] plenumCells){
this.command = command;
this.isOnField = false;
this.isInHome = false;
if(command == "red"){
this.homeCell = this.currentCell = plenumCells[21];
}
if(command == "green"){
this.homeCell = this.currentCell = plenumCells[0];
}
if(command == "blue"){
this.homeCell = this.currentCell = plenumCells[7];
}
if(command == "white"){
this.homeCell = this.currentCell = plenumCells[14];
}
}
boolean checkHome(Cell checkCell){
return checkCell == homeCell;
}
}

View File

@@ -0,0 +1,8 @@
package org.main.client;
public class RemoteGame implements GameConnectable{
public void Connect(){
//TODO: implement game starting code
;
}
}

BIN
kus.tar Normal file

Binary file not shown.