summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-02-23 11:35:45 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-02-23 11:35:45 +0100 |
commit | acf9e9f1eb880ffb8ab918c40724eda566aefcc7 (patch) | |
tree | efa3dd6c88d7970632fbe44f322d03b983b02768 /src/struct/attributes.erl | |
parent | 43e38e5fc54fd58e8230b2b5198b6d8cb625803c (diff) |
Starting a big refactoring...
Diffstat (limited to 'src/struct/attributes.erl')
-rw-r--r-- | src/struct/attributes.erl | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/struct/attributes.erl b/src/struct/attributes.erl new file mode 100644 index 0000000..b4395cb --- /dev/null +++ b/src/struct/attributes.erl @@ -0,0 +1,68 @@ +-module(attributes). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-record +( + attributes, + { + constitution, + dexterity, + intelligence, + mind, + speed, + strength + } +). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +-export +( + [ + get_constitution/1, + get_dexterity/1, + get_intelligence/1, + get_mind/1, + get_speed/1, + get_strength/1, + + set_constitution/2, + set_dexterity/2, + set_intelligence/2, + set_mind/2, + set_speed/2, + set_strength/2 + ] +). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +get_constitution (Att) -> Att#attributes.constitution. +get_dexterity (Att) -> Att#attributes.dexterity. +get_intelligence (Att) -> Att#attributes.intelligence. +get_mind (Att) -> Att#attributes.mind. +get_speed (Att) -> Att#attributes.speed. +get_strength (Att) -> Att#attributes.strength. + +set_constitution (Att, Val) -> + Att#attributes{ constitution = Val }. +set_dexterity (Att, Val) -> + Att#attributes{ dexterity = Val }. +set_intelligence (Att, Val) -> + Att#attributes{ intelligence = Val }. +set_mind (Att, Val) -> + Att#attributes{ mind = Val }. +set_speed (Att, Val) -> + Att#attributes{ speed = Val }. +set_strength (Att, Val) -> + Att#attributes{ strength = Val }. |