chore: idk
This commit is contained in:
@@ -116,11 +116,11 @@ public class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void produce(Item item) {
|
public void produce(Item item) {
|
||||||
long bakeryProducedMoney = 0;
|
long bakeryProducedMoney;
|
||||||
long pubProducedMoney = 0;
|
long pubProducedMoney;
|
||||||
long wineryProducedMoney = 0;
|
long wineryProducedMoney;
|
||||||
long coalFactoryProducedMoney = 0;
|
long coalFactoryProducedMoney;
|
||||||
long cheeseFactoryProducedMoney = 0;
|
long cheeseFactoryProducedMoney;
|
||||||
|
|
||||||
if (!buildings.contains(item)) {
|
if (!buildings.contains(item)) {
|
||||||
System.out.println(" cant produce"); //TODO
|
System.out.println(" cant produce"); //TODO
|
||||||
|
|||||||
@@ -1,219 +1,7 @@
|
|||||||
package cz.jull;
|
package cz.jull;
|
||||||
|
|
||||||
import cz.jull.exceptions.ItemNotAvailableException;
|
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Game game = new Game();
|
|
||||||
game.generateStats();
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.CHURCH);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.CHURCH);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.VILLAGER_HOUSE);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.VILLAGER_HOUSE);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.WHEAT_FARMLAND);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.WHEAT_FARMLAND);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.WHEAT_SEEDS);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.WHEAT_SEEDS);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.harvest(Item.WHEAT_FARMLAND);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.BAKERY);
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" cant buy bakery");
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.BAKERY);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.produce(Item.BAKERY);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.AXE);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" idk ");;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.cutTrees();
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.COAL_FACTORY);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" idk ");;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.COAL_FACTORY);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.produce(Item.COAL_FACTORY);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.COAL_FACTORY);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" idk ");;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.getMarket().sellItem(game, Item.COAL_FACTORY);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.FENCE_WITH_COWS);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" idk ");;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
try {
|
|
||||||
game.getMarket().buyItem(game, Item.VILLAGER_HOUSE);
|
|
||||||
|
|
||||||
} catch (ItemNotAvailableException e) {
|
|
||||||
System.out.println(" idk ");;
|
|
||||||
}
|
|
||||||
|
|
||||||
game.build(Item.VILLAGER_HOUSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.build(Item.FENCE_WITH_COWS);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
game.milkCow(game);
|
|
||||||
|
|
||||||
System.out.println("coins: " + game.getPlayer().getCoins());
|
|
||||||
System.out.println("inventory: " + game.getPlayer().getInventory());
|
|
||||||
System.out.println("buildings: " + game.getBuildings());
|
|
||||||
System.out.println();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,12 +2,10 @@ package cz.jull.market;
|
|||||||
|
|
||||||
import cz.jull.Game;
|
import cz.jull.Game;
|
||||||
import cz.jull.Item;
|
import cz.jull.Item;
|
||||||
import cz.jull.Player;
|
|
||||||
import cz.jull.exceptions.ItemNotAvailableException;
|
import cz.jull.exceptions.ItemNotAvailableException;
|
||||||
import cz.jull.exceptions.NotSufficientsCoinsException;
|
import cz.jull.exceptions.NotSufficientsCoinsException;
|
||||||
import cz.jull.surroundings.PathType;
|
import cz.jull.surroundings.PathType;
|
||||||
import cz.jull.surroundings.SoilType;
|
import cz.jull.surroundings.SoilType;
|
||||||
import cz.jull.surroundings.WaterType;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
Reference in New Issue
Block a user