From 65a2b95f7355b6b495516b95dafa63f8ccaa2bb0 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 23 Oct 2019 17:46:45 +0200 Subject: ... --- src/shared/struct/shr_condition.erl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/shared/struct/shr_condition.erl') diff --git a/src/shared/struct/shr_condition.erl b/src/shared/struct/shr_condition.erl index 13c3426..25504fa 100644 --- a/src/shared/struct/shr_condition.erl +++ b/src/shared/struct/shr_condition.erl @@ -13,6 +13,7 @@ { id :: id(), name :: binary(), + module :: atom(), description :: binary(), % can it be removed or stolen? Not ranks, for example. is_transferable :: boolean() @@ -29,6 +30,8 @@ -export ( [ + from_id/1, + get_module/1 ] ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -38,3 +41,9 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-spec get_module (type()) -> atom(). +get_module (#condition{ module = Module }) -> Module. + +-spec from_id (id()) -> type(). +from_id (ID) -> + error({condition, unknown, ID}). -- cgit v1.2.3-70-g09d2