From efaf3ee3f4b2478079c7b9dde8f9e879956a460f Mon Sep 17 00:00:00 2001 From: nsensfel Date: Thu, 16 Nov 2017 17:06:17 +0100 Subject: Starting changes in the structure. --- src/database_shim.erl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/database_shim.erl (limited to 'src/database_shim.erl') diff --git a/src/database_shim.erl b/src/database_shim.erl new file mode 100644 index 0000000..3e88c34 --- /dev/null +++ b/src/database_shim.erl @@ -0,0 +1,26 @@ +-module(database_shim). +-export([fetch/2]). + +-include("timed_cache_data.hrl"). + +fetch(battlemap_db, Object_ID) -> + Width = (rand:uniform(54) + 10), + Height = (rand:uniform(54) + 10), + io:format + ( + "~nGenerating new Battlemap ~p of size (~p, ~p)...~n", + [Object_ID, Width, Height] + ), + Result = + #battlemap { + id = Object_ID, + width = Width, + height = Height, + content = battlemap_shim:generate(Width, Height) + }, + {ok, + { + character_shim:generate(Width, Height) + } + }; +fetch(battlemap_db, Object_ID) -> -- cgit v1.2.3-70-g09d2