chore: testing milking
This commit is contained in:
@@ -106,7 +106,12 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public void milkCow() {
|
||||
public void milkCow(Game game) {
|
||||
if (!game.getBuildings().contains(Item.FENCE_WITH_COWS)) {
|
||||
System.out.println(" "); //TODO
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().add(Item.MILK);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,5 +173,47 @@ public class Main {
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user