summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-02-15 18:18:54 +0100
committernsensfel <SpamShield0@noot-noot.org>2019-02-15 18:18:54 +0100
commit85b1e04a22e7564b702aa27c5f6467ad4d5f4416 (patch)
treed0a408eb97412feccdbcfe20b951669b6f6e6588 /src/shared/struct/inventory/shr_armor.erl.m4
parent9b91ff37a1e39f48631b5bee338c31318d1e2336 (diff)
Re-organizing shr_ structs.
Diffstat (limited to 'src/shared/struct/inventory/shr_armor.erl.m4')
-rw-r--r--src/shared/struct/inventory/shr_armor.erl.m468
1 files changed, 68 insertions, 0 deletions
diff --git a/src/shared/struct/inventory/shr_armor.erl.m4 b/src/shared/struct/inventory/shr_armor.erl.m4
new file mode 100644
index 0000000..18d203a
--- /dev/null
+++ b/src/shared/struct/inventory/shr_armor.erl.m4
@@ -0,0 +1,68 @@
+-module(shr_armor).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-type id() :: binary().
+
+-record
+(
+ armor,
+ {
+ id :: id(),
+ name :: binary(),
+ omnimods :: shr_omnimods:type()
+ }
+).
+
+-opaque type() :: #armor{}.
+
+-export_type([type/0, id/0]).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Accessors
+-export
+(
+ [
+ get_id/1,
+ get_name/1,
+ get_omnimods/1
+ ]
+).
+
+-export
+(
+ [
+ none/0,
+ from_id/1
+ ]
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Accessors
+-spec get_id (type()) -> id().
+get_id (Ar) -> Ar#armor.id.
+
+-spec get_name (type()) -> binary().
+get_name (Ar) -> Ar#armor.name.
+
+-spec get_omnimods (type()) -> shr_omnimods:type().
+get_omnimods (Ar) -> Ar#armor.omnimods.
+
+-spec from_id (id()) -> type().
+m4_include(__MAKEFILE_DATA_DIR/armor/global.m4.conf)m4_dnl
+m4_include(__MAKEFILE_DATA_DIR/armor/basic.m4d)m4_dnl
+from_id(_) ->
+ none().
+
+-spec none () -> type().
+none () -> from_id(<<"0">>).