Compare commits
No commits in common. "0495018430c8418f19ac5016dcd9f30ef755a793" and "f0844a65640d58e82673c26e8ee5ff25a785cde8" have entirely different histories.
0495018430
...
f0844a6564
|
@ -1,13 +1,34 @@
|
||||||
package ca.cosc3p91.a2;
|
package ca.cosc3p91.a2;
|
||||||
|
|
||||||
import ca.cosc3p91.a2.game.GameEngine;
|
import ca.cosc3p91.a2.game.GameEngine;
|
||||||
|
import ca.cosc3p91.a2.util.Print;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
GameEngine engine = new GameEngine();
|
GameEngine engine = new GameEngine();
|
||||||
|
|
||||||
engine.printState();
|
<<<<<<< HEAD
|
||||||
|
engine.printMap();
|
||||||
|
=======
|
||||||
|
Print test = new Print("Hello There", 2);
|
||||||
|
|
||||||
|
test.addColumn(new Print.Column("I am value 1"));
|
||||||
|
test.addColumn(new Print.Column("Super Value"));
|
||||||
|
test.addColumn(new Print.Column("SOLD!"));
|
||||||
|
|
||||||
|
Print.Row row = new Print.Row();
|
||||||
|
row.add("HelloThere");
|
||||||
|
row.add("Goodbye");
|
||||||
|
row.add("3");
|
||||||
|
|
||||||
|
test.addRow(row);
|
||||||
|
test.addRow(row);
|
||||||
|
test.addRow(row);
|
||||||
|
|
||||||
|
Print.print(test.createTable());
|
||||||
|
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
engine.run();
|
engine.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,41 +1,44 @@
|
||||||
package ca.cosc3p91.a2.game;
|
package ca.cosc3p91.a2.game;
|
||||||
|
|
||||||
import ca.cosc3p91.a2.gameobjects.*;
|
import ca.cosc3p91.a2.gameobjects.Building;
|
||||||
import ca.cosc3p91.a2.player.*;
|
import ca.cosc3p91.a2.gameobjects.VillageStage;
|
||||||
|
import ca.cosc3p91.a2.gameobjects.Village_Hall;
|
||||||
|
import ca.cosc3p91.a2.player.Player;
|
||||||
|
|
||||||
public class GameEngine implements Runnable {
|
public class GameEngine implements Runnable {
|
||||||
|
|
||||||
|
private final boolean running = true;
|
||||||
|
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
||||||
private int pillageFactor;
|
private int pillageFactor;
|
||||||
|
|
||||||
private int currentTime;
|
private int currentTime;
|
||||||
|
|
||||||
public Map map;
|
<<<<<<< HEAD
|
||||||
|
public GameEngine () {
|
||||||
public GameEngine() {
|
|
||||||
player = new Player();
|
player = new Player();
|
||||||
VillageStage vInitialStage = new VillageStage(100, 0, 2, 30, 0,
|
VillageStage vInitialStage = new VillageStage(100,0,2,30,0,
|
||||||
0, 12, 12, 12);
|
0, 12,12,12);
|
||||||
map = new Map(new Village_Hall(1, vInitialStage), 30);
|
map = new Map(new Village_Hall(1,vInitialStage),30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printState() {
|
public void printMap() {
|
||||||
// Print toPrint = new Print("~ Current Village Buildings ~",2);
|
System.out.println("~ Current Map State ~\n\n");
|
||||||
|
|
||||||
System.out.println("In Map:\n");
|
System.out.println("In Map:\n");
|
||||||
System.out.println("\t~ Current Village Buildings ~\n");
|
|
||||||
for (Building b : map.contains) {
|
for (Building b : map.contains) {
|
||||||
System.out.println("\t|> " + b.getClass().getSimpleName() + " lvl: " + b.getLevel() + " health: " + b.getHealth());
|
System.out.println("|> "+b.getClass().toString()+" lvl: "+b.getLevel()+" health: "+b.getHealth());
|
||||||
}
|
|
||||||
System.out.println("\n\t~ Current Village Inhabitants ~\n\n");
|
|
||||||
for (Inhabitant i : map.inhabitants) {
|
|
||||||
System.out.println("\t|> " + i.getClass().getSimpleName() + " lvl: " + i.getLevel());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void attackVillage(Map map) {
|
public void attackVillage(Map map) {
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public Map map;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
|
public void attackVIllage(Map map) {
|
||||||
|
}
|
||||||
|
|
||||||
public Map generateMap() {
|
public Map generateMap() {
|
||||||
return null;
|
return null;
|
||||||
|
@ -46,6 +49,8 @@ public class GameEngine implements Runnable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
while (running) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,19 +5,31 @@ import ca.cosc3p91.a2.gameobjects.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public class Map {
|
public class Map {
|
||||||
|
|
||||||
static int MAXSIZE = 400;
|
static int MAXSIZE = 400;
|
||||||
|
|
||||||
private Village_Hall townHall;
|
private Village_Hall townHall;
|
||||||
|
=======
|
||||||
|
|
||||||
|
public class Map {
|
||||||
|
|
||||||
|
private Village_Hall townHall;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
private int guardTime;
|
private int guardTime;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public List<Building> contains;
|
public List<Building> contains;
|
||||||
|
=======
|
||||||
|
private List<Building> contains;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public List<Inhabitant> inhabitants;
|
public List<Inhabitant> inhabitants;
|
||||||
|
|
||||||
public Map(Village_Hall villageHall, int gTime) {
|
<<<<<<< HEAD
|
||||||
|
public Map (Village_Hall villageHall, int gTime) {
|
||||||
contains = new ArrayList<>();
|
contains = new ArrayList<>();
|
||||||
inhabitants = new ArrayList<>();
|
inhabitants = new ArrayList<>();
|
||||||
this.townHall = villageHall;
|
this.townHall = villageHall;
|
||||||
|
@ -33,16 +45,31 @@ public class Map {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void build(Tile t, Building b) {
|
public void build(Village_Hall hall, Tile t, Building b) {
|
||||||
contains.add(b);
|
contains.add(b);
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public void move(Infantry i, Tile t) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void inRange(Infantry i, Building b) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void build(Village_Hall hall, Tile t, Building b) {
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public int getGuardTime() {
|
public int getGuardTime() {
|
||||||
return guardTime;
|
return guardTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public void setGuardTime(int gTime) {
|
public void setGuardTime(int gTime) {
|
||||||
this.guardTime = gTime;
|
this.guardTime = gTime;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public void setGuardTime() {
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,4 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Archer extends Infantry {
|
public class Archer extends Infantry {
|
||||||
|
|
||||||
public Archer() {
|
|
||||||
super(90, 2, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void move(Tile t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getPosition() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return super.getLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int setLevel(int level) {
|
|
||||||
return super.setLevel(level);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public abstract class Building {
|
public abstract class Building {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
// members
|
// members
|
||||||
private int level;
|
private int level;
|
||||||
private int health;
|
private int health;
|
||||||
|
@ -13,13 +14,33 @@ public abstract class Building {
|
||||||
private int goldCost;
|
private int goldCost;
|
||||||
private int ironCost;
|
private int ironCost;
|
||||||
private int woodCost;
|
private int woodCost;
|
||||||
|
=======
|
||||||
|
private static int level;
|
||||||
|
|
||||||
|
private int health;
|
||||||
|
|
||||||
|
private static Stage stages;
|
||||||
|
|
||||||
|
private int goldCost;
|
||||||
|
|
||||||
|
private int ironCost;
|
||||||
|
|
||||||
|
private int woodCost;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
private int buildTime;
|
private int buildTime;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public ArrayList<Tile> tiles = new ArrayList<>();
|
public ArrayList<Tile> tiles = new ArrayList<>();
|
||||||
public ArrayList<Inhabitant> inhabitants = new ArrayList<>();
|
public ArrayList<Inhabitant> inhabitants = new ArrayList<>();
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
|
=======
|
||||||
|
public List<Stage> stage;
|
||||||
|
public Tile tile;
|
||||||
|
|
||||||
|
public List<Inhabitant> inhabitant;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return level;
|
return level;
|
||||||
|
@ -29,19 +50,26 @@ public abstract class Building {
|
||||||
return health;
|
return health;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public int getCost(String type) {
|
public int getCost(String type) {
|
||||||
return (type.equals("gold")) ? (goldCost) :
|
return (type.equals("gold"))?(goldCost):
|
||||||
(type.equals("iron")) ? (ironCost) : woodCost;
|
(type.equals("iron"))?(ironCost):woodCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stage getStage() {
|
public Stage getStage() {
|
||||||
return stage;
|
return stage;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public int getCost(String type) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public int getUpgradeCost() {
|
public int getUpgradeCost() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public void setLevel(int level) {
|
public void setLevel(int level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
|
@ -50,9 +78,7 @@ public abstract class Building {
|
||||||
this.health = health;
|
this.health = health;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStage(Stage stage) {
|
public void setStage(Stage stage) {this.stage = stage; }
|
||||||
this.stage = stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addInhabitant(Inhabitant newMember) {
|
public void addInhabitant(Inhabitant newMember) {
|
||||||
inhabitants.add(newMember);
|
inhabitants.add(newMember);
|
||||||
|
@ -68,4 +94,14 @@ public abstract class Building {
|
||||||
public int getBuildTime() {
|
public int getBuildTime() {
|
||||||
return buildTime;
|
return buildTime;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public void upgrade() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBuildTime() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,4 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Catapult extends Infantry {
|
public class Catapult extends Infantry {
|
||||||
|
|
||||||
public Catapult() {
|
|
||||||
super(80, 12, 12);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void move(Tile t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getPosition() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return super.getLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int setLevel(int level) {
|
|
||||||
return super.setLevel(level);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -2,6 +2,7 @@ package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class DefenseBuilding extends Building {
|
public class DefenseBuilding extends Building {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
private int damage;
|
private int damage;
|
||||||
private int range;
|
private int range;
|
||||||
|
|
||||||
|
@ -10,6 +11,11 @@ public class DefenseBuilding extends Building {
|
||||||
this.damage += stage.getDamageChange();
|
this.damage += stage.getDamageChange();
|
||||||
this.range += stage.getRangeChange();
|
this.range += stage.getRangeChange();
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public int damage;
|
||||||
|
|
||||||
|
public int range;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public void attack(Infantry attacker) {
|
public void attack(Infantry attacker) {
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,18 @@ package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
class DefenseStage extends Stage {
|
class DefenseStage extends Stage {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
protected int dDamage;
|
protected int dDamage;
|
||||||
|
=======
|
||||||
|
protected int dDamge;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
protected int dRange;
|
protected int dRange;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public DefenseStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
public DefenseStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
||||||
int damageIncrease, int rangeIncrease) {
|
int damageIncrease, int rangeIncrease) {
|
||||||
super(dHealth, goldCost, requiredVillageLevel, upgradeTime, ironCost, woodCost);
|
super(dHealth,goldCost,requiredVillageLevel,upgradeTime,ironCost,woodCost);
|
||||||
this.dDamage = damageIncrease;
|
this.dDamage = damageIncrease;
|
||||||
this.dRange = rangeIncrease;
|
this.dRange = rangeIncrease;
|
||||||
}
|
}
|
||||||
|
@ -20,5 +25,12 @@ class DefenseStage extends Stage {
|
||||||
public int getRangeChange() {
|
public int getRangeChange() {
|
||||||
return dRange;
|
return dRange;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public void getDamageChange() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getRangeChange() {
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,15 +2,17 @@ package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Farm extends ResourceBuilding {
|
public class Farm extends ResourceBuilding {
|
||||||
|
|
||||||
public Farm(int lvl, ResourceStage baseStage) {
|
public Farm (int lvl, ResourceStage baseStage) {
|
||||||
setLevel(lvl);
|
setLevel(lvl);
|
||||||
upgrade(baseStage);
|
upgrade(baseStage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPopulationContribution() {
|
public int getPopulationContribution() {
|
||||||
return getHarvestRate();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvest(Village_Hall hall) {}
|
public void harvest(Village_Hall hall) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
|
public class GoldMine extends ResourceBuilding {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
public static String resource = "gold";
|
||||||
|
|
||||||
|
public GoldMine (int lvl, ResourceStage baseStage) {
|
||||||
|
setLevel(lvl);
|
||||||
|
upgrade(baseStage);
|
||||||
|
}
|
||||||
|
=======
|
||||||
|
public static String resource = "good";
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void harvest(Village_Hall hall) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public abstract class Infantry implements Inhabitant {
|
public abstract class Infantry {
|
||||||
|
|
||||||
private int health;
|
private int health;
|
||||||
|
|
||||||
|
@ -8,36 +8,16 @@ public abstract class Infantry implements Inhabitant {
|
||||||
|
|
||||||
private int range;
|
private int range;
|
||||||
|
|
||||||
public Infantry(int hitPoints, int damage, int range) {
|
|
||||||
this.health = hitPoints;
|
|
||||||
this.damage = damage;
|
|
||||||
this.range = range;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void attack(Building b) {
|
public void attack(Building b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHealth() {
|
public void getHealth() {
|
||||||
return health;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDamage() {
|
public void getDamage() {
|
||||||
return damage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRange() {
|
public void getRange() {
|
||||||
return range;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHealth(int health) {
|
|
||||||
this.health = health;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDamage(int damage) {
|
|
||||||
this.damage = damage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRange(int range) {
|
|
||||||
this.range = range;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,9 @@ public interface Inhabitant {
|
||||||
|
|
||||||
Map map = null;
|
Map map = null;
|
||||||
Building building = null;
|
Building building = null;
|
||||||
int lvl = 1;
|
|
||||||
|
|
||||||
void move(Tile t);
|
void move(Tile t);
|
||||||
|
|
||||||
void getPosition();
|
void getPosition();
|
||||||
|
|
||||||
default int getLevel() {
|
|
||||||
return lvl;
|
|
||||||
}
|
|
||||||
|
|
||||||
default int setLevel(int level) {
|
|
||||||
return lvl;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,18 @@ public class IronMine extends ResourceBuilding {
|
||||||
|
|
||||||
public static String resource = "iron";
|
public static String resource = "iron";
|
||||||
|
|
||||||
public IronMine(int lvl, ResourceStage baseStage) {
|
<<<<<<< HEAD
|
||||||
|
public IronMine (int lvl, ResourceStage baseStage) {
|
||||||
setLevel(lvl);
|
setLevel(lvl);
|
||||||
upgrade(baseStage);
|
upgrade(baseStage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void harvest(Village_Hall hall) {
|
public void harvest(Village_Hall hall) {
|
||||||
hall.addCurrentIron(getHarvestRate());
|
=======
|
||||||
|
@Override
|
||||||
|
public void harvest(Village_Hall hall) {
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +1,4 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Knight extends Infantry {
|
public class Knight extends Infantry {
|
||||||
|
|
||||||
public Knight() {
|
|
||||||
super(150, 6, 6);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void move(Tile t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getPosition() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return super.getLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int setLevel(int level) {
|
|
||||||
return super.setLevel(level);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -4,13 +4,17 @@ public class LumberMine extends ResourceBuilding {
|
||||||
|
|
||||||
public static String resource = "wood";
|
public static String resource = "wood";
|
||||||
|
|
||||||
public LumberMine(int lvl, ResourceStage baseStage) {
|
<<<<<<< HEAD
|
||||||
|
public LumberMine (int lvl, ResourceStage baseStage) {
|
||||||
setLevel(lvl);
|
setLevel(lvl);
|
||||||
upgrade(baseStage);
|
upgrade(baseStage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void harvest(Village_Hall hall) {
|
public void harvest(Village_Hall hall) {
|
||||||
hall.addCurrentWood(getHarvestRate());
|
=======
|
||||||
|
public void harvest(Village_Hall hall) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
|
public abstract class ResourceBuidling extends Building {
|
||||||
|
|
||||||
|
public static String resource;
|
||||||
|
|
||||||
|
private int harvest_rate;
|
||||||
|
|
||||||
|
public abstract void harvest(Village_Hall hall);
|
||||||
|
|
||||||
|
}
|
|
@ -1,36 +1,15 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
import ca.cosc3p91.a2.util.Time;
|
|
||||||
|
|
||||||
public abstract class ResourceBuilding extends Building {
|
public abstract class ResourceBuilding extends Building {
|
||||||
|
|
||||||
public static String resource;
|
public static String resource;
|
||||||
|
|
||||||
private final Time harvestMinTime = new Time().offsetSeconds(10);
|
|
||||||
|
|
||||||
private int harvest_rate;
|
private int harvest_rate;
|
||||||
private Time nextHarvestTime;
|
|
||||||
|
|
||||||
public ResourceBuilding() {
|
|
||||||
nextHarvestTime = Time.getTime().offsetTime(harvestMinTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void upgrade(ResourceStage stage) {
|
public void upgrade(ResourceStage stage) {
|
||||||
super.upgrade(stage);
|
super.upgrade(stage);
|
||||||
this.harvest_rate += stage.getHarvestRateIncrease();
|
this.harvest_rate += stage.getHarvestRateIncrease();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(Village_Hall hall){
|
public abstract void harvest(Village_Hall hall);
|
||||||
if (nextHarvestTime.occurred()){
|
|
||||||
harvest(hall);
|
|
||||||
nextHarvestTime = Time.getTime().offsetTime(harvestMinTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract void harvest(Village_Hall hall);
|
|
||||||
|
|
||||||
public int getHarvestRate(){
|
|
||||||
return harvest_rate;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,20 @@ public class ResourceStage extends Stage {
|
||||||
|
|
||||||
protected int harvestRateIncrease;
|
protected int harvestRateIncrease;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public ResourceStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
public ResourceStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
||||||
int harvestRateIncr) {
|
int harvestRateIncr) {
|
||||||
super(dHealth, goldCost, requiredVillageLevel, upgradeTime, ironCost, woodCost);
|
super(dHealth,goldCost,requiredVillageLevel,upgradeTime,ironCost,woodCost);
|
||||||
this.harvestRateIncrease = harvestRateIncr;
|
this.harvestRateIncrease = harvestRateIncr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHarvestRateIncrease() {
|
public int getHarvestRateIncrease() {
|
||||||
return harvestRateIncrease;
|
return harvestRateIncrease;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public int getHarvestRateIncrease() {
|
||||||
|
return harvestRateIncrease;
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
|
||||||
|
|
||||||
import ca.cosc3p91.a2.util.Time;
|
|
||||||
|
|
||||||
public class SaulGoodMine extends ResourceBuilding {
|
|
||||||
|
|
||||||
public static String resource = "gold";
|
|
||||||
|
|
||||||
public SaulGoodMine(int lvl, ResourceStage baseStage) {
|
|
||||||
setLevel(lvl);
|
|
||||||
upgrade(baseStage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void harvest(Village_Hall hall) {
|
|
||||||
hall.addCurrentGold(getHarvestRate());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +1,4 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Soldier extends Infantry {
|
public class Soldier extends Infantry {
|
||||||
|
|
||||||
public Soldier() {
|
|
||||||
super(100, 4, 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void move(Tile t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getPosition() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return super.getLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int setLevel(int level) {
|
|
||||||
return super.setLevel(level);
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -14,6 +14,7 @@ abstract class Stage {
|
||||||
|
|
||||||
protected int woodCost;
|
protected int woodCost;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public Stage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost) {
|
public Stage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost) {
|
||||||
this.dHealth = dHealth;
|
this.dHealth = dHealth;
|
||||||
this.goldCost = goldCost;
|
this.goldCost = goldCost;
|
||||||
|
@ -28,9 +29,19 @@ abstract class Stage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCost(String type) {
|
public int getCost(String type) {
|
||||||
return (type.equals("gold")) ? (goldCost) :
|
return (type.equals("gold"))?(goldCost):
|
||||||
(type.equals("iron")) ? (ironCost) : woodCost;
|
(type.equals("iron"))?(ironCost):woodCost;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public Building building;
|
||||||
|
|
||||||
|
public void getHealthChange() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCost(String type) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public int getRequiredVillageLevel() {
|
public int getRequiredVillageLevel() {
|
||||||
return requiredVillageLevel;
|
return requiredVillageLevel;
|
||||||
|
|
|
@ -8,4 +8,9 @@ public class Tile {
|
||||||
|
|
||||||
public int y;
|
public int y;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
public List<Building> building;
|
||||||
|
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,10 @@ public class VillageStage extends Stage {
|
||||||
|
|
||||||
protected int woodCapacityIncrease;
|
protected int woodCapacityIncrease;
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
public VillageStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
public VillageStage(int dHealth, int goldCost, int requiredVillageLevel, int upgradeTime, int ironCost, int woodCost,
|
||||||
int goldCapIncrease, int ironCapIncrease, int woodCapIncrease) {
|
int goldCapIncrease, int ironCapIncrease, int woodCapIncrease) {
|
||||||
super(dHealth, goldCost, requiredVillageLevel, upgradeTime, ironCost, woodCost);
|
super(dHealth,goldCost,requiredVillageLevel,upgradeTime,ironCost,woodCost);
|
||||||
this.goldCapacityIncrease = goldCapIncrease;
|
this.goldCapacityIncrease = goldCapIncrease;
|
||||||
this.ironCapacityIncrease = ironCapIncrease;
|
this.ironCapacityIncrease = ironCapIncrease;
|
||||||
this.woodCapacityIncrease = woodCapIncrease;
|
this.woodCapacityIncrease = woodCapIncrease;
|
||||||
|
@ -19,6 +20,11 @@ public class VillageStage extends Stage {
|
||||||
public int getGoldCapacityIncrease() {
|
public int getGoldCapacityIncrease() {
|
||||||
return goldCapacityIncrease;
|
return goldCapacityIncrease;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
public int getGoldCapacityIncrease() {
|
||||||
|
return goldCapacityIncrease;
|
||||||
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public int getIronCapacityIncrease() {
|
public int getIronCapacityIncrease() {
|
||||||
return ironCapacityIncrease;
|
return ironCapacityIncrease;
|
||||||
|
|
|
@ -4,15 +4,14 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
public class Village_Hall extends Building {
|
public class Village_Hall extends Building {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
private int goldCapacity = 0;
|
private int goldCapacity = 0;
|
||||||
|
|
||||||
private int ironCapacity = 0;
|
private int ironCapacity = 0;
|
||||||
|
|
||||||
private int woodCapacity = 0;
|
private int woodCapacity = 0;
|
||||||
|
|
||||||
private int currentGold;
|
public Village_Hall (int lvl, VillageStage baseStage) {
|
||||||
private int currentIron;
|
|
||||||
private int currentWood;
|
|
||||||
|
|
||||||
public Village_Hall(int lvl, VillageStage baseStage) {
|
|
||||||
setLevel(lvl);
|
setLevel(lvl);
|
||||||
upgrade(baseStage);
|
upgrade(baseStage);
|
||||||
}
|
}
|
||||||
|
@ -36,28 +35,24 @@ public class Village_Hall extends Building {
|
||||||
public int getWoodCapacity() {
|
public int getWoodCapacity() {
|
||||||
return woodCapacity;
|
return woodCapacity;
|
||||||
}
|
}
|
||||||
|
=======
|
||||||
|
private int goldCapacity;
|
||||||
|
|
||||||
public int getCurrentGold() {
|
private int ironCapacity;
|
||||||
return currentGold;
|
|
||||||
|
private int woodCapacity;
|
||||||
|
|
||||||
|
public int getGoldCapacity() {
|
||||||
|
return goldCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addCurrentGold(int currentGold) {
|
public int getIronCapacity() {
|
||||||
this.currentGold += currentGold;
|
return ironCapacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCurrentIron() {
|
public int getWoodCapacity() {
|
||||||
return currentIron;
|
return woodCapacity;
|
||||||
}
|
}
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
public void addCurrentIron(int currentIron) {
|
|
||||||
this.currentIron += currentIron;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCurrentWood() {
|
|
||||||
return currentWood;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addCurrentWood(int currentWood) {
|
|
||||||
this.currentWood += currentWood;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +1,11 @@
|
||||||
package ca.cosc3p91.a2.gameobjects;
|
package ca.cosc3p91.a2.gameobjects;
|
||||||
|
|
||||||
public class Worker implements Inhabitant {
|
public class Worker {
|
||||||
|
|
||||||
private boolean currentlyBuilding;
|
private boolean currentlyBuilding;
|
||||||
|
|
||||||
public void set_IsBuilding(boolean state) {
|
|
||||||
currentlyBuilding = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCurrentlyBuilding() {
|
public boolean isCurrentlyBuilding() {
|
||||||
return currentlyBuilding;
|
return currentlyBuilding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void move(Tile t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getPosition() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getLevel() {
|
|
||||||
return Inhabitant.super.getLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int setLevel(int level) {
|
|
||||||
return Inhabitant.super.setLevel(level);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,16 @@ package ca.cosc3p91.a2.player;
|
||||||
|
|
||||||
public class Player {
|
public class Player {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
public int currentGold;
|
||||||
|
public int currentIron;
|
||||||
|
public int currentWood;
|
||||||
|
=======
|
||||||
|
public int currentGold;
|
||||||
|
|
||||||
|
public int currentIron;
|
||||||
|
|
||||||
|
public int currentWood;
|
||||||
|
>>>>>>> abf784868daa920a9ca8b3b9d291a7cf521aa9c7
|
||||||
|
|
||||||
}
|
}
|
|
@ -15,11 +15,11 @@ public class Print {
|
||||||
this.values = row;
|
this.values = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Row() {
|
public Row(){
|
||||||
this.values = new ArrayList<>();
|
this.values = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(String value) {
|
public void add(String value){
|
||||||
values.add(value);
|
values.add(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ public class Print {
|
||||||
private final String columnName;
|
private final String columnName;
|
||||||
private long maxColumnLength = 0;
|
private long maxColumnLength = 0;
|
||||||
|
|
||||||
public Column(String columnName) {
|
public Column(String columnName){
|
||||||
this.columnName = columnName;
|
this.columnName = columnName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,18 +40,18 @@ public class Print {
|
||||||
private final int columnPadding;
|
private final int columnPadding;
|
||||||
private int maxColumnWidth;
|
private int maxColumnWidth;
|
||||||
|
|
||||||
public Print(String tableName, int columnPadding) {
|
public Print(String tableName, int columnPadding){
|
||||||
this.tableName = tableName;
|
this.tableName = tableName;
|
||||||
this.columnPadding = columnPadding;
|
this.columnPadding = columnPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Print() {
|
public Print(){
|
||||||
this("", 2);
|
this("", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createPadding(int amount) {
|
private String createPadding(int amount) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++){
|
||||||
builder.append(' ');
|
builder.append(' ');
|
||||||
}
|
}
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
|
@ -64,8 +64,8 @@ public class Print {
|
||||||
StringBuilder halfWidthLeftSeparator = new StringBuilder();
|
StringBuilder halfWidthLeftSeparator = new StringBuilder();
|
||||||
StringBuilder halfWidthRightSeparator = new StringBuilder();
|
StringBuilder halfWidthRightSeparator = new StringBuilder();
|
||||||
|
|
||||||
long sizeNameFloor = (long) Math.floor((double) sizeNameRemoved / 2.0);
|
long sizeNameFloor = (long) Math.floor((double)sizeNameRemoved / 2.0);
|
||||||
long sizeNameCeil = (long) Math.ceil((double) sizeNameRemoved / 2.0);
|
long sizeNameCeil = (long) Math.ceil((double)sizeNameRemoved / 2.0);
|
||||||
|
|
||||||
halfWidthLeftSeparator.append('+');
|
halfWidthLeftSeparator.append('+');
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ public class Print {
|
||||||
|
|
||||||
StringBuilder separator = new StringBuilder();
|
StringBuilder separator = new StringBuilder();
|
||||||
separator.append(halfWidthLeftSeparator.toString());
|
separator.append(halfWidthLeftSeparator.toString());
|
||||||
if (sizeOfName != 0) {
|
if (sizeOfName != 0){
|
||||||
separator.append("{ ");
|
separator.append("{ ");
|
||||||
separator.append(tableName);
|
separator.append(tableName);
|
||||||
separator.append(" }");
|
separator.append(" }");
|
||||||
|
@ -87,20 +87,20 @@ public class Print {
|
||||||
return separator.toString();
|
return separator.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateColumnHeader() {
|
private String generateColumnHeader(){
|
||||||
updateColumnLengths();
|
updateColumnLengths();
|
||||||
StringBuilder header = new StringBuilder();
|
StringBuilder header = new StringBuilder();
|
||||||
header.append('|');
|
header.append('|');
|
||||||
|
|
||||||
for (int i = 0; i < columns.size(); i++) {
|
for (int i = 0; i < columns.size(); i++){
|
||||||
Column column = columns.get(i);
|
Column column = columns.get(i);
|
||||||
double columnPaddingLength = ((int) (column.maxColumnLength) - (int) (column.columnName.length())) / 2.0;
|
double columnPaddingLength = ((int)(column.maxColumnLength) - (int)(column.columnName.length()))/2.0;
|
||||||
header.append(createPadding((int) (columnPadding + (int) Math.floor(columnPaddingLength))));
|
header.append(createPadding((int)(columnPadding + (int)Math.floor(columnPaddingLength))));
|
||||||
|
|
||||||
header.append(column.columnName);
|
header.append(column.columnName);
|
||||||
|
|
||||||
header.append(createPadding((int) (columnPadding + (int) Math.ceil(columnPaddingLength))));
|
header.append(createPadding((int)(columnPadding + (int)Math.ceil(columnPaddingLength))));
|
||||||
if (i < columns.size() - 1)
|
if (i < columns.size()-1)
|
||||||
header.append('|');
|
header.append('|');
|
||||||
}
|
}
|
||||||
header.append('|');
|
header.append('|');
|
||||||
|
@ -115,7 +115,7 @@ public class Print {
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
if (i == nextIndex) {
|
if (i == nextIndex) {
|
||||||
System.out.println(currentColumnIndex + " " + nextIndex + " " + size);
|
System.out.println(currentColumnIndex + " " + nextIndex + " " + size);
|
||||||
int currentColumnSize = (int) (columns.get(currentColumnIndex++).maxColumnLength + columnPadding * 2);
|
int currentColumnSize = (int) (columns.get(currentColumnIndex++).maxColumnLength + columnPadding*2);
|
||||||
nextIndex += currentColumnSize + 1;
|
nextIndex += currentColumnSize + 1;
|
||||||
wholeWidthSeparator.append('+');
|
wholeWidthSeparator.append('+');
|
||||||
} else
|
} else
|
||||||
|
@ -139,7 +139,7 @@ public class Print {
|
||||||
return column.columnName.length() + columnPadding * 2L;
|
return column.columnName.length() + columnPadding * 2L;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Print addColumn(Column column) {
|
public Print addColumn(Column column){
|
||||||
columns.add(column);
|
columns.add(column);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -154,11 +154,11 @@ public class Print {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Print addRow(ArrayList<String> row) {
|
public Print addRow(ArrayList<String> row){
|
||||||
return addRow(new Row(row));
|
return addRow(new Row(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<String> createTable(boolean top, boolean bottom, boolean separators) {
|
public ArrayList<String> createTable(boolean top, boolean bottom, boolean separators){
|
||||||
ArrayList<String> lines = new ArrayList<>();
|
ArrayList<String> lines = new ArrayList<>();
|
||||||
|
|
||||||
String header = generateColumnHeader();
|
String header = generateColumnHeader();
|
||||||
|
@ -174,13 +174,13 @@ public class Print {
|
||||||
for (Row row : rows) {
|
for (Row row : rows) {
|
||||||
StringBuilder rowLine = new StringBuilder();
|
StringBuilder rowLine = new StringBuilder();
|
||||||
rowLine.append('|');
|
rowLine.append('|');
|
||||||
for (int i = 0; i < row.values.size(); i++) {
|
for (int i = 0; i < row.values.size(); i++){
|
||||||
String value = row.values.get(i);
|
String value = row.values.get(i);
|
||||||
Column column = columns.get(i);
|
Column column = columns.get(i);
|
||||||
int spaceLeft = (int) (column.maxColumnLength - value.length());
|
int spaceLeft = (int)(column.maxColumnLength - value.length());
|
||||||
rowLine.append(createPadding((int) Math.floor(spaceLeft / 2.0) + columnPadding));
|
rowLine.append(createPadding((int)Math.floor(spaceLeft / 2.0) + columnPadding));
|
||||||
rowLine.append(value);
|
rowLine.append(value);
|
||||||
rowLine.append(createPadding((int) Math.ceil(spaceLeft / 2.0) + columnPadding));
|
rowLine.append(createPadding((int)Math.ceil(spaceLeft / 2.0) + columnPadding));
|
||||||
rowLine.append('|');
|
rowLine.append('|');
|
||||||
}
|
}
|
||||||
lines.add(rowLine.toString());
|
lines.add(rowLine.toString());
|
||||||
|
@ -192,7 +192,7 @@ public class Print {
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<String> createBox() {
|
public ArrayList<String> createBox(){
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ public class Print {
|
||||||
return createTable(true, true, true);
|
return createTable(true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void print(ArrayList<String> lines) {
|
public static void print(ArrayList<String> lines){
|
||||||
for (String line : lines)
|
for (String line : lines)
|
||||||
System.out.println(line);
|
System.out.println(line);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,16 @@ public class Time {
|
||||||
return timeSeconds;
|
return timeSeconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class FutureTime {
|
||||||
|
private final Time futureTime;
|
||||||
|
|
||||||
|
public FutureTime(Time futureTime) {
|
||||||
|
this.futureTime = futureTime;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean occurred() {
|
public boolean occurred() {
|
||||||
return getTime().timeSeconds >= timeSeconds;
|
return getTime().timeSeconds >= futureTime.timeSeconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Time getTime() {
|
public static Time getTime() {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue