skeleton: Added initial skeleton files

This commit is contained in:
Nathan Woodburn 2023-03-15 11:38:13 +11:00
parent b6dccbd506
commit d2fc9cc781
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
8 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,12 @@
package comp1110.ass2.skeleton;
public class board {
public final island[] islands;
public final stoneCircle[] stoneCircles;
public board(island[] islands, stoneCircle[] stoneCircles) {
this.islands = islands;
this.stoneCircles = stoneCircles;
}
}

View File

@ -0,0 +1,15 @@
package comp1110.ass2.skeleton;
public class island {
public final int width;
public final int height;
public tile[][] tiles;
public final int score;
public island(int width, int height, int score) {
this.width = width;
this.height = height;
this.score = score;
this.tiles = new tile[width][height];
}
}

View File

@ -0,0 +1,17 @@
package comp1110.ass2.skeleton;
public class piece {
enum pieceType {
Settler, Villager
}
public final pieceType type;
public final player owner;
public tile placedOn;
public piece(pieceType type, player owner) {
this.type = type;
this.owner = owner;
}
}

View File

@ -0,0 +1,14 @@
package comp1110.ass2.skeleton;
public class player {
public final String name;
public final int age;
public int score;
public piece[] pieces;
public player(String name, int age) {
this.name = name;
this.age = age;
this.score = 0;
}
}

View File

@ -0,0 +1,13 @@
package comp1110.ass2.skeleton;
public class resources {
enum resourceType {
coconuts, bamboo, water, preciousStones
}
public final resourceType type;
public resources(resourceType type) {
this.type = type;
}
}

View File

@ -0,0 +1,9 @@
package comp1110.ass2.skeleton;
public class statuettes {
public final int value;
public statuettes(int value) {
this.value = value;
}
}

View File

@ -0,0 +1,20 @@
package comp1110.ass2.skeleton;
public class stoneCircle {
public final int x;
public final int y;
public boolean claimed;
public player owner;
public final resources[] resources;
public final statuettes[] statuettes;
public stoneCircle(int x, int y, resources[] resources, statuettes[] statuettes) {
this.x = x;
this.y = y;
this.claimed = false;
this.owner = null;
this.resources = resources;
this.statuettes = statuettes;
}
}

View File

@ -0,0 +1,17 @@
package comp1110.ass2.skeleton;
public class tile {
enum tileType {
Land, Water
}
public final tileType type;
public int x;
public int y;
public piece[] pieces;
public tile(tileType type, int x, int y) {
this.type = type;
this.x = x;
this.y = y;
}
}