Rename selling to delivering
This commit is contained in:
@@ -178,7 +178,7 @@ public class WhatAStorage {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canSellProduct(int questIndex, int x, int y) {
|
||||
public boolean canDeliverProduct(int questIndex, int x, int y) {
|
||||
Quest quest = quests.get(questIndex);
|
||||
if (quest != null && quest.getType() == Quest.Type.OUT) {
|
||||
return quest.getProduct().equals(storage.get(x, y).front());
|
||||
@@ -186,10 +186,10 @@ public class WhatAStorage {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean sellProduct(int questIndex, int x, int y) {
|
||||
if (canSellProduct(questIndex, x, y)) {
|
||||
public boolean deliverProduct(int questIndex, int x, int y) {
|
||||
if (canDeliverProduct(questIndex, x, y)) {
|
||||
int z = storage.get(x, y).pop();
|
||||
addTransaction(Balance.Transaction.SELL, quests.get(questIndex).getReward());
|
||||
addTransaction(Balance.Transaction.DELIVER, quests.get(questIndex).getReward());
|
||||
quests.remove(questIndex);
|
||||
visual.onQuestRemoved(questIndex);
|
||||
visual.onProductCleared(x, y, z);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Balance {
|
||||
}
|
||||
|
||||
public enum Transaction {
|
||||
ABANDON, DESTROY, MOVE, NOOP, SELL, STORE;
|
||||
ABANDON, DESTROY, MOVE, NOOP, DELIVER, STORE;
|
||||
|
||||
public String getTranslationKey() {
|
||||
return "game.balance.history.type." + name().toLowerCase(Locale.ENGLISH);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class QuestController {
|
||||
DraggedProduct product = (DraggedProduct) dragboard.getContent(DraggedProduct.FORMAT);
|
||||
if (product instanceof DraggedProduct.Slot) {
|
||||
DraggedProduct.Slot slot = (DraggedProduct.Slot) product;
|
||||
if (WhatAStorage.getInstance().canSellProduct(getIndex(), slot.x, slot.y)) {
|
||||
if (WhatAStorage.getInstance().canDeliverProduct(getIndex(), slot.x, slot.y)) {
|
||||
dragEvent.acceptTransferModes(TransferMode.MOVE);
|
||||
dragEvent.consume();
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class QuestController {
|
||||
DraggedProduct product = (DraggedProduct) dragboard.getContent(DraggedProduct.FORMAT);
|
||||
if (product instanceof DraggedProduct.Slot) {
|
||||
DraggedProduct.Slot slot = (DraggedProduct.Slot) product;
|
||||
if (WhatAStorage.getInstance().sellProduct(getIndex(), slot.x, slot.y)) {
|
||||
if (WhatAStorage.getInstance().deliverProduct(getIndex(), slot.x, slot.y)) {
|
||||
dragEvent.setDropCompleted(true);
|
||||
dragEvent.consume();
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@ game.balance.history.type.abandon = Auftrag abgelehnt
|
||||
game.balance.history.type.destroy = Produkt zerst\u00f6rt
|
||||
game.balance.history.type.move = Produkt bewegt
|
||||
game.balance.history.type.noop = NOOP
|
||||
game.balance.history.type.sell = Produkt ausgelagert
|
||||
game.balance.history.type.deliver = Produkt ausgelagert
|
||||
game.balance.history.type.store = Produkt eingelagert
|
||||
game.balance.chart = Bilanz
|
||||
game.balance.chart.line = Budget
|
||||
|
||||
@@ -18,7 +18,7 @@ game.balance.history.type.abandon = Quest abandoned
|
||||
game.balance.history.type.destroy = Product destroy
|
||||
game.balance.history.type.move = Product moved
|
||||
game.balance.history.type.noop = NOOP
|
||||
game.balance.history.type.sell = Product sold
|
||||
game.balance.history.type.deliver = Product delivered
|
||||
game.balance.history.type.store = Product stored
|
||||
game.balance.chart = Balance
|
||||
game.balance.chart.line = Budget
|
||||
|
||||
Reference in New Issue
Block a user