chore: minor changes
This commit is contained in:
@@ -146,8 +146,8 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public void milkCow(Game game) {
|
||||
if (!game.getBuildings().contains(Item.FENCE_WITH_COWS)) {
|
||||
public void milkCow() {
|
||||
if (!buildings.contains(Item.FENCE_WITH_COWS)) {
|
||||
strings.print("cantMilkCows");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,18 @@ package cz.jull;
|
||||
import cz.jull.actions.Action;
|
||||
import cz.jull.actions.BuildAction;
|
||||
import cz.jull.actions.axe.AxeCutTreesAction;
|
||||
import cz.jull.actions.bakery.BakeryProduceAction;
|
||||
import cz.jull.actions.cheese_factory.CheeseFactoryProduceAction;
|
||||
import cz.jull.actions.coal_factory.CoalFactoryProduceAction;
|
||||
import cz.jull.actions.cow.CowMilkAction;
|
||||
import cz.jull.actions.hops_farmland.HopsFarmlandHarvestAction;
|
||||
import cz.jull.actions.hops_farmland.HopsFarmlandPlantAction;
|
||||
import cz.jull.actions.pub.PubProduceAction;
|
||||
import cz.jull.actions.vineyard.VineyardHarvestAction;
|
||||
import cz.jull.actions.vineyard.VineyardPlantAction;
|
||||
import cz.jull.actions.wheat_farmland.WheatFarmlandHarvestAction;
|
||||
import cz.jull.actions.wheat_farmland.WheatFarmlandPlantAction;
|
||||
import cz.jull.actions.winery.WineryProduceAction;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -32,23 +41,23 @@ public enum Item implements Buildable {
|
||||
HOPS_SEEDS("Hops seeds", true, 5, List.of()),
|
||||
GRAPEVINE_SEEDS("Grapes seeds", true, 5, List.of()),
|
||||
|
||||
VINEYARD("Vineyard", true, 7, List.of(new BuildAction()), List.of(new VineyardHarvestAction())),
|
||||
VINEYARD("Vineyard", true, 7, List.of(new BuildAction()), List.of(new VineyardHarvestAction(), new VineyardPlantAction())),
|
||||
WHEAT_FARMLAND("Wheat farmland", true, 7, List.of(new BuildAction()), List.of(new WheatFarmlandHarvestAction(), new WheatFarmlandPlantAction())),
|
||||
HOPS_FARMLAND("Hops farmland", true, 7, List.of(new BuildAction())),
|
||||
HOPS_FARMLAND("Hops farmland", true, 7, List.of(new BuildAction()), List.of(new HopsFarmlandHarvestAction(), new HopsFarmlandPlantAction())),
|
||||
|
||||
FENCE_WITH_COWS("Fence with cows", true, 100, List.of(new BuildAction()), List.of()),
|
||||
FENCE_WITH_COWS("Fence with cows", true, 100, List.of(new BuildAction()), List.of(new CowMilkAction())),
|
||||
|
||||
CHURCH("Church", true, 100, List.of(new BuildAction())),
|
||||
VILLAGER_HOUSE("Villager house", true, 50, List.of(new BuildAction())),
|
||||
|
||||
PUB("Pub", true, 400, List.of(new BuildAction()), List.of()),
|
||||
WINERY("Winery", true, 350, List.of(new BuildAction()), List.of()),
|
||||
BAKERY("Bakery", true, 350, List.of(new BuildAction()), List.of()),
|
||||
PUB("Pub", true, 400, List.of(new BuildAction()), List.of(new PubProduceAction())),
|
||||
WINERY("Winery", true, 350, List.of(new BuildAction()), List.of(new WineryProduceAction())),
|
||||
BAKERY("Bakery", true, 350, List.of(new BuildAction()), List.of(new BakeryProduceAction())),
|
||||
|
||||
WELL("Well", true, 30, List.of()),
|
||||
|
||||
COAL_FACTORY("Coal factory", true, 200, List.of(new BuildAction()), List.of()),
|
||||
CHEESE_FACTORY("Cheese factory", true, 200, List.of(new BuildAction()), List.of()),;
|
||||
COAL_FACTORY("Coal factory", true, 200, List.of(new BuildAction()), List.of(new CoalFactoryProduceAction())),
|
||||
CHEESE_FACTORY("Cheese factory", true, 200, List.of(new BuildAction()), List.of(new CheeseFactoryProduceAction())),;
|
||||
|
||||
|
||||
static {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.bakery;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class BakeryProduceAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Produce bread";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.produce(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.cheese_factory;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class CheeseFactoryProduceAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Produce cheese";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.produce(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.coal_factory;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class CoalFactoryProduceAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Produce coal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.produce(item);
|
||||
}
|
||||
}
|
||||
17
src/main/java/cz/jull/actions/cow/CowMilkAction.java
Normal file
17
src/main/java/cz/jull/actions/cow/CowMilkAction.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.cow;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class CowMilkAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Get milk";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.milkCow();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.hops_farmland;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class HopsFarmlandPlantAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Plant hops seeds";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.build(Item.HOPS_SEEDS);
|
||||
}
|
||||
}
|
||||
17
src/main/java/cz/jull/actions/pub/PubProduceAction.java
Normal file
17
src/main/java/cz/jull/actions/pub/PubProduceAction.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.pub;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class PubProduceAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Produce beer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.produce(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.vineyard;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class VineyardPlantAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Plant grapevine seeds";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.build(Item.GRAPEVINE_SEEDS);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cz.jull.actions.winery;
|
||||
|
||||
import cz.jull.Game;
|
||||
import cz.jull.Item;
|
||||
import cz.jull.actions.Action;
|
||||
|
||||
public class WineryProduceAction extends Action {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Produce wine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Game game, Item item) {
|
||||
game.produce(item);
|
||||
}
|
||||
}
|
||||
15
src/main/resources/item_art/GRAPEVINE.txt
Normal file
15
src/main/resources/item_art/GRAPEVINE.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
▄█▀▀▀█
|
||||
█ ▀▄ ▀█
|
||||
█▄ ▀▄ █ ▄▄
|
||||
█▄▄▄██ ▄▀▀▄█
|
||||
▄▄ ▀▄ ▄▀ ▄▀
|
||||
▄▀ ▀▄▀▀▀▄▀ ▄▀▄ ▄▀▀▄
|
||||
▄█▄▄▄▀ █ █▄ ▀▄ ▀▄ █
|
||||
▄▀ █▄▄▄▄▄▀▀ ▀▄ ▀▄▄▄▀
|
||||
█ ▄▀ ▀▄ █
|
||||
█▄▄▄█ █▄▄▄▄▀
|
||||
█ ▀▄ ▄█ ▀▄
|
||||
▀▄ ▄▀▀▀▀▀ █ ▄▀
|
||||
▀▄▀▀▀▄ █▀▀▀
|
||||
█ ▀▄▄▄▀▀
|
||||
▀▄▄▄▄▀
|
||||
Reference in New Issue
Block a user