mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 06:06:15 +01:00
earnMoney with event card movement
This commit is contained in:
parent
0f6205fbc7
commit
6bd1ed6e3a
@ -188,6 +188,24 @@ public class Player implements FieldVisitor<Void>{
|
|||||||
return fieldID;
|
return fieldID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the player to the specified Position on the board
|
||||||
|
* @param position the position to move to
|
||||||
|
* @return the new position
|
||||||
|
*/
|
||||||
|
public int setPositionWithMoney(int position){
|
||||||
|
if(position < 40 && position >= 0) {
|
||||||
|
if(position < fieldID) {
|
||||||
|
earnMoney(2000);
|
||||||
|
}
|
||||||
|
fieldID = position;
|
||||||
|
figure.moveTo(fieldID);
|
||||||
|
handler.getLogic().send(this, new PlayerStatusUpdate(handler));
|
||||||
|
handler.getLogic().getBoardManager().getFieldAtIndex(fieldID).accept(this);
|
||||||
|
}
|
||||||
|
return fieldID;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets all the properties owned by this player
|
* Gets all the properties owned by this player
|
||||||
* @return List of all properties owned by this player
|
* @return List of all properties owned by this player
|
||||||
|
@ -189,7 +189,7 @@ public class DeckHelper{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void spoparty(Player player) {
|
private void spoparty(Player player) {
|
||||||
player.setPosition(14);
|
player.setPositionWithMoney(14);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gulakFrei(Player player) {
|
private void gulakFrei(Player player) {
|
||||||
@ -197,11 +197,11 @@ public class DeckHelper{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dienstfuehrerschein(Player player) {
|
private void dienstfuehrerschein(Player player) {
|
||||||
player.setPosition(20);
|
player.setPositionWithMoney(20);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pubquiz(Player player) {
|
private void pubquiz(Player player) {
|
||||||
player.setPosition(39);
|
player.setPositionWithMoney(39);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void namensschildTruppenkueche(Player player) {
|
private void namensschildTruppenkueche(Player player) {
|
||||||
@ -221,7 +221,7 @@ public class DeckHelper{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void naechstesMonatsgehalt(Player player) {
|
private void naechstesMonatsgehalt(Player player) {
|
||||||
player.setPosition(0);
|
player.setPositionWithMoney(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void antretenVerschlafen(Player player) {
|
private void antretenVerschlafen(Player player) {
|
||||||
@ -237,7 +237,7 @@ public class DeckHelper{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void dienstsportGym(Player player) {
|
private void dienstsportGym(Player player) {
|
||||||
player.setPosition(1);
|
player.setPositionWithMoney(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void schimmelGulak(Player player) {
|
private void schimmelGulak(Player player) {
|
||||||
@ -249,7 +249,7 @@ public class DeckHelper{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void jahresabschlussantreten(Player player) {
|
private void jahresabschlussantreten(Player player) {
|
||||||
player.setPosition(17);
|
player.setPositionWithMoney(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verkaufenVersicherungen(Player player) {
|
private void verkaufenVersicherungen(Player player) {
|
||||||
|
Loading…
Reference in New Issue
Block a user