summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-02-26 13:52:29 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-02-26 13:52:29 +0100
commitfd4d031ab5b31763d376c663cc049f62ee389243 (patch)
treecd09a29bb888acf772fa1aee59fe95e8bd75fe4e /src/shim/battlemap_shim.erl
parent66ec11ce5d2e227846d6e6b2899cda851a70fc04 (diff)
Got it to run, at last.
Diffstat (limited to 'src/shim/battlemap_shim.erl')
-rw-r--r--src/shim/battlemap_shim.erl64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/shim/battlemap_shim.erl b/src/shim/battlemap_shim.erl
deleted file mode 100644
index b19a653..0000000
--- a/src/shim/battlemap_shim.erl
+++ /dev/null
@@ -1,64 +0,0 @@
--module(battlemap_shim).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--record
-(
- battlemap,
- {
- id,
- width,
- height,
- content,
- instances
- }
-).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--export
-(
- [
- generate_random/0
- ]
-).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-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 FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-generate_random () ->
- 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))
- }.