summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-02-23 11:35:45 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-02-23 11:35:45 +0100
commitacf9e9f1eb880ffb8ab918c40724eda566aefcc7 (patch)
treeefa3dd6c88d7970632fbe44f322d03b983b02768 /src/shim/attributes_shim.erl
parent43e38e5fc54fd58e8230b2b5198b6d8cb625803c (diff)
Starting a big refactoring...
Diffstat (limited to 'src/shim/attributes_shim.erl')
-rw-r--r--src/shim/attributes_shim.erl47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/shim/attributes_shim.erl b/src/shim/attributes_shim.erl
new file mode 100644
index 0000000..b80ee6d
--- /dev/null
+++ b/src/shim/attributes_shim.erl
@@ -0,0 +1,47 @@
+-module(attributes_shim).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-record
+(
+ attributes,
+ {
+ constitution,
+ dexterity,
+ intelligence,
+ mind,
+ speed,
+ strength
+ }
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Accessors
+-export
+(
+ [
+ rand/0
+ ]
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+random_attribute (Min, Max) -> (rand:uniform(Max - Min) - 1) + Min.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+rand () ->
+ #attributes
+ {
+ constitution = random_attribute(10, 100),
+ dexterity = random_attribute(10, 100),
+ intelligence = random_attribute(10, 100),
+ mind = random_attribute(10, 100),
+ speed = random_attribute(10, 100),
+ strength = random_attribute(10, 100)
+ }.