jdmonin / JSettlers2

Java Settlers project home, downloads, and GPLv3 source code. To download the latest version as a JAR, see https://github.com/jdmonin/JSettlers2/releases/latest .
http://nand.net/jsettlers/
GNU General Public License v3.0
157 stars 63 forks source link

Tests, introduce ResourceSet interface #36

Closed generateui closed 6 years ago

generateui commented 6 years ago
generateui commented 6 years ago

A ResourceSet interface introduces simplicity, safety, clarity, testability and readability.

Above arguments can be used for any type in the game (why not have ImmutablePlayer, ImmutableGame, etc... ?). ResourceSet deserves it's own since it is used a lot throughout the codebase. It's a very common concept used to implement things in JSettlers. For other classes, this advantage is (much) less so, so introducing an immutable interface definition for it is probably overkill.

jdmonin commented 6 years ago

That makes sense, thanks again. Merged, with followups as noted in review.