YetAnotherSpieskowcy / Carcassonne-Engine

Other
0 stars 1 forks source link

cityManager.GetCity() with removed meeple #100

Closed Kaszana102 closed 2 weeks ago

Kaszana102 commented 1 month ago

City manager doesn't update its meeples in the cities, which causes an error when trying to look them up in fields. If the city has been finished, a city manager doesn't remove meeples from the manager. Thus in the end, during the final scoring, when fields are scored and they ask the city manager for a city with a certain feature which used to have meeple, the city manager returns nil as it also checks meeple existence.

Solution: either update city manager meeples while scoring cities or omit checking meeples in CityManager.GetCity()

Jackenmen commented 1 month ago

I think that ignoring the meeple in lookups (by unsettling the meeple in the keys) would be cleaner out of the proposed two solutions.