Dicewars-Java-Approach/server/game-logic/Manager/Field/Field.java

46 lines
1.0 KiB
Java
Raw Normal View History

2023-10-06 12:53:38 +02:00
package manager.field;
import java.util.ArrayList;
/**
* Each Field has a number of dices on it, neighbours which they can attack
* and a owner who can be changed while the Game.
* The Neighbours can be set at the beginning of the game, so the class field
* must have an option to add a neighbour as a field.
* **/
public class Field {
private int dice_number;
private ArrayList<Field> neighbours;
private Player owner;
public Field(int input_dice_number, Player input_owner){
neighbours = new ArrayList<Field>();
dice_number = input_dice_number;
owner = input_owner;
}
public ArrayList<Field> get_neighbours(){
return neighbours;
}
public void add_neighbour(Field input){
neighbours.add(input);
}
public int get_dice_number(){
return dice_number;
}
public void set_dice_number(int number){
dice_number = number;
}
public Player get_owner(){
return owner;
}
public void set_owner(Player input){
owner = input;
}
}