mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-10-31 19:29:03 +01:00 
			
		
		
		
	fixed player movement and go money
This commit is contained in:
		| @@ -161,10 +161,10 @@ public class Player implements FieldVisitor<Void>{ | ||||
|      * @return the new position | ||||
|      */ | ||||
|     public int move(int steps) { | ||||
|         fieldID = (fieldID + steps) % 40; | ||||
|         if (fieldID + steps >= 40) { | ||||
|             earnMoney(2000); // Passing GO gives money | ||||
|         } | ||||
|         fieldID = (fieldID + steps) % 40; | ||||
|         figure.moveTo(fieldID); | ||||
|         handler.getLogic().send(this, new PlayerStatusUpdate(handler)); | ||||
|         handler.getLogic().getBoardManager().getFieldAtIndex(fieldID).accept(this); | ||||
| @@ -180,6 +180,7 @@ public class Player implements FieldVisitor<Void>{ | ||||
|         if(position < 40 && position > 0) { | ||||
|             fieldID = position; | ||||
|             figure.moveTo(fieldID); | ||||
|             handler.getLogic().send(this, new PlayerStatusUpdate(handler)); | ||||
|             handler.getLogic().getBoardManager().getFieldAtIndex(fieldID).accept(this); | ||||
|         } | ||||
|         return fieldID; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user