summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/battlemap_shim.erl')
-rw-r--r--src/battlemap_shim.erl47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/battlemap_shim.erl b/src/battlemap_shim.erl
deleted file mode 100644
index f4042d2..0000000
--- a/src/battlemap_shim.erl
+++ /dev/null
@@ -1,47 +0,0 @@
--module(battlemap_shim).
--export
-(
- [
- generate/0
- ]
-).
-
--include("timed_cache_data.hrl").
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% LOCAL %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-generate(_Prev, Result, _X, 0, _BaseWidth) ->
- Result;
-generate(Prev, Result, 0, Y, BaseWidth) ->
- generate(Prev, Result, BaseWidth, (Y - 1), BaseWidth);
-generate(Prev, Result, X, Y, BaseWidth) ->
- case rand:uniform(100) of
- N when (N >= 10) ->
- generate(Prev, [Prev|Result], (X - 1), Y, BaseWidth);
-
- N ->
- NewTileType = (N - 1),
- generate
- (
- NewTileType,
- [NewTileType|Result],
- (X - 1),
- Y,
- BaseWidth
- )
- end.
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% EXPORTED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-generate () ->
- Width = (rand:uniform(48) + 16),
- Height = (rand:uniform(48) + 16),
- #battlemap
- {
- id = <<"0">>,
- width = Width,
- height = Height,
- content = array:from_list(generate(0, [], Width, Height, Width))
- }.