reformat code

main
Brett 2023-03-01 13:31:16 -05:00
parent 713be595b8
commit 7106da8e95
20 changed files with 167 additions and 164 deletions

View File

@ -4,26 +4,30 @@ import ca.cosc3p91.a2.player.Player;
public class GameEngine implements Runnable { public class GameEngine implements Runnable {
private Player player; private final boolean running = true;
private int pillageFactor; private Player player;
private int currentTime; private int pillageFactor;
public Map map; private int currentTime;
public void attackVIllage(Map map) { public Map map;
}
public Map generateMap() { public void attackVIllage(Map map) {
return null; }
}
public void getScore(Map map) { public Map generateMap() {
} return null;
}
@Override public void getScore(Map map) {
public void run() { }
} @Override
public void run() {
while (running) {
}
}
} }

View File

@ -5,31 +5,30 @@ import ca.cosc3p91.a2.gameobjects.*;
import java.util.List; import java.util.List;
public class Map { public class Map {
private Village_Hall townHall; private Village_Hall townHall;
private int guardTime; private int guardTime;
private List<Building> contains; private List<Building> contains;
public List<Inhabitant> inhabitants; public List<Inhabitant> inhabitants;
public void move(Infantry i, Tile t) { public void move(Infantry i, Tile t) {
} }
public void inRange(Infantry i, Building b) { public void inRange(Infantry i, Building b) {
} }
public void build(Village_Hall hall, Tile t, Building b) { public void build(Village_Hall hall, Tile t, Building b) {
} }
public int getGuardTime() { public int getGuardTime() {
return guardTime; return guardTime;
} }
public void setGuardTime() { public void setGuardTime() {
} }
} }

View File

@ -4,47 +4,47 @@ import java.util.List;
public abstract class Building { public abstract class Building {
private static int level; private static int level;
private int health; private int health;
private static Stage stages; private static Stage stages;
private int goldCost; private int goldCost;
private int ironCost; private int ironCost;
private int woodCost; private int woodCost;
private int buildTime; private int buildTime;
public List<Stage> stage; public List<Stage> stage;
public Tile tile; public Tile tile;
public List<Inhabitant> inhabitant; public List<Inhabitant> inhabitant;
public int getLevel() { public int getLevel() {
return level; return level;
} }
public int getHealth() { public int getHealth() {
return health; return health;
} }
public int getCost(String type) { public int getCost(String type) {
return 0; return 0;
} }
public int getUpgradeCost() { public int getUpgradeCost() {
return 0; return 0;
} }
public void upgrade() { public void upgrade() {
} }
public int getBuildTime() { public int getBuildTime() {
return 0; return 0;
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class Collector { public class Collector {
private int averageCollectionRate; private int averageCollectionRate;
public int getCollectionRate() { public int getCollectionRate() {
return averageCollectionRate; return averageCollectionRate;
} }
} }

View File

@ -2,12 +2,12 @@ package ca.cosc3p91.a2.gameobjects;
public class DefenseBuilding extends Building { public class DefenseBuilding extends Building {
public int damage; public int damage;
public int range; public int range;
public void attack(Infantry attacker) { public void attack(Infantry attacker) {
} }
} }

View File

@ -2,14 +2,14 @@ package ca.cosc3p91.a2.gameobjects;
class DefenseStage extends Stage { class DefenseStage extends Stage {
protected int dDamge; protected int dDamge;
protected int dRange; protected int dRange;
public void getDamageChange() { public void getDamageChange() {
} }
public void getRangeChange() { public void getRangeChange() {
} }
} }

View File

@ -2,12 +2,12 @@ package ca.cosc3p91.a2.gameobjects;
public class Farm extends ResourceBuidling { public class Farm extends ResourceBuidling {
public int getPopulationContribution() { public int getPopulationContribution() {
return 0; return 0;
} }
@Override @Override
public void harvest(Village_Hall hall) { public void harvest(Village_Hall hall) {
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class GoldMine extends ResourceBuidling { public class GoldMine extends ResourceBuidling {
public static String resource = "good"; public static String resource = "good";
@Override @Override
public void harvest(Village_Hall hall) { public void harvest(Village_Hall hall) {
} }
} }

View File

@ -2,22 +2,22 @@ package ca.cosc3p91.a2.gameobjects;
public abstract class Infantry { public abstract class Infantry {
private int health; private int health;
private int damage; private int damage;
private int range; private int range;
public void attack(Building b) { public void attack(Building b) {
} }
public void getHealth() { public void getHealth() {
} }
public void getDamage() { public void getDamage() {
} }
public void getRange() { public void getRange() {
} }
} }

View File

@ -4,11 +4,11 @@ import ca.cosc3p91.a2.game.Map;
public interface Inhabitant { public interface Inhabitant {
public Map map = null; Map map = null;
public Building building = null; Building building = null;
public void move(Tile t); void move(Tile t);
public void getPosition(); void getPosition();
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class IronMine extends ResourceBuidling { public class IronMine extends ResourceBuidling {
public static String resource = "iron"; public static String resource = "iron";
@Override @Override
public void harvest(Village_Hall hall) { public void harvest(Village_Hall hall) {
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class LumberMine extends ResourceBuidling { public class LumberMine extends ResourceBuidling {
public static String resource = "wood"; public static String resource = "wood";
public void harvest(Village_Hall hall) { public void harvest(Village_Hall hall) {
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public abstract class ResourceBuidling extends Building { public abstract class ResourceBuidling extends Building {
public static String resource; public static String resource;
private int harvest_rate; private int harvest_rate;
public abstract void harvest(Village_Hall hall); public abstract void harvest(Village_Hall hall);
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class ResourceStage extends Stage { public class ResourceStage extends Stage {
protected int harvestRateIncrease; protected int harvestRateIncrease;
public int getHarvestRateIncrease() { public int getHarvestRateIncrease() {
return harvestRateIncrease; return harvestRateIncrease;
} }
} }

View File

@ -2,33 +2,33 @@ package ca.cosc3p91.a2.gameobjects;
abstract class Stage { abstract class Stage {
protected int dHealth; protected int dHealth;
protected int goldCost; protected int goldCost;
protected int requiredVillageLevel; protected int requiredVillageLevel;
protected int upgradeTime; protected int upgradeTime;
protected int ironCost; protected int ironCost;
protected int woodCost; protected int woodCost;
public Building building; public Building building;
public void getHealthChange() { public void getHealthChange() {
} }
public int getCost(String type) { public int getCost(String type) {
return 0; return 0;
} }
public int getRequiredVillageLevel() { public int getRequiredVillageLevel() {
return requiredVillageLevel; return requiredVillageLevel;
} }
public int getUpgradeTime() { public int getUpgradeTime() {
return upgradeTime; return upgradeTime;
} }
} }

View File

@ -4,10 +4,10 @@ import java.util.List;
public class Tile { public class Tile {
public int x; public int x;
public int y; public int y;
public List<Building> building; public List<Building> building;
} }

View File

@ -2,22 +2,22 @@ package ca.cosc3p91.a2.gameobjects;
class VillageStage extends Stage { class VillageStage extends Stage {
protected int goldCapacityIncrease; protected int goldCapacityIncrease;
protected int ironCapacityIncrease; protected int ironCapacityIncrease;
protected int woodCapacityIncrease; protected int woodCapacityIncrease;
public int getGoldCapacityIncrease() { public int getGoldCapacityIncrease() {
return goldCapacityIncrease; return goldCapacityIncrease;
} }
public int getIronCapacityIncrease() { public int getIronCapacityIncrease() {
return ironCapacityIncrease; return ironCapacityIncrease;
} }
public int getWoodCapacityIncrease() { public int getWoodCapacityIncrease() {
return woodCapacityIncrease; return woodCapacityIncrease;
} }
} }

View File

@ -2,22 +2,22 @@ package ca.cosc3p91.a2.gameobjects;
public class Village_Hall extends Building { public class Village_Hall extends Building {
private int goldCapacity; private int goldCapacity;
private int ironCapacity; private int ironCapacity;
private int woodCapacity; private int woodCapacity;
public int getGoldCapacity() { public int getGoldCapacity() {
return goldCapacity; return goldCapacity;
} }
public int getIronCapacity() { public int getIronCapacity() {
return ironCapacity; return ironCapacity;
} }
public int getWoodCapacity() { public int getWoodCapacity() {
return woodCapacity; return woodCapacity;
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.gameobjects;
public class Worker { public class Worker {
private boolean currentlyBuilding; private boolean currentlyBuilding;
public boolean isCurrentlyBuilding() { public boolean isCurrentlyBuilding() {
return currentlyBuilding; return currentlyBuilding;
} }
} }

View File

@ -2,10 +2,10 @@ package ca.cosc3p91.a2.player;
public class Player { public class Player {
public int currentGold; public int currentGold;
public int currentIron; public int currentIron;
public int currentWood; public int currentWood;
} }