From 23b4c268d5c64dd17e919a3839272f411cb9222d Mon Sep 17 00:00:00 2001 From: nsensfel Date: Tue, 2 Oct 2018 16:24:04 +0200 Subject: Adds portraits as a data listing. --- src/shared/struct/shr_portrait.erl.m4 | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/shared/struct/shr_portrait.erl.m4 (limited to 'src/shared') diff --git a/src/shared/struct/shr_portrait.erl.m4 b/src/shared/struct/shr_portrait.erl.m4 new file mode 100644 index 0000000..2ea3ca0 --- /dev/null +++ b/src/shared/struct/shr_portrait.erl.m4 @@ -0,0 +1,69 @@ +-module(shr_portrait). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-type id() :: binary(). + +-record +( + portrait, + { + id :: id(), + name :: binary(), + body_id :: binary(), + icon_id :: binary() + } +). + +-opaque type() :: #portrait{}. + +-export_type([type/0, id/0]). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +-export +( + [ + get_id/1, + get_name/1, + get_body_id/1, + get_icon_id/1 + ] +). + +-export +( + [ + from_id/1 + ] +). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +-spec get_id (type()) -> id(). +get_id (Pt) -> Pt#portrait.id. + +-spec get_name (type()) -> binary(). +get_name (Pt) -> Pt#portrait.name. + +-spec get_body_id (type()) -> binary(). +get_body_id (Pt) -> Pt#portrait.body_id. + +-spec get_icon_id (type()) -> binary(). +get_icon_id (Pt) -> Pt#portrait.icon_id. + +-spec from_id (id()) -> type(). +m4_include(__MAKEFILE_DATA_DIR/portrait/global.m4.conf)m4_dnl +m4_include(__MAKEFILE_DATA_DIR/portrait/basic.m4d)m4_dnl +from_id(_) -> + from_id(0). -- cgit v1.2.3-70-g09d2