[{"name":"Logic.Component","comment":"\n\n@docs Set, Spec, empty\n\n","unions":[],"aliases":[{"name":"Set","comment":" Component storage, main building block of world\n","args":["comp"],"type":"Array.Array (Maybe.Maybe comp)"},{"name":"Spec","comment":" Component specification, how to get `Component.Set` from and world, and set back into world (used by Systems)\n","args":["comp","world"],"type":"{ get : world -> Logic.Component.Set comp, set : Logic.Component.Set comp -> world -> world }"}],"values":[{"name":"empty","comment":" Initial value of any empty `Component.Set` - mostly used to init component sets in world\n","type":"Logic.Component.Set comp"}],"binops":[]},{"name":"Logic.Component.Singleton","comment":"\n\n@docs Spec, update\n\n","unions":[],"aliases":[{"name":"Spec","comment":" Main way of creating ECS \"anti-pattern\", but time to time you need to create some component that can exist only one per whole application (viewport, keyboard, websocket-connection, etc. )\n","args":["comp","world"],"type":"{ get : world -> comp, set : comp -> world -> world }"}],"values":[{"name":"update","comment":" Update whole component set, can be used also with `Component.Set` (not only `Singleton`)\n","type":"{ get : world -> comp, set : comp -> world -> world } -> (comp -> comp) -> world -> world"}],"binops":[]},{"name":"Logic.Entity","comment":"\n\n@docs EntityID, create, with\n\n\n# List\n\n@docs fromList, toList\n\n\n# Dict\n\n@docs fromDict, toDict\n\n\n# Manipulations\n\n@docs getComponent, mapComponent, mapComponentSet, removeComponent, removeFor, setComponent, spawnComponent\n\n","unions":[],"aliases":[{"name":"EntityID","comment":" ","args":[],"type":"Basics.Int"}],"values":[{"name":"create","comment":" Start point for spawning entity\n\n    Entity.create ( id, world )\n        |> Entity.with ( positionSpec, positionComponent )\n        |> Entity.with ( velocitySpec, velocityComponent )\n\n","type":"Logic.Entity.EntityID -> world -> ( Logic.Entity.EntityID, world )"},{"name":"fromDict","comment":" ","type":"Dict.Dict Logic.Entity.EntityID a -> Logic.Component.Set a"},{"name":"fromList","comment":" ","type":"List.List ( Logic.Entity.EntityID, a ) -> Logic.Component.Set a"},{"name":"getComponent","comment":" ","type":"Basics.Int -> Logic.Component.Set comp -> Maybe.Maybe comp"},{"name":"mapComponent","comment":" ","type":"(Maybe.Maybe comp -> Maybe.Maybe comp) -> Logic.Entity.EntityID -> Logic.Component.Set comp -> Logic.Component.Set comp"},{"name":"mapComponentSet","comment":" ","type":"(comp -> comp) -> Logic.Entity.EntityID -> Logic.Component.Set comp -> Logic.Component.Set comp"},{"name":"removeComponent","comment":" Remove component from `Component.Set` by `EntityID` return new `Component.Set`, or return unchanged if component not in set\n","type":"Logic.Entity.EntityID -> Logic.Component.Set a -> Logic.Component.Set a"},{"name":"removeFor","comment":" Way to create `Entity` destruction functions, should pipe in all possible component sets, from what `Entity` should be removed.\nAlso can be used to just disable (remove) some components from entity\n\n    remove =\n        Entity.removeFor positionSpec\n            >> Entity.removeFor velocitySpec\n\n    newWorld =\n        remove ( id, world )\n\n","type":"Logic.Component.Spec comp world -> ( Logic.Entity.EntityID, world ) -> ( Logic.Entity.EntityID, world )"},{"name":"setComponent","comment":" Set the component at a particular index. Returns an updated component Set. If the index is out of range, the Set is unaltered.\n","type":"Logic.Entity.EntityID -> a -> Logic.Component.Set a -> Logic.Component.Set a"},{"name":"spawnComponent","comment":" Safe way to create component, same as setComponent, only if index is out of range Component.Set will be stretched\\\\\n","type":"Logic.Entity.EntityID -> a -> Logic.Component.Set a -> Logic.Component.Set a"},{"name":"toDict","comment":" ","type":"Logic.Component.Set a -> Dict.Dict Logic.Entity.EntityID a"},{"name":"toList","comment":" ","type":"Logic.Component.Set a -> List.List ( Logic.Entity.EntityID, a )"},{"name":"with","comment":" Setting components to spawn with new entity\n\n    Entity.create ( id, world )\n        |> Entity.with ( positionSpec, positionComponent )\n        |> Entity.with ( velocitySpec, velocityComponent )\n\n","type":"( Logic.Component.Spec comp world, comp ) -> ( Logic.Entity.EntityID, world ) -> ( Logic.Entity.EntityID, world )"}],"binops":[]},{"name":"Logic.GameFlow","comment":"\n\n@docs GameFlow, update, Model, updateWith, ExtendedModel\n\n","unions":[{"name":"GameFlow","comment":" game flow for update function\n\n1.  `Running` - runs in normal way 60FPS\n2.  `Pause` - game is stopped, and no `Systems` is running\n3.  `SlowMotion { frames = 60, fps = 20 }` - will run game **20FPS** for next **60** frames (3s)\n\n","args":[],"cases":[["Running",[]],["Pause",[]],["SlowMotion",["{ frames : Basics.Int, fps : Basics.Int }"]]]}],"aliases":[{"name":"ExtendedModel","comment":" ","args":["a","b"],"type":"( Logic.GameFlow.Model a, b )"},{"name":"Model","comment":" Extendable Model to run inside update\n","args":["a"],"type":"{ a | frame : Basics.Int, runtime_ : Basics.Float, flow : Logic.GameFlow.GameFlow }"}],"values":[{"name":"update","comment":" ","type":"(Logic.GameFlow.Model a -> Logic.GameFlow.Model a) -> Basics.Float -> Logic.GameFlow.Model a -> Logic.GameFlow.Model a"},{"name":"updateWith","comment":" same as update, but instead of Model, takes tuple, to make same output as default Elm update function\n","type":"(Logic.GameFlow.ExtendedModel a b -> Logic.GameFlow.ExtendedModel a b) -> Basics.Float -> Logic.GameFlow.ExtendedModel a b -> Logic.GameFlow.ExtendedModel a b"}],"binops":[]},{"name":"Logic.Launcher","comment":"\n\n@docs document\n@docs Document, Error, Launcher, World, task, worker\n\n","unions":[{"name":"Error","comment":" Error type to hold all error of game init\n","args":[],"cases":[["Error",["Basics.Int","String.String"]]]}],"aliases":[{"name":"Document","comment":" difference from `Browser.document`:\n\n1.  `init` takes as argument flags and returns Task, that results in world or fail (90% of games any way need get some data to start, images, level data, connection, etc.)\n2.  `subscriptions` instead of returning msg - should return new `World`\n3.  `update` have no `Msg` input\n4.  `view` instead of `Msg` event have to return function\n\n","args":["flags","world"],"type":"{ init : flags -> Task.Task Logic.Launcher.Error (Logic.Launcher.World world), subscriptions : Logic.Launcher.World world -> Platform.Sub.Sub (Logic.Launcher.World world), update : Logic.Launcher.World world -> ( Logic.Launcher.World world, Platform.Cmd.Cmd (Logic.Launcher.Message world) ), view : Logic.Launcher.World world -> List.List (Html.Html (Logic.Launcher.World world -> Logic.Launcher.World world)) }"},{"name":"Launcher","comment":" ","args":["flags","world"],"type":"Platform.Program flags (Logic.Launcher.Model world) (Logic.Launcher.Message world)"},{"name":"World","comment":" just alias to `Logic.GameFlow.Model world`\n","args":["world"],"type":"Logic.GameFlow.Model world"}],"values":[{"name":"document","comment":" Main entry point, but have few difference from `Browser.document`\n","type":"Logic.Launcher.Document flags world -> Logic.Launcher.Launcher flags world"},{"name":"task","comment":" Helper function, that allow convert `Task` into Cmd - for loading new `World` after `init`\n","type":"(Result.Result x a -> Logic.Launcher.World world -> Logic.Launcher.World world) -> Task.Task x a -> Platform.Cmd.Cmd (Logic.Launcher.Message world)"},{"name":"worker","comment":" Main entry point, but have few difference from `Platform.worker`\n","type":"{ init : flags -> Task.Task Logic.Launcher.Error (Logic.Launcher.World world), subscriptions : Logic.Launcher.World world -> Platform.Sub.Sub (Logic.Launcher.World world), update : Logic.Launcher.World world -> ( Logic.Launcher.World world, Platform.Cmd.Cmd (Logic.Launcher.Message world) ) } -> Logic.Launcher.Launcher flags world"}],"binops":[]},{"name":"Logic.System","comment":" Main logic driver is `System` that is what used to step each game-loop and update `World`\n\n@docs System\n@docs step, step2, step3, step4\n\n@docs foldl, foldl2, foldl3, foldl4\n@docs indexedFoldl, indexedFoldl2, indexedFoldl3\n\n\n# Util\n\n@docs applyIf\n\n\n# Custom Systems\n\n@docs UnfinishedSystem, start, andMap, end, endCustom\n\n\n# Helper types\n\n@docs SetsReducer2, SetsReducer3, SetsReducer4\n\n","unions":[{"name":"UnfinishedSystem","comment":" ","args":["world","acc","next","func"],"cases":[]}],"aliases":[{"name":"SetsReducer2","comment":" ","args":["a","b","acc"],"type":"( a, a -> acc -> acc ) -> ( b, b -> acc -> acc ) -> acc -> acc"},{"name":"SetsReducer3","comment":" ","args":["a","b","c","acc"],"type":"( a, a -> acc -> acc ) -> ( b, b -> acc -> acc ) -> ( c, c -> acc -> acc ) -> acc -> acc"},{"name":"SetsReducer4","comment":" ","args":["a","b","c","d","acc"],"type":"( a, a -> acc -> acc ) -> ( b, b -> acc -> acc ) -> ( c, c -> acc -> acc ) -> ( d, d -> acc -> acc ) -> acc -> acc"},{"name":"System","comment":" ","args":["world"],"type":"world -> world"}],"values":[{"name":"andMap","comment":" ","type":"Logic.Component.Spec comp world -> Logic.System.UnfinishedSystem world acc ( Logic.Component.Set comp, next ) (( comp, comp -> acc -> acc ) -> newFunc) -> Logic.System.UnfinishedSystem world acc next newFunc"},{"name":"applyIf","comment":" ","type":"Basics.Bool -> (a -> a) -> a -> a"},{"name":"end","comment":" ","type":"Logic.System.UnfinishedSystem world acc () (acc -> acc) -> world"},{"name":"endCustom","comment":" ","type":"custom -> Logic.System.UnfinishedSystem world acc () (( acc, custom ) -> ( acc, custom )) -> ( world, custom )"},{"name":"foldl","comment":" ","type":"(comp1 -> acc -> acc) -> Logic.Component.Set comp1 -> acc -> acc"},{"name":"foldl2","comment":" ","type":"(comp1 -> comp2 -> acc -> acc) -> Logic.Component.Set comp1 -> Logic.Component.Set comp2 -> acc -> acc"},{"name":"foldl3","comment":" ","type":"(comp1 -> comp2 -> comp3 -> acc -> acc) -> Logic.Component.Set comp1 -> Logic.Component.Set comp2 -> Logic.Component.Set comp3 -> acc -> acc"},{"name":"foldl4","comment":" ","type":"(comp1 -> comp2 -> comp3 -> comp4 -> acc -> acc) -> Logic.Component.Set comp1 -> Logic.Component.Set comp2 -> Logic.Component.Set comp3 -> Logic.Component.Set comp4 -> acc -> acc"},{"name":"indexedFoldl","comment":" ","type":"(Logic.Entity.EntityID -> comp1 -> acc -> acc) -> Logic.Component.Set comp1 -> acc -> acc"},{"name":"indexedFoldl2","comment":" ","type":"(Basics.Int -> comp1 -> comp2 -> acc -> acc) -> Logic.Component.Set comp1 -> Logic.Component.Set comp2 -> acc -> acc"},{"name":"indexedFoldl3","comment":" ","type":"(Logic.Entity.EntityID -> comp1 -> comp2 -> comp3 -> acc -> acc) -> Logic.Component.Set comp1 -> Logic.Component.Set comp2 -> Logic.Component.Set comp3 -> acc -> acc"},{"name":"start","comment":" 3 times slower then `foldN`\n","type":"(( comp, acc -> ( Array.Array (Maybe.Maybe acc), next ) -> ( Array.Array (Maybe.Maybe acc), next ) ) -> func) -> Logic.Component.Spec comp world -> world -> Logic.System.UnfinishedSystem world ( Logic.Component.Set comp, next ) next func"},{"name":"step","comment":" single component mapping, same as List.map - only for `Component.Set` inside `World`\n","type":"(comp -> comp) -> Logic.Component.Spec comp world -> world -> world"},{"name":"step2","comment":" Example:\n\n    system : Logic.Component.Spec Velocity world -> Logic.Component.Spec Position world -> System world\n       system =\n           Logic.System.step2\n               (\\( velocity, _ ) ( pos, setPos ) -> setPos (Vec2.add velocity pos))\n\n","type":"Logic.System.SetsReducer2 a b { a : Logic.Component.Set a, b : Logic.Component.Set b } -> Logic.Component.Spec a world -> Logic.Component.Spec b world -> world -> world"},{"name":"step3","comment":" same as [`step2`](#step2) only with 3 components\n","type":"Logic.System.SetsReducer3 a b c { a : Logic.Component.Set a, b : Logic.Component.Set b, c : Logic.Component.Set c } -> Logic.Component.Spec a world -> Logic.Component.Spec b world -> Logic.Component.Spec c world -> world -> world"},{"name":"step4","comment":" same as [`step2`](#step2) only with 4 components\n","type":"Logic.System.SetsReducer4 a b c d { a : Logic.Component.Set a, b : Logic.Component.Set b, c : Logic.Component.Set c, d : Logic.Component.Set d } -> Logic.Component.Spec a world -> Logic.Component.Spec b world -> Logic.Component.Spec c world -> Logic.Component.Spec d world -> world -> world"}],"binops":[]}]