summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-08-31 17:15:10 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-08-31 17:15:10 +0200
commit89beca8b32b3fcb43abcb6167709caad1ffe94ee (patch)
tree02cfdd6dd5b81d5a8a48985b86fd51a6c1210625
parentef01f7826ac3fdf8434d9e8af2eef86638b058e9 (diff)
Adds a directory for shared code.
-rw-r--r--src/battle/elm-package.json3
-rw-r--r--src/battle/src/Util/List.elm16
-rw-r--r--src/character/elm-package.json3
-rw-r--r--src/character/src/Util/Array.elm34
-rw-r--r--src/character/src/Util/Html.elm6
-rw-r--r--src/character/src/Util/List.elm16
-rw-r--r--src/login/elm-package.json3
-rw-r--r--src/login/src/Util/Array.elm34
-rw-r--r--src/login/src/Util/Html.elm6
-rw-r--r--src/login/src/Util/List.elm16
-rw-r--r--src/map-editor/elm-package.json3
-rw-r--r--src/map-editor/src/Util/Array.elm34
-rw-r--r--src/map-editor/src/Util/Html.elm6
-rw-r--r--src/shared/elm/Util/Array.elm (renamed from src/battle/src/Util/Array.elm)0
-rw-r--r--src/shared/elm/Util/Html.elm (renamed from src/battle/src/Util/Html.elm)0
-rw-r--r--src/shared/elm/Util/List.elm (renamed from src/map-editor/src/Util/List.elm)0
16 files changed, 8 insertions, 172 deletions
diff --git a/src/battle/elm-package.json b/src/battle/elm-package.json
index 43957bf..e824a29 100644
--- a/src/battle/elm-package.json
+++ b/src/battle/elm-package.json
@@ -4,7 +4,8 @@
"repository": "https://github.com/nsensfel/tacticians-client.git",
"license": "Apache 2.0",
"source-directories": [
- "src"
+ "src",
+ "../shared/elm"
],
"exposed-modules": [],
"dependencies": {
diff --git a/src/battle/src/Util/List.elm b/src/battle/src/Util/List.elm
deleted file mode 100644
index 2bc5217..0000000
--- a/src/battle/src/Util/List.elm
+++ /dev/null
@@ -1,16 +0,0 @@
-module Util.List exposing (..)
-
-import List
-
-pop : List a -> (Maybe (a, List a))
-pop l =
- case
- ((List.head l), (List.tail l))
- of
- (Nothing, _) -> Nothing
- (_ , Nothing) -> Nothing
- ((Just head), (Just tail)) -> (Just (head, tail))
-
-get_first : (a -> Bool) -> (List a) -> (Maybe a)
-get_first fun list =
- (List.head (List.filter fun list))
diff --git a/src/character/elm-package.json b/src/character/elm-package.json
index 5f6573f..d62239e 100644
--- a/src/character/elm-package.json
+++ b/src/character/elm-package.json
@@ -4,7 +4,8 @@
"repository": "https://github.com/nsensfel/tacticians-client.git",
"license": "Apache 2.0",
"source-directories": [
- "src"
+ "src",
+ "../shared/elm"
],
"exposed-modules": [],
"dependencies": {
diff --git a/src/character/src/Util/Array.elm b/src/character/src/Util/Array.elm
deleted file mode 100644
index 9e57c18..0000000
--- a/src/character/src/Util/Array.elm
+++ /dev/null
@@ -1,34 +0,0 @@
-module Util.Array exposing
- (
- update,
- update_unsafe,
- filter_first
- )
-
-import Array
-
-update : (
- Int ->
- ((Maybe t) -> (Maybe t)) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update index fun array =
- case (fun (Array.get index array)) of
- Nothing -> array
- (Just e) -> (Array.set index e array)
-
-update_unsafe : (
- Int ->
- (t -> t) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update_unsafe index fun array =
- case (Array.get index array) of
- Nothing -> array
- (Just e) -> (Array.set index (fun e) array)
-
-filter_first : (t -> Bool) -> (Array.Array t) -> (Maybe t)
-filter_first fun array =
- (Array.get 0 (Array.filter fun array))
diff --git a/src/character/src/Util/Html.elm b/src/character/src/Util/Html.elm
deleted file mode 100644
index 42eadba..0000000
--- a/src/character/src/Util/Html.elm
+++ /dev/null
@@ -1,6 +0,0 @@
-module Util.Html exposing (nothing)
-
-import Html
-
-nothing : (Html.Html a)
-nothing = (Html.text "")
diff --git a/src/character/src/Util/List.elm b/src/character/src/Util/List.elm
deleted file mode 100644
index 2bc5217..0000000
--- a/src/character/src/Util/List.elm
+++ /dev/null
@@ -1,16 +0,0 @@
-module Util.List exposing (..)
-
-import List
-
-pop : List a -> (Maybe (a, List a))
-pop l =
- case
- ((List.head l), (List.tail l))
- of
- (Nothing, _) -> Nothing
- (_ , Nothing) -> Nothing
- ((Just head), (Just tail)) -> (Just (head, tail))
-
-get_first : (a -> Bool) -> (List a) -> (Maybe a)
-get_first fun list =
- (List.head (List.filter fun list))
diff --git a/src/login/elm-package.json b/src/login/elm-package.json
index 5f6573f..d62239e 100644
--- a/src/login/elm-package.json
+++ b/src/login/elm-package.json
@@ -4,7 +4,8 @@
"repository": "https://github.com/nsensfel/tacticians-client.git",
"license": "Apache 2.0",
"source-directories": [
- "src"
+ "src",
+ "../shared/elm"
],
"exposed-modules": [],
"dependencies": {
diff --git a/src/login/src/Util/Array.elm b/src/login/src/Util/Array.elm
deleted file mode 100644
index 9e57c18..0000000
--- a/src/login/src/Util/Array.elm
+++ /dev/null
@@ -1,34 +0,0 @@
-module Util.Array exposing
- (
- update,
- update_unsafe,
- filter_first
- )
-
-import Array
-
-update : (
- Int ->
- ((Maybe t) -> (Maybe t)) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update index fun array =
- case (fun (Array.get index array)) of
- Nothing -> array
- (Just e) -> (Array.set index e array)
-
-update_unsafe : (
- Int ->
- (t -> t) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update_unsafe index fun array =
- case (Array.get index array) of
- Nothing -> array
- (Just e) -> (Array.set index (fun e) array)
-
-filter_first : (t -> Bool) -> (Array.Array t) -> (Maybe t)
-filter_first fun array =
- (Array.get 0 (Array.filter fun array))
diff --git a/src/login/src/Util/Html.elm b/src/login/src/Util/Html.elm
deleted file mode 100644
index 42eadba..0000000
--- a/src/login/src/Util/Html.elm
+++ /dev/null
@@ -1,6 +0,0 @@
-module Util.Html exposing (nothing)
-
-import Html
-
-nothing : (Html.Html a)
-nothing = (Html.text "")
diff --git a/src/login/src/Util/List.elm b/src/login/src/Util/List.elm
deleted file mode 100644
index 2bc5217..0000000
--- a/src/login/src/Util/List.elm
+++ /dev/null
@@ -1,16 +0,0 @@
-module Util.List exposing (..)
-
-import List
-
-pop : List a -> (Maybe (a, List a))
-pop l =
- case
- ((List.head l), (List.tail l))
- of
- (Nothing, _) -> Nothing
- (_ , Nothing) -> Nothing
- ((Just head), (Just tail)) -> (Just (head, tail))
-
-get_first : (a -> Bool) -> (List a) -> (Maybe a)
-get_first fun list =
- (List.head (List.filter fun list))
diff --git a/src/map-editor/elm-package.json b/src/map-editor/elm-package.json
index 43957bf..e824a29 100644
--- a/src/map-editor/elm-package.json
+++ b/src/map-editor/elm-package.json
@@ -4,7 +4,8 @@
"repository": "https://github.com/nsensfel/tacticians-client.git",
"license": "Apache 2.0",
"source-directories": [
- "src"
+ "src",
+ "../shared/elm"
],
"exposed-modules": [],
"dependencies": {
diff --git a/src/map-editor/src/Util/Array.elm b/src/map-editor/src/Util/Array.elm
deleted file mode 100644
index 9e57c18..0000000
--- a/src/map-editor/src/Util/Array.elm
+++ /dev/null
@@ -1,34 +0,0 @@
-module Util.Array exposing
- (
- update,
- update_unsafe,
- filter_first
- )
-
-import Array
-
-update : (
- Int ->
- ((Maybe t) -> (Maybe t)) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update index fun array =
- case (fun (Array.get index array)) of
- Nothing -> array
- (Just e) -> (Array.set index e array)
-
-update_unsafe : (
- Int ->
- (t -> t) ->
- (Array.Array t) ->
- (Array.Array t)
- )
-update_unsafe index fun array =
- case (Array.get index array) of
- Nothing -> array
- (Just e) -> (Array.set index (fun e) array)
-
-filter_first : (t -> Bool) -> (Array.Array t) -> (Maybe t)
-filter_first fun array =
- (Array.get 0 (Array.filter fun array))
diff --git a/src/map-editor/src/Util/Html.elm b/src/map-editor/src/Util/Html.elm
deleted file mode 100644
index 42eadba..0000000
--- a/src/map-editor/src/Util/Html.elm
+++ /dev/null
@@ -1,6 +0,0 @@
-module Util.Html exposing (nothing)
-
-import Html
-
-nothing : (Html.Html a)
-nothing = (Html.text "")
diff --git a/src/battle/src/Util/Array.elm b/src/shared/elm/Util/Array.elm
index 9e57c18..9e57c18 100644
--- a/src/battle/src/Util/Array.elm
+++ b/src/shared/elm/Util/Array.elm
diff --git a/src/battle/src/Util/Html.elm b/src/shared/elm/Util/Html.elm
index 42eadba..42eadba 100644
--- a/src/battle/src/Util/Html.elm
+++ b/src/shared/elm/Util/Html.elm
diff --git a/src/map-editor/src/Util/List.elm b/src/shared/elm/Util/List.elm
index 1f914b1..1f914b1 100644
--- a/src/map-editor/src/Util/List.elm
+++ b/src/shared/elm/Util/List.elm