summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-21 22:19:47 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-21 22:19:47 +0100
commit0054c60e9711eda87a484bceea5349d7e6d93390 (patch)
treec4fbfb5ca988820be51907999ed67f80e52cf707 /src/main
parentAdd playerIndex and validation method to the Move itself (diff)
downloadseven-wonders-0054c60e9711eda87a484bceea5349d7e6d93390.tar.gz
seven-wonders-0054c60e9711eda87a484bceea5349d7e6d93390.tar.bz2
seven-wonders-0054c60e9711eda87a484bceea5349d7e6d93390.zip
Add doc to Definition.create() to explicitly state the "no side-effect" requirement
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/Definition.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/Definition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/Definition.java
index 15ecb255..6c6b4b19 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/Definition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/Definition.java
@@ -11,5 +11,14 @@ import org.luxons.sevenwonders.game.Settings;
*/
public interface Definition<T> {
+ /**
+ * Creates a T object from the given settings. This method mustn't mutate this Definition as it may be called
+ * multiple times with different settings.
+ *
+ * @param settings
+ * the game settings to use to generate a game-specific object from this definition
+ *
+ * @return the new game-specific object created from this definition
+ */
T create(Settings settings);
}
bgstack15