feat: nevim uz
This commit is contained in:
@@ -68,6 +68,7 @@ public class Game {
|
||||
|
||||
player.setCoins(1000);
|
||||
strings.print("coins", player.getCoins());
|
||||
System.out.println();
|
||||
|
||||
market = new Market(this);
|
||||
|
||||
|
||||
@@ -52,54 +52,6 @@ public enum Item implements Buildable {
|
||||
|
||||
|
||||
static {
|
||||
WHEAT_SEEDS.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.WHEAT_FARMLAND).count() >= game.getBuildings().stream().filter(building -> building == Item.WHEAT_SEEDS).count() + 1) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(" "); //TODO
|
||||
return false;
|
||||
};
|
||||
|
||||
HOPS_SEEDS.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.WHEAT_FARMLAND).count() >= game.getBuildings().stream().filter(building -> building == Item.HOPS_SEEDS).count() + 1) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(" "); //TODO
|
||||
return false;
|
||||
};
|
||||
|
||||
GRAPEVINE_SEEDS.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.VINEYARD).count() >= game.getBuildings().stream().filter(building -> building == Item.GRAPEVINE_SEEDS).count() + 1) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(" "); //TODO
|
||||
return false;
|
||||
};
|
||||
|
||||
WHEAT_FARMLAND.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.WHEAT_FARMLAND).count() >= game.getWaterType().getFarmlandAndVineyardCount()) {
|
||||
System.out.println(" "); // TODO
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
VINEYARD.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.VINEYARD).count() >= game.getWaterType().getFarmlandAndVineyardCount()) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(" "); //TODO
|
||||
return false;
|
||||
};
|
||||
|
||||
HOPS_FARMLAND.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.HOPS_FARMLAND).count() >= game.getWaterType().getFarmlandAndVineyardCount()) {
|
||||
return true;
|
||||
}
|
||||
System.out.println(" "); //TODO
|
||||
return false;
|
||||
};
|
||||
|
||||
FENCE_WITH_COWS.canBeBuiltFunction = game -> {
|
||||
if (game.getBuildings().stream().filter(building -> building == Item.VILLAGER_HOUSE).count() >= (game.getBuildings().stream().filter(building -> building == Item.FENCE_WITH_COWS).count() + 1) * 3) {
|
||||
return true;
|
||||
@@ -157,37 +109,6 @@ public enum Item implements Buildable {
|
||||
};
|
||||
}
|
||||
|
||||
static {
|
||||
VILLAGER_HOUSE.canBeBoughtFunction = game -> {
|
||||
if (!game.getBuildings().contains(Item.CHURCH)) {
|
||||
game.getStrings().print("cantBeBoughtVillagerHouse");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
Function<Game, Boolean> func = game -> {
|
||||
if (!game.getBuildings().contains(Item.VILLAGER_HOUSE)) {
|
||||
game.getStrings().print("cantBeBoughtAll");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
WHEAT_FARMLAND.canBeBoughtFunction = func;
|
||||
HOPS_FARMLAND.canBeBoughtFunction = func;
|
||||
VINEYARD.canBeBoughtFunction = func;
|
||||
|
||||
FENCE_WITH_COWS.canBeBoughtFunction = func;
|
||||
|
||||
BAKERY.canBeBoughtFunction = func;
|
||||
PUB.canBeBoughtFunction = func;
|
||||
WINERY.canBeBoughtFunction = func;
|
||||
|
||||
COAL_FACTORY.canBeBoughtFunction = func;
|
||||
CHEESE_FACTORY.canBeBoughtFunction = func;
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable name
|
||||
*/
|
||||
@@ -210,18 +131,11 @@ public enum Item implements Buildable {
|
||||
*/
|
||||
private Function<Game, Boolean> canBeBuiltFunction;
|
||||
|
||||
/**
|
||||
* Function that determines if the item can be bought or not
|
||||
*/
|
||||
@Getter
|
||||
private Function<Game, Boolean> canBeBoughtFunction;
|
||||
|
||||
Item(String name, boolean isPlaceable, int price, List<Action> actions) {
|
||||
this.name = name;
|
||||
this.isPlaceable = isPlaceable;
|
||||
this.canBeBuiltFunction = ignored -> isPlaceable;
|
||||
this.price = price;
|
||||
this.canBeBoughtFunction = ignored -> true;
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
@@ -230,7 +144,6 @@ public enum Item implements Buildable {
|
||||
this.isPlaceable = isPlaceable;
|
||||
this.canBeBuiltFunction = ignored -> isPlaceable;
|
||||
this.price = price;
|
||||
this.canBeBoughtFunction = ignored -> true;
|
||||
this.actions = actions;
|
||||
this.buildActions = buildActions;
|
||||
}
|
||||
|
||||
@@ -34,10 +34,6 @@ public class Market {
|
||||
throw new NotSufficientsCoinsException("Not enough coins");
|
||||
}
|
||||
|
||||
if (!item.getCanBeBoughtFunction().apply(game)) {
|
||||
game.getStrings().print("cantBuy");
|
||||
return;
|
||||
}
|
||||
if (availableItems.contains(item)) {
|
||||
game.getPlayer().getInventory().add(item);
|
||||
game.getPlayer().setCoins(game.getPlayer().getCoins() - item.getPrice());
|
||||
|
||||
@@ -46,16 +46,20 @@ public class Cli {
|
||||
}
|
||||
|
||||
while (true) {
|
||||
System.out.print("Vlož číslo možnosti: ");
|
||||
System.out.println();
|
||||
System.out.print("Enter option number: ");
|
||||
System.out.println();
|
||||
if (scanner.hasNextInt()) {
|
||||
choice = scanner.nextInt();
|
||||
if (choice >= 1 && choice <= options.size()) {
|
||||
return choice - 1;
|
||||
} else {
|
||||
System.out.println("Neplatná možnost, vyber si číslo mezi 1 a " + options.size());
|
||||
System.out.println("Invalid option, choose a number between 1 and" + options.size());
|
||||
System.out.println();
|
||||
}
|
||||
} else {
|
||||
System.out.println("Neplatný vstup, vlož číslo.");
|
||||
System.out.println("Invalid entry, please enter a number.");
|
||||
System.out.println();
|
||||
scanner.next();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,10 @@ package cz.jull.tui;
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
import cz.jull.stats.surroundings.ForestType;
|
||||
import cz.jull.stats.surroundings.PathType;
|
||||
import cz.jull.stats.surroundings.SoilType;
|
||||
import cz.jull.stats.surroundings.WaterType;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -95,6 +99,15 @@ public class Menu {
|
||||
case 2 -> start();
|
||||
}
|
||||
}
|
||||
case 3 -> {
|
||||
game.getStrings().print("forestType", game.getForestType());
|
||||
game.getStrings().print("soilType", game.getSoilType());
|
||||
game.getStrings().print("pathType", game.getPathType());
|
||||
game.getStrings().print("waterType", game.getWaterType());
|
||||
System.out.println();
|
||||
game.getStrings().print("coins", game.getPlayer().getCoins());
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
▄▄▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▄
|
||||
▄▄▀▀▀▀▀▀ ▄▄████▀▀ ▄▄▄▄████ ▀▀▀▀▀▀▀▀▄▄▄▄
|
||||
▄▄▀▀ ▄▄████▀▀ ▄▄██████▀▀ ▄▄████ ▀▀▄▄▄▄▄▄
|
||||
▄▄██ ████ ██████▀▀ ▄▄████▀▀ ▀▀▄▄
|
||||
██ ▄▄██ ▄▄████▀▀ ▄▄████ ▄▄▄▄██▀▀ ▀▀▄▄
|
||||
██ ▀▀ ████▀▀ ████▀▀ ▄▄██▀▀ ▀▀▄▄
|
||||
██ ██ ▄▄██▀▀ ██ ██▄▄
|
||||
██▄▄ ▀▀▀▀ ██
|
||||
▀▀▄▄ ▄▄▀▀
|
||||
▀▀▄▄▄▄ ▄▄▀▀
|
||||
▀▀▀▀▄▄▄▄ ▄▄▄▄▀▀
|
||||
▀▀▀▀▀▀▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▀▀▀▀
|
||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
▄▄▀▀▀▀▀▀▀▀▀▀▀▀▄▄
|
||||
▄▀▀▀ ▄██▀ ▄▄██ ▀▀▀▀▄▄
|
||||
▄▀ ▄██▀ ▄███▀ ▄██ ▀▄▄▄
|
||||
▄█ ██ ███▀ ▄██▀ ▀▄
|
||||
█ ▄█ ▄██▀ ▄██ ▄▄█▀ ▀▄
|
||||
█ ▀ ██▀ ██▀ ▄█▀ ▀▄
|
||||
█ █ ▄█▀ █ █▄
|
||||
█▄ ▀▀ █
|
||||
▀▄ ▄▀
|
||||
▀▄▄ ▄▀
|
||||
▀▀▄▄ ▄▄▀
|
||||
▀▀▀▄▄▄▄ ▄▄▄▄▀▀
|
||||
▀▀▀▀▀▀▀▀▀▀▀
|
||||
|
||||
10
src/main/resources/item_art/CHEESE_FACTORY.txt
Normal file
10
src/main/resources/item_art/CHEESE_FACTORY.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
▄▄██▄▄▄
|
||||
▄▄█▀▀ ▀█▄▄
|
||||
▄▄█▀▀ ▄▄▄██
|
||||
▄▄███▀▀▀█▄▄▄██▀▀▀▀▀ █
|
||||
██▄▄▄█▄ ▄█▀ █
|
||||
█ ▀▀▀ ▄█▀█▄ █
|
||||
█ █ █ █
|
||||
█ █▀█ ▀▀█▀▀ █
|
||||
█ ▀▀▀ ▄▄▄▄▄▄▄▄▄▄▄▄▄█
|
||||
▀▀▀▀▀▀▀▀▀
|
||||
@@ -1,13 +1,13 @@
|
||||
██████████████
|
||||
██████████████████████
|
||||
██████████████████████████████
|
||||
██████████████████████████████████
|
||||
██████████████████████████████████████
|
||||
██████████████████████████████████████████████
|
||||
██████████████████████████████████████████████
|
||||
██████████████████████████████████████████████████
|
||||
██████████████████████████████████████████████████
|
||||
▀▀██████████████████████████████████████████▀▀▀▀
|
||||
▀▀▀▀██████████████████████████████████▀▀▀▀
|
||||
▀▀▀▀██████████████▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
███████
|
||||
███████████
|
||||
███████████████
|
||||
█████████████████
|
||||
███████████████████
|
||||
███████████████████████
|
||||
███████████████████████
|
||||
█████████████████████████
|
||||
█████████████████████████
|
||||
▀█████████████████████▀▀
|
||||
▀▀█████████████████▀▀
|
||||
▀▀███████▀▀▀▀▀▀▀▀
|
||||
▀▀▀▀▀▀▀
|
||||
|
||||
@@ -1,28 +1,14 @@
|
||||
██
|
||||
██ ██
|
||||
██ ██
|
||||
██████ ██████
|
||||
██████ ██████ ██████
|
||||
████ ██ ████
|
||||
████ ████
|
||||
████ ████
|
||||
██ ██
|
||||
██ ██
|
||||
██ ██
|
||||
████ ██ ██ ████
|
||||
██ ████ ████ ██
|
||||
██ ██ ██ ██ ██ ██
|
||||
██ ████ ██ ██ ████ ██
|
||||
████████ ██ ██ ████████
|
||||
██ ██ ██ ██
|
||||
██ ████ ████ ██
|
||||
██ ██████████ ██
|
||||
██ ██ ██ ██
|
||||
████ ██ ██ ████
|
||||
████ ██ ██ ████
|
||||
██████ ██████
|
||||
██ ██
|
||||
██ ██
|
||||
██ ██
|
||||
████ ████
|
||||
██
|
||||
▄▀▄
|
||||
▄▄█ █▄▄
|
||||
▄▄▀▀▀ ▀█▀ ▀▀▀▄▄
|
||||
▄█▀ ▀█▄
|
||||
▄▀ ▀▄
|
||||
▄█ ▄ ▄ █▄
|
||||
█ ▄▀█ █▀▄ █
|
||||
█▄▄▄▀▀ █ █ ▀▀▄▄▄█
|
||||
█ █▄ ▄█ █
|
||||
▀▄ █▀▀▀█ ▄▀
|
||||
▀█▄ ▄▀ ▀▄ ▄█▀
|
||||
▀▀█ █▀▀
|
||||
▀▄ ▄▀
|
||||
▀▀▄▀▀
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
▄▄▄▄▄▄▄▄▄▄ ▄▄▀▀▄▄
|
||||
██ ██▄▄▀▀ ▀▀▄▄
|
||||
██ ▄▄▀▀ ▄▄▀▀▀▀▀▀▄▄ ▀▀▄▄
|
||||
██▄▄▀▀ ▄▄▀▀ ▀▀▄▄ ▀▀▄▄
|
||||
▄▄▀▀ ▄▄▀▀ ▀▀▄▄ ▀▀▄▄
|
||||
▄▄▀▀ ▄▄▀▀ ▀▀▄▄ ▀▀▄▄
|
||||
▀▀▄▄▄▄██ ▄▄▄▄▄▄▄▄▄▄▄▄ ██▄▄▄▄▀▀
|
||||
██ ██ ██ ██▀▀▀▀▀▀▀▀▀▀██ ██
|
||||
██ ██ ██ ██ ██ ██
|
||||
██ ██ ▄▄██ ██ ██ ██
|
||||
██ ██ ██ ██▄▄▄▄▄▄▄▄▄▄██ ██
|
||||
██ ██ ██ ██
|
||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
▄▄▄▄▄ ▄▀▄
|
||||
█ █▄▀ ▀▄
|
||||
█ ▄▀ ▄▀▀▀▄ ▀▄
|
||||
█▄▀ ▄▀ ▀▄ ▀▄
|
||||
▄▀ ▄▀ ▀▄ ▀▄
|
||||
▄▀ ▄▀ ▀▄ ▀▄
|
||||
▀▄▄█ ▄▄▄▄▄▄ █▄▄▀
|
||||
█ █ █ █▀▀▀▀▀█ █
|
||||
█ █ █ █ █ █
|
||||
█ █ ▄█ █ █ █
|
||||
█ █ █ █▄▄▄▄▄█ █
|
||||
█ █ █ █
|
||||
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
|
||||
|
||||
12
src/main/resources/item_art/WELL.txt
Normal file
12
src/main/resources/item_art/WELL.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
▄█▀▀▀▀▀▀▀▀▀▀▀▀▀█▄
|
||||
▄█▀ ▀█▄
|
||||
▄██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██▄
|
||||
▀▀▀▀█▀▀▀▀▀▀▀▀▀▀▀█▀▀▀▀
|
||||
▄▄█▀▀▀▀▀█▀▀▀▀▀▀█▀▀▀▀█▀
|
||||
▀▀▀ █ █ █
|
||||
█ █ █
|
||||
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
|
||||
█ █
|
||||
█ █
|
||||
█ █
|
||||
█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
|
||||
@@ -1,22 +1,11 @@
|
||||
██
|
||||
██
|
||||
██ ██
|
||||
██ ████
|
||||
██ ████
|
||||
██ ████ ██
|
||||
██ ██████████
|
||||
██ ██ ████
|
||||
██ ██ ████ ██
|
||||
██ ██ ████████
|
||||
██ ██ ████
|
||||
██ ██ ██ ██████████
|
||||
██ ██ ████ ██
|
||||
██ ██ ██████████████
|
||||
██ ████
|
||||
██ ████████████
|
||||
████ ██
|
||||
██████████████
|
||||
██
|
||||
██
|
||||
██
|
||||
██
|
||||
▄▀
|
||||
▄▀▄▄▀
|
||||
▄ █▄▀▀▄
|
||||
▄ █ ██▀▀▀
|
||||
█ █ ██▄▄▀
|
||||
▄▀▄ █ ██▄▄▄
|
||||
█ █ ██▄▄▄▄▄▀
|
||||
█ ██▄▄▄▄
|
||||
██▄▄▄▄▄▀
|
||||
▄▀
|
||||
▄▀
|
||||
|
||||
18
src/main/resources/item_art/WINERY.txt
Normal file
18
src/main/resources/item_art/WINERY.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
▄▀▀▀▀▀▀▀▄
|
||||
█▄ ▄█
|
||||
█ ▀▀▀▀▀▀▀ █
|
||||
█ █
|
||||
█ █
|
||||
█ █
|
||||
█ █
|
||||
█ █
|
||||
█ █
|
||||
▀▄▄ ▄▄▀
|
||||
▀███▀
|
||||
███
|
||||
███
|
||||
███
|
||||
███
|
||||
▄▄▄▄█████▄▄▄
|
||||
██ ██
|
||||
▀▀▀▄▄▄▄▄▄▄▀▀▀
|
||||
13
src/main/resources/item_art/WOOD.txt
Normal file
13
src/main/resources/item_art/WOOD.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
▄▄█▀▀▀██▄▄
|
||||
▄▄█▀ ▄ ▀█▄
|
||||
▄▄█▀ ▄▀▀ █
|
||||
▄█▀ ▄▄▀ ▄▀
|
||||
▄█▀▀ ▄▀ ▄▀ ▄▄█▀
|
||||
▄█▀▀ ▄▀▀ ▄▀▀ ▄█▀▀
|
||||
▄█▀▀▀█▄▄ ▄▄▀ ▄██▀
|
||||
▄█▀▀ ▄▄▄▄ ▀█▄ ▄█▀
|
||||
█ █▀ ▀ █▄ ▄█▀▀
|
||||
█ █ ▀▀█ █▄▄█▀
|
||||
█▄ ▀█▄█▀ ██▀
|
||||
▀█▄▄ ▄█▀▀
|
||||
▀▀▀▀▀▀
|
||||
Reference in New Issue
Block a user