diff --git a/.gitignore b/.gitignore index dc84959..9a049fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ +/.geany diff --git a/readme.md b/readme.md index ec04568..a729f40 100644 --- a/readme.md +++ b/readme.md @@ -1,24 +1,26 @@ # Verrückte Turing-Maschinen -Dieses Spiel ist inspiriert von [http://www.kongregate.com/games/PleasingFungus/manufactoria"](Manufacturia), [http://www.crazy-machines.com/](Crazy Machines), [http://worldofgoo.com/](World of Goo) … und auch von unvergessenen Stunden Hardware-Praktikum im Informatik-Studium :P +— ein Turing-vollständiges Spiel + +### Beschreibung + +Dieses Spiel ist inspiriert von [Manufacturia](http://www.kongregate.com/games/PleasingFungus/manufactoria), [Crazy Machines](http://www.crazy-machines.com/), [World of Goo](http://worldofgoo.com/) … und auch von unvergessenen Stunden Hardware-Praktikum im Informatik-Studium :P ## Erstellen ### Voraussetzungen -- [https://www.gnu.org/software/make/manual/make.html](GNU-Make) -- [http://www.typescriptlang.org/](Typescript)-Compiler -- [http://sass-lang.com/](Sass)-Compiler - -Typescript und Sass sind beispielweise per [https://www.npmjs.com/](npm) beziehbar mit `npm install -g typescript && npm install -g sass`. +- [GNU-Make](https://www.gnu.org/software/make/manual/make.html) +- [TypeScript](http://www.typescriptlang.org/)-Compiler (Debian-Paket-Name: `node-typescript`, npm-Paket-Name: `typescript`) +- [Sass](http://sass-lang.com/)-Compiler (Debian-Paket-Name: `sassc`, npm-Paket-Name: `sass`) -### Kompilieren +### Anweisungen Im Haupt-Verzeichnis ausführen: - make + tools/build Dadurch wird das Verzeichnis `build` angelegt, welches die Ergebnis-Dateien enthält. @@ -30,5 +32,5 @@ Zum Starten/Testen einen Web-Server im Verzeichnis `build` starten (zum Beispiel ## Anmerkungen -Das Programm folgt konsequent den Paradigmen der prozeduralen und funktionalen Programmierung und orientiert sich am Architektur-Muster [https://de.wikipedia.org/wiki/Model_View_Controller](MVC). +Das Programm folgt konsequent den Paradigmen der prozeduralen und funktionalen Programmierung und orientiert sich am Architektur-Muster [MVC](https://de.wikipedia.org/wiki/Model_View_Controller). diff --git a/source/data/_data.ts b/source/data/_data.ts index 97b9b0f..f01d879 100644 --- a/source/data/_data.ts +++ b/source/data/_data.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_data + export namespace mod_data { /** diff --git a/source/data/strings/de.dat.js b/source/data/strings/de.dat.js index b7451f7..27cd26a 100644 --- a/source/data/strings/de.dat.js +++ b/source/data/strings/de.dat.js @@ -5,6 +5,7 @@ jsonp_handle( "common.title": "Verrückte Turing-Maschinen", "common.help": "Hilfe", "common.game": "Spiel", + "common.media": "Musik", "model.token.terms.singular": "Figur", "model.token.terms.plural": "Figuren", "model.modes.initial": "Maschine bearbeiten", diff --git a/source/data/strings/en.dat.js b/source/data/strings/en.dat.js index 0d4f47a..5bdd854 100644 --- a/source/data/strings/en.dat.js +++ b/source/data/strings/en.dat.js @@ -5,6 +5,7 @@ jsonp_handle( "common.title": "Crazy Turing Machines", "common.help": "Help", "common.game": "Game", + "common.media": "Media", "model.token.terms.singular": "token", "model.token.terms.plural": "tokens", "model.modes.initial": "edit machine", diff --git a/source/data/strings/eo.dat.js b/source/data/strings/eo.dat.js index db33dbb..f4de448 100644 --- a/source/data/strings/eo.dat.js +++ b/source/data/strings/eo.dat.js @@ -5,6 +5,7 @@ jsonp_handle( "common.title": "Frenezaj Turing-masxinoj", "common.help": "Helpo", "common.game": "Ludo", + "common.media": "Musiko", "model.token.terms.singular": "figuro", "model.token.terms.plural": "figuroj", "model.modes.initial": "redakti masxinon", diff --git a/source/helpers/call.ts b/source/helpers/call.ts index 1dde2b5..d40c41f 100644 --- a/source/helpers/call.ts +++ b/source/helpers/call.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_call +namespace lib_call { /** diff --git a/source/helpers/errormonade.ts b/source/helpers/errormonade.ts index 3834b62..359994b 100644 --- a/source/helpers/errormonade.ts +++ b/source/helpers/errormonade.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_errormonade +namespace lib_errormonade { /** diff --git a/source/helpers/hashmap.ts b/source/helpers/hashmap.ts index 08effbd..ee8f125 100644 --- a/source/helpers/hashmap.ts +++ b/source/helpers/hashmap.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_hashmap +namespace lib_hashmap { /** diff --git a/source/helpers/list.ts b/source/helpers/list.ts index 0416387..099e4e5 100644 --- a/source/helpers/list.ts +++ b/source/helpers/list.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_list +namespace lib_list { /** diff --git a/source/helpers/math.ts b/source/helpers/math.ts index 5632ade..ac59922 100644 --- a/source/helpers/math.ts +++ b/source/helpers/math.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_math +namespace lib_math { /** diff --git a/source/helpers/string.ts b/source/helpers/string.ts index 0af72f0..42d9051 100644 --- a/source/helpers/string.ts +++ b/source/helpers/string.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_string +namespace lib_string { /** diff --git a/source/helpers/svg.ts b/source/helpers/svg.ts index f265c9e..4bbf79a 100644 --- a/source/helpers/svg.ts +++ b/source/helpers/svg.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_svg +namespace lib_svg { /** @@ -126,6 +126,54 @@ module lib_svg } + /** + * @author kcf + */ + export function group + ( + attributes : {[key : string] : string} = {}, + children : Array = [] + ) + : lib_xml.type_node + { + return ( + lib_xml.create_normal + ( + "g", + attributes, + children + ) + ); + } + + + /** + * @author kcf + */ + export function circle + ( + center_x : float, + center_y : float, + radius : float, + classes : Array = [] + ) + : lib_xml.type_node + { + return ( + lib_xml.create_normal + ( + "circle", + { + "cx": center_x.toFixed(float_precision), + "cy": center_y.toFixed(float_precision), + "r": radius.toFixed(float_precision), + "class": classes.join(" "), + } + ) + ); + } + + /** * @author kcf */ diff --git a/source/helpers/trait.ts b/source/helpers/trait.ts index 6b52b0e..dfce91c 100644 --- a/source/helpers/trait.ts +++ b/source/helpers/trait.ts @@ -17,7 +17,7 @@ */ -module lib_trait +namespace lib_trait { /** diff --git a/source/helpers/translate.ts b/source/helpers/translate.ts index 1e6600e..59d9887 100644 --- a/source/helpers/translate.ts +++ b/source/helpers/translate.ts @@ -17,7 +17,7 @@ */ -module lib_translate +namespace lib_translate { /** @@ -42,12 +42,12 @@ module lib_translate ( language => { - let strs_raw_ : lib_errormonade.type_errormonade = mod_vtm.mod_data.read("strings-" + language); + const strs_raw_ : lib_errormonade.type_errormonade = mod_vtm.mod_data.read("strings-" + language); if (lib_errormonade.filled(strs_raw_)) { - let strs_raw : {[key : string] : string} = (<{[key : string] : string}>(lib_errormonade.read(strs_raw_))); + const strs_raw : {[key : string] : string} = (<{[key : string] : string}>(lib_errormonade.read(strs_raw_))); _data[language] = {}; - for (let key in strs_raw) + for (const key in strs_raw) { _data[language][key] = ((strs_raw[key])); } @@ -55,7 +55,7 @@ module lib_translate } else { - let message : string = ("Zeichenketten für Sprache '" + language + "' konnten nicht geladen werden"); + const message : string = ("Zeichenketten für Sprache '" + language + "' konnten nicht geladen werden"); console.warn(message); } } @@ -78,14 +78,14 @@ module lib_translate } else { - let message : string = ("keine Zeichenketten für Schlüssel '" + key + "' in Sprache '" + language + "'"); + const message : string = ("keine Zeichenketten für Schlüssel '" + key + "' in Sprache '" + language + "'"); console.warn(message); return (lib_errormonade.create_nothing()); } } else { - let message : string = ("keine Zeichenketten für Sprache '" + language + "'"); + const message : string = ("keine Zeichenketten für Sprache '" + language + "'"); console.warn(message); return (lib_errormonade.create_nothing()); } @@ -98,13 +98,13 @@ module lib_translate export function get(key : string, vars : {[name : string] : string} = {}) : string { let result : lib_errormonade.type_errormonade = (lib_errormonade.create_nothing()); - let found : boolean = ( + const found : boolean = ( _languagestack .some ( language => { - let result_ : lib_errormonade.type_errormonade = read(language, key); + const result_ : lib_errormonade.type_errormonade = read(language, key); if (lib_errormonade.filled(result_)) { result = result_; @@ -133,33 +133,41 @@ module lib_translate */ export function deploy(context : DocumentFragment) : void { - let pattern : RegExp = (new RegExp("^!translate:([a-z0-9\.]*)$")); - document.querySelectorAll("*")[""+"forEach"] - ( - element => - { - if (element.childElementCount === 0) - { - let content : string = element.textContent; - let fund : any = pattern.exec(content); - if (fund != null) - { - let key : string = fund[1]; - let content_ : string = get(key); - element.textContent = content_; - } - else - { - // nothing tun - } - } - else - { - // nothing tun - } - } - ) - ; + const pattern : RegExp = (new RegExp("^!translate:([a-z0-9\.]*)$")); + const adjust = ( + element => + { + if (element.childElementCount > 0) + { + // nichts tun + } + else + { + const content : string = element.textContent; + const fund : any = pattern.exec(content); + if (fund === null) + { + // nichts tun + } + else + { + const key : string = fund[1]; + const content_ : string = get(key); + element.textContent = content_; + } + } + } + ); + const old : boolean = true; + const nodelist : NodeListOf = document.querySelectorAll("*"); + if (old) + { + for (let index : int = 0; index < nodelist.length; index += 1) adjust(nodelist[index]) + } + else + { + nodelist.forEach(element => adjust(element)); + } } } diff --git a/source/helpers/vector.ts b/source/helpers/vector.ts index c0b91d7..05d19a1 100644 --- a/source/helpers/vector.ts +++ b/source/helpers/vector.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_vector +namespace lib_vector { /** diff --git a/source/helpers/xml.ts b/source/helpers/xml.ts index 488c9d4..0cce416 100644 --- a/source/helpers/xml.ts +++ b/source/helpers/xml.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module lib_xml +namespace lib_xml { /** diff --git a/source/main.html b/source/main.html index 89d0ddf..457f440 100644 --- a/source/main.html +++ b/source/main.html @@ -19,15 +19,18 @@ + + !translate:common.title -
!translate:common.title
- - +

!translate:common.title

+ + + @@ -54,70 +57,72 @@

-
!translate:help.controls.title
+

!translate:help.controls.title

  • !translate:help.controls.entry1
  • !translate:help.controls.entry2
-
!translate:model.token.terms.singular
+

!translate:model.token.terms.singular

!translate:help.token.satz1

!translate:help.token.satz2

-
!translate:model.actuators.terms.plural
+

!translate:model.actuators.terms.plural

!translate:help.actuators.introduction

  • -
    !translate:model.actuators.kinds.generator.name
    +

    !translate:model.actuators.kinds.generator.name

    !translate:help.actuators.generator
  • -
    !translate:model.actuators.kinds.acceptor.name
    +

    !translate:model.actuators.kinds.acceptor.name

    !translate:help.actuators.acceptor
  • -
    !translate:model.actuators.kinds.rejector.name
    +

    !translate:model.actuators.kinds.rejector.name

    !translate:help.actuators.rejector
  • -
    !translate:model.actuators.kinds.conveyer.name
    +

    !translate:model.actuators.kinds.conveyer.name

    !translate:help.actuators.conveyer
  • -
    !translate:model.actuators.kinds.writer.name
    +

    !translate:model.actuators.kinds.writer.name

    !translate:help.actuators.writer
  • -
    !translate:model.actuators.kinds.reader.name
    +

    !translate:model.actuators.kinds.reader.name

    !translate:help.actuators.reader
-
!translate:model.tasks.terms.plural
+

!translate:model.tasks.terms.plural

!translate:help.tasks.introduction

  • -
    !translate:model.tasks.kinds.acceptor.name
    +

    !translate:model.tasks.kinds.acceptor.name

    !translate:help.tasks.acceptor.description

    !translate:help.tasks.acceptor.example

  • -
    !translate:model.tasks.kinds.transducer.name
    +

    !translate:model.tasks.kinds.transducer.name

    !translate:help.tasks.transducer.description

    !translate:help.tasks.transducer.example

+
+ +
- diff --git a/source/main.scss b/source/main.scss index dffa7e3..930a849 100644 --- a/source/main.scss +++ b/source/main.scss @@ -94,14 +94,14 @@ input,select,textarea,button } } -body > header +label.tab { - font-size: 200%; margin: 8px; } #radio_help, -#radio_game +#radio_game, +#radio_media { display: none; } @@ -110,14 +110,28 @@ body > header { & ~ #help {} & ~ #game {display: none !important;} + & ~ #media {display: none !important;} } #radio_game:checked { & ~ #help {display: none !important;} & ~ #game {} + & ~ #media {display: none !important;} } +#radio_media:checked + { + & ~ #help {display: none !important;} + & ~ #game {display: none !important;} + & ~ #media {} + } + +/* +#help {display: none !important;} +#game {} + */ + #game { display: flex; @@ -128,7 +142,7 @@ body > header .section { margin: 8px; - padding: 8px; + padding: 16px; background-color: hsl($hue, 0%, 12.5%); color: hsl($hue, 0%, 87.5%); @@ -159,9 +173,9 @@ body > header flex-shrink: 1; } -#help section > header +h1,h2,h3,h4 { - font-size: 150%; + margin-top: 0; } #buttons @@ -248,3 +262,10 @@ body > header } } +#music + { + /* + display: none; + */ + } + diff --git a/source/main.ts b/source/main.ts index 3c2a1f0..51161a3 100644 --- a/source/main.ts +++ b/source/main.ts @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { /** @@ -24,7 +24,7 @@ module mod_vtm */ function tasks_insert(handler : (task : mod_model.mod_task.type_task)=>void) : void { - let tasks_raw_ : lib_errormonade.type_errormonade> = mod_vtm.mod_data.read("tasks"); + const tasks_raw_ : lib_errormonade.type_errormonade> = mod_vtm.mod_data.read("tasks"); if (lib_errormonade.filled(tasks_raw_)) { let tasks_raw : Array = lib_errormonade.read(tasks_raw_); @@ -83,9 +83,10 @@ module mod_vtm { // Übersetzungen { - let languages : Array = lib_list.copy(navigator.languages); - let language_native : string = "de"; - if (! languages[""+"includes"](language_native)) + const languages : Array = lib_list.copy(navigator.languages); + const language_native : string = "de"; + // if (! languages.includes(language_native)) + if (! languages.some((language) => (language === language_native))) languages.push(language_native); lib_translate.setup(languages); lib_translate.deploy(document); @@ -110,12 +111,12 @@ module mod_vtm { // Arten { - let from_x : float = -0.5; - let from_y : float = -0.5; - let to_x : float = +0.5; - let to_y : float = +0.5; - let width : float = 80; - let height : float = 80; + const from_x : float = -0.5; + const from_y : float = -0.5; + const to_x : float = +0.5; + const to_y : float = +0.5; + const width : float = 80; + const height : float = 80; [ { "model": mod_model.mod_actuator.example("generator"), @@ -146,14 +147,14 @@ module mod_vtm ( entry => { - let manifestation = ( + const manifestation = ( mod_manifestation.mod_svg.mod_actuator.create_extended ( entry.model, mod_model.mod_spot.null_() ) ); - let xmlnode : lib_xml.type_node = ( + const xmlnode : lib_xml.type_node = ( lib_svg.root ( from_x, from_y, @@ -213,7 +214,43 @@ module mod_vtm document.addEventListener ( "DOMContentLoaded", - event => {main();} + event => + { + // music + { + let dom_audio : HTMLAudioElement = document.querySelector("#music"); + + const playlist : Array = + [ + "time", + "marble_machine", + "elan", + "lux_aeterna", + "sweet_dreams", + ]; + let index : int = -1; + const next = function () + { + index = ((index + 1) % playlist.length); + const path : string = ("music/" + playlist[index] + ".ogg"); + let dom_source : HTMLSourceElement = document.createElement("source"); + dom_source.setAttribute("type", "audio/ogg"); + dom_source.setAttribute("src", path); + for (let i : int = 0; i < dom_audio.children.length; i += 1) dom_audio.removeChild(dom_audio.children[i]); + dom_audio.appendChild(dom_source); + dom_audio.load(); + dom_audio.play(); + } + ; + dom_audio.volume = 0.25; + // dom_audio.setAttribute("autoplay", "autoplay"); + // dom_audio.setAttribute("loop", "loop"); + // dom_audio.setAttribute("controls", "controls"); + dom_audio.addEventListener("ended", () => {next();}); + next(); + } + main(); + } ) ; } diff --git a/source/manifestation/manifestation.ts b/source/manifestation/manifestation.ts index 7379a95..7a00930 100644 --- a/source/manifestation/manifestation.ts +++ b/source/manifestation/manifestation.ts @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { /** diff --git a/source/manifestation/position.ts b/source/manifestation/position.ts index 68e4c81..4f32275 100644 --- a/source/manifestation/position.ts +++ b/source/manifestation/position.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_position + export namespace mod_position { /** diff --git a/source/manifestation/store/game.ts b/source/manifestation/store/game.ts index 8d1dcc1..5854b59 100644 --- a/source/manifestation/store/game.ts +++ b/source/manifestation/store/game.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_store + export namespace mod_store { - export module mod_game + export namespace mod_game { /** diff --git a/source/manifestation/svg/actuators/_actuator.ts b/source/manifestation/svg/actuators/_actuator.ts index 7926d60..122c84c 100644 --- a/source/manifestation/svg/actuators/_actuator.ts +++ b/source/manifestation/svg/actuators/_actuator.ts @@ -16,182 +16,166 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm.mod_manifestation.mod_svg.mod_actuator { - export module mod_manifestation + /** + * @author kcf + */ + export const shape_arrow_1 : string = ( + lib_svg.path_description + ( + ( + [ + lib_vector.cartesian( 4, 0), + lib_vector.cartesian( 0, +1), + lib_vector.cartesian(-0, 0), + lib_vector.cartesian( 0, -1), + ] + ), + true + ) + ); + + + /** + * @author kcf + */ + export const shape_arrow_2 : string = ( + lib_svg.path_description + ( + [ + lib_vector.cartesian(+3, 0), + lib_vector.cartesian( 0, +2), + lib_vector.cartesian(+1, 0), + lib_vector.cartesian( 0, -2), + ], + true + ) + ); + + + /** + * @author kcf + */ + export type signature_actuator = { - - export module mod_svg - { - - export module mod_actuator - { - - /** - * @author kcf - */ - export const shape_arrow_1 : string = ( - lib_svg.path_description - ( - ( - [ - lib_vector.cartesian( 4, 0), - lib_vector.cartesian( 0, +1), - lib_vector.cartesian(-0, 0), - lib_vector.cartesian( 0, -1), - ] - ), - true - ) - ); - - - /** - * @author kcf - */ - export const shape_arrow_2 : string = ( - lib_svg.path_description - ( - [ - lib_vector.cartesian(+3, 0), - lib_vector.cartesian( 0, +2), - lib_vector.cartesian(+1, 0), - lib_vector.cartesian( 0, -2), - ], - true - ) - ); - - - /** - * @author kcf - */ - export type signature_actuator = - { - view : (actuator : mod_vtm.mod_model.mod_actuator.type_actuator)=>Array; - } - ; - - - /** - * @author kcf - */ - export var trait_actuator : lib_trait.type_trait = lib_trait.create(); - - - /** - * @author kcf - */ - export type type_actuator = - { - model : mod_vtm.mod_model.mod_actuator.type_actuator; - spot : mod_vtm.mod_model.mod_spot.type_spot; - } - ; - - - /** - * @author kcf - */ - function create - ( - model : mod_vtm.mod_model.mod_actuator.type_actuator, - spot : mod_vtm.mod_model.mod_spot.type_spot - ) - : type_actuator - { - return { - "model": model, - "spot": spot - }; - } - - - /** - * @author kcf - */ - export function create_extended - ( - model : mod_vtm.mod_model.mod_actuator.type_actuator, - spot : mod_vtm.mod_model.mod_spot.type_spot - ) - : type_manifestation - { - return { - "kind": "svg_actuator", - "data": create(model, spot), - }; - } - - - /** - * @author kcf - */ - function view(actuator_ : type_actuator) : lib_xml.type_node - { - let actuator : mod_vtm.mod_model.mod_actuator.type_actuator = actuator_.model; - let node_frame = function () : lib_xml.type_node - { - return ( - lib_svg.path - ( - lib_list.sequence(6).map(i => lib_vector.polar(((i+0.5)/6) * (2*Math.PI), 0.5)), - true, - { - "class": "frame" - } - ) - ); - } - ; - let position : mod_position.type_position = mod_position.from_spot(actuator_.spot); - let node_tile : lib_xml.type_node = ( - lib_xml.create_normal - ( - "g", - { - "class": "tile", - "rel": mod_vtm.mod_model.mod_spot.hash(actuator_.spot), - "transform": lib_svg.translation(position.x, position.y), - }, - ( - [node_frame()] - .concat(lib_trait.deploy(trait_actuator, actuator.kind)["view"](actuator)) - ) - ) - ); - return node_tile; - } - - - /** - * @author kcf - */ - function bind(actuator : type_actuator) : void - { - } - - - /** - * @author kcf - */ - lib_trait.attend> - ( - trait_manifestation, - "svg_actuator", - { - "view": (manifestation) => view(manifestation.data), - "bind": (manifestation) => bind(manifestation.data), - } - ) - ; - - } - - } - + view : (actuator : mod_vtm.mod_model.mod_actuator.type_actuator)=>Array; } - + ; + + + /** + * @author kcf + */ + export var trait_actuator : lib_trait.type_trait = lib_trait.create(); + + + /** + * @author kcf + */ + export type type_actuator = + { + model : mod_vtm.mod_model.mod_actuator.type_actuator; + spot : mod_vtm.mod_model.mod_spot.type_spot; + } + ; + + + /** + * @author kcf + */ + function create + ( + model : mod_vtm.mod_model.mod_actuator.type_actuator, + spot : mod_vtm.mod_model.mod_spot.type_spot + ) + : type_actuator + { + return { + "model": model, + "spot": spot + }; + } + + + /** + * @author kcf + */ + export function create_extended + ( + model : mod_vtm.mod_model.mod_actuator.type_actuator, + spot : mod_vtm.mod_model.mod_spot.type_spot + ) + : type_manifestation + { + return { + "kind": "svg_actuator", + "data": create(model, spot), + }; + } + + + /** + * @author kcf + */ + function view(actuator_ : type_actuator) : lib_xml.type_node + { + let actuator : mod_vtm.mod_model.mod_actuator.type_actuator = actuator_.model; + let node_frame = function () : lib_xml.type_node + { + return ( + lib_svg.path + ( + lib_list.sequence(6).map(i => lib_vector.polar(((i+0.5)/6) * (2*Math.PI), 0.5)), + true, + { + "class": "frame" + } + ) + ); + } + ; + let position : mod_position.type_position = mod_position.from_spot(actuator_.spot); + let node_tile : lib_xml.type_node = ( + lib_svg.group + ( + { + "class": "tile", + "rel": mod_vtm.mod_model.mod_spot.hash(actuator_.spot), + "transform": lib_svg.translation(position.x, position.y), + }, + ( + [node_frame()] + .concat(lib_trait.deploy(trait_actuator, actuator.kind)["view"](actuator)) + ) + ) + ); + return node_tile; + } + + + /** + * @author kcf + */ + function bind(actuator : type_actuator) : void + { + } + + + /** + * @author kcf + */ + lib_trait.attend> + ( + trait_manifestation, + "svg_actuator", + { + "view": (manifestation) => view(manifestation.data), + "bind": (manifestation) => bind(manifestation.data), + } + ) + ; + } - + diff --git a/source/manifestation/svg/actuators/acceptor.ts b/source/manifestation/svg/actuators/acceptor.ts index 98e6a0f..7876bba 100644 --- a/source/manifestation/svg/actuators/acceptor.ts +++ b/source/manifestation/svg/actuators/acceptor.ts @@ -16,59 +16,39 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm.mod_manifestation.mod_svg.mod_actuator { - export module mod_manifestation - { - - export module mod_svg - { - - export module mod_actuator - { - - /** - * @author kcf - */ - lib_trait.attend + /** + * @author kcf + */ + lib_trait.attend + ( + trait_actuator, + "acceptor", + { + "view": (actuator) => + { + let children : Array = []; + const node_circle : lib_xml.type_node = ( + lib_svg.circle ( - trait_actuator, - "acceptor", - { - "view": (actuator) => - { - let children : Array = []; - let node_circle : lib_xml.type_node = ( - lib_xml.create_normal - ( - "circle", - { - "cx": (0.0).toFixed(lib_svg.float_precision), - "cy": (0.0).toFixed(lib_svg.float_precision), - "r": (0.25).toFixed(lib_svg.float_precision), - "class": ( - [ - "circle", - "positive", - ].join(" ") - ), - } - ) - ); - children.push(node_circle); - return children; - } - , - } + 0.0, + 0.0, + 0.25, + [ + "circle", + "positive", + ] ) - ; - - } - - } - - } + ); + children.push(node_circle); + return children; + } + , + } + ) + ; } diff --git a/source/manifestation/svg/actuators/conveyer.ts b/source/manifestation/svg/actuators/conveyer.ts index 5260e1d..5783ea6 100644 --- a/source/manifestation/svg/actuators/conveyer.ts +++ b/source/manifestation/svg/actuators/conveyer.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/manifestation/svg/actuators/generator.ts b/source/manifestation/svg/actuators/generator.ts index b71c15e..6c1681c 100644 --- a/source/manifestation/svg/actuators/generator.ts +++ b/source/manifestation/svg/actuators/generator.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/manifestation/svg/actuators/reader.ts b/source/manifestation/svg/actuators/reader.ts index 717fdff..4435db0 100644 --- a/source/manifestation/svg/actuators/reader.ts +++ b/source/manifestation/svg/actuators/reader.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/manifestation/svg/actuators/rejector.ts b/source/manifestation/svg/actuators/rejector.ts index f74427c..9335374 100644 --- a/source/manifestation/svg/actuators/rejector.ts +++ b/source/manifestation/svg/actuators/rejector.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/manifestation/svg/actuators/writer.ts b/source/manifestation/svg/actuators/writer.ts index fb23dd4..00e02f2 100644 --- a/source/manifestation/svg/actuators/writer.ts +++ b/source/manifestation/svg/actuators/writer.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/manifestation/svg/game.ts b/source/manifestation/svg/game.ts index 039a366..debf15d 100644 --- a/source/manifestation/svg/game.ts +++ b/source/manifestation/svg/game.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_game + export namespace mod_game { /** diff --git a/source/manifestation/svg/token.ts b/source/manifestation/svg/token.ts index d3e79af..daaf46b 100644 --- a/source/manifestation/svg/token.ts +++ b/source/manifestation/svg/token.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_manifestation + export namespace mod_manifestation { - export module mod_svg + export namespace mod_svg { - export module mod_token + export namespace mod_token { /** diff --git a/source/manifestation/web/game.scss b/source/manifestation/web/game.scss index be61812..da00061 100644 --- a/source/manifestation/web/game.scss +++ b/source/manifestation/web/game.scss @@ -17,14 +17,8 @@ */ $phi: 0.6180339887498949; -$sigma: $phi; - -/* -$hue_symbol_0: 000.0000000000000; -$hue_symbol_1: 222.4922359499621; -$hue_symbol_2: 084.9844718999243; -$hue_symbol_3: 307.4767078498864; - */ +// $sigma: $phi; +$sigma: 0.25; $offset: 0.0; $hue_symbol_0: (((($sigma*0)+$offset)%1)*360); @@ -32,7 +26,8 @@ $hue_symbol_1: (((($sigma*1)+$offset)%1)*360); $hue_symbol_2: (((($sigma*2)+$offset)%1)*360); $hue_symbol_3: (((($sigma*3)+$offset)%1)*360); -$saturation_symbol: 50%; + +$saturation_symbol: 75%; $lightness_symbol: 50%; .frame diff --git a/source/manifestation/web/game.ts b/source/manifestation/web/game.ts index 70e143d..a497406 100644 --- a/source/manifestation/web/game.ts +++ b/source/manifestation/web/game.ts @@ -16,483 +16,468 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm.mod_manifestation.mod_web.mod_game { - export module mod_manifestation + /** + * @author kcf + */ + function text_postprocess(text : string) : string { - - export module mod_web - { - - export module mod_game - { - - /** - * @author kcf - */ - function text_postprocess(text : string) : string - { - let vars : {[name : string] : string} = {}; - for (let i : int = 0; i <= 3; i += 1) - vars["s" + i.toFixed(0)] = ("  "); - return lib_string.stance(text, vars); - } - - - /** - * @author kcf - */ - export type type_game = - { - model : mod_model.mod_game.type_game; - area : Element; - intervall : lib_errormonade.type_errormonade; - } - ; - - - /** - * @author kcf - */ - function create - ( - model : mod_model.mod_game.type_game, - area : Element - ) - : type_game - { - return { - "model": model, - "area": area, - "intervall": (lib_errormonade.create_nothing()), - }; - } - - - /** - * @author kcf - */ - export function create_extended - ( - model : mod_model.mod_game.type_game, - area : Element - ) - : type_manifestation - { - return ( - lib_call.wrap - ( - "web_game", - create(model, area) - ) - ); - } - - - /** - * @author kcf - */ - function update_task(game : type_game) : void - { - document.querySelector("#task_text").innerHTML = ( - text_postprocess - ( - mod_vtm.mod_model.mod_task.text - ( - mod_vtm.mod_model.mod_game.task_read(game.model) - ) - ) - ); - } - - - /** - * @author kcf - */ - function update_world(game : type_game) : void - { - let node_svg : lib_xml.type_node = lib_svg.root - ( - -4, -4, - +4, +4, - 800, 800, - [mod_manifestation.view(mod_svg.mod_game.create_extended(game.model))] - ) - ; - game.area.innerHTML = lib_xml.view(node_svg); - } - - - /** - * @author kcf - */ - function update_token(game : type_game) : void - { - let node_svg : lib_xml.type_node = lib_svg.root - ( - -4, -4, - +4, +4, - 800, 800, - [mod_manifestation.view(mod_svg.mod_game.create_extended(game.model))] - ) - ; - game.area.innerHTML = lib_xml.view(node_svg); - } - - - /** - * @author kcf - */ - function update_mode(game : type_game) : void - { - let status : string; - switch (mod_vtm.mod_model.mod_game.mode_read(game.model)) - { - case mod_vtm.mod_model.mod_mode.initial: - { - status = lib_translate.get("model.modes.initial"); - break; - } - case mod_vtm.mod_model.mod_mode.uncertain: - { - status = lib_translate.get("model.modes.uncertain"); - break; - } - case mod_vtm.mod_model.mod_mode.wrong: - { - status = lib_translate.get("model.modes.wrong"); - break; - } - case mod_vtm.mod_model.mod_mode.correct: - { - status = lib_translate.get("model.modes.correct"); - break; - } - default: - { - let message : string = "unbehandelter Modus"; - throw (new Error(message)); - break; - } - } - document.querySelector("#task_status").textContent = status; - } - - - /** - * @author kcf - */ - function update_buttons(game : type_game) : void - { - let mode : mod_vtm.mod_model.mod_mode.type_mode = mod_vtm.mod_model.mod_game.mode_read(game.model); - let class_ : string; - switch (mode) - { - case mod_vtm.mod_model.mod_mode.initial: - { - class_ = "initial"; - break; - } - case mod_vtm.mod_model.mod_mode.uncertain: - { - class_ = ( - lib_errormonade.filled(game.intervall) - ? "uncertain_running" - : "uncertain_standing" - ); - break; - } - case mod_vtm.mod_model.mod_mode.wrong: - case mod_vtm.mod_model.mod_mode.correct: - { - class_ = "done"; - break; - } - default: - { - throw (new Error("unbehandelt!")); - break; - } - } - document.querySelector("#buttons").setAttribute("class", class_); - } - - - /** - * @author kcf - */ - function view(game : type_game) : void - { - update_task(game); - update_world(game); - update_token(game); - update_mode(game); - update_buttons(game); - } - - - /** - * @author kcf - */ - function stop(game : type_game) : void - { - if (lib_errormonade.filled(game.intervall)) - { - clearInterval(lib_errormonade.read(game.intervall)); - game.intervall = (lib_errormonade.create_nothing()); - } - else - { - let message : string = "kein Intervall gesetzt"; - console.warn(message); - } - update_buttons(game); - } - - - /** - * @author kcf - */ - function resume(game : type_game) : void - { - mod_vtm.mod_model.mod_game.resume(game.model); - let mode : mod_vtm.mod_model.mod_mode.type_mode = mod_vtm.mod_model.mod_game.mode_read(game.model); - if (mode <= 1) - { - // nothing tun - } - else - { - stop(game); - } - update_buttons(game); - } - - - /** - * @author kcf - */ - function testen(game : type_game) : void - { - let handle : any = setInterval(() => resume(game), 500); - game.intervall = (lib_errormonade.create_just(handle)); - } - - - /** - * @author kcf - */ - function edit(game : type_game) : void - { - stop(game); - mod_vtm.mod_model.mod_game.reset(game.model); - } - - - /** - * @author kcf - */ - function clear(game : type_game) : void - { - mod_vtm.mod_model.mod_game.world_clear(game.model); - mod_vtm.mod_model.mod_game.reset(game.model); - } - - - /** - * @author kcf - */ - function bind(game : type_game) : void - { - let spot_determine = (target : EventTarget) => - { - let spot : lib_errormonade.type_errormonade; - let dom_tile : Element = target["closest"](".tile"); - if (dom_tile == null) - { - spot = (lib_errormonade.create_nothing()); - } - else - { - let rel : string = dom_tile.getAttribute("rel") - spot = (lib_errormonade.create_just(mod_vtm.mod_model.mod_spot.from_hash(rel))); - } - return spot; - } - ; - mod_vtm.mod_model.mod_game.listen - ( - game.model, - "change_task", - (data) => - { - update_task(game); - } - ) - ; - mod_vtm.mod_model.mod_game.listen - ( - game.model, - "change_world", - (data) => - { - update_world(game); - } - ) - ; - mod_vtm.mod_model.mod_game.listen - ( - game.model, - "change_token", - (data) => - { - update_token(game); - } - ) - ; - mod_vtm.mod_model.mod_game.listen - ( - game.model, - "change_mode", - (data) => - { - update_mode(game); - update_buttons(game); - } - ) - ; - // Links-Klick - game.area.addEventListener - ( - "click", - event => - { - event.preventDefault(); - let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); - if (lib_errormonade.filled(spot_)) - { - mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), false); - } - else - { - console.info("-- kein Feld"); - } - } - ) - ; - // Rechts-Klick - game.area.addEventListener - ( - "contextmenu", - event => - { - event.preventDefault(); - let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); - if (lib_errormonade.filled(spot_)) - { - mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), true); - } - else - { - console.info("-- kein Feld"); - } - } - ) - ; - // Mausrad - game.area.addEventListener - ( - "wheel", - event => - { - event.preventDefault(); - let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); - if (lib_errormonade.filled(spot_)) - { - let increment : int = ((event["deltaY"] < 0) ? -1 : +1); - mod_vtm.mod_model.mod_game.world_tile_rotate(game.model, lib_errormonade.read(spot_), increment); - } - else - { - console.info("-- kein Feld"); - } - } - ) - ; - // Schritt - document.querySelector("#button_step").addEventListener - ( - "click", - event => - { - stop(game); - resume(game); - } - ) - ; - // Testen - document.querySelector("#button_test").addEventListener - ( - "click", - event => - { - testen(game); - } - ) - ; - // stop - document.querySelector("#button_stop").addEventListener - ( - "click", - event => - { - stop(game); - } - ) - ; - // edit - document.querySelector("#button_edit").addEventListener - ( - "click", - event => - { - edit(game); - } - ) - ; - // Leeren - document.querySelector("#button_clear").addEventListener - ( - "click", - event => - { - clear(game); - } - ) - ; - } - - - /** - * @author kcf - */ - lib_trait.attend> - ( - trait_manifestation, - "web_game", - { - "view": (manifestation) => view(manifestation.data), - "bind": (manifestation) => bind(manifestation.data), - } - ) - ; - - } - - } - + let vars : {[name : string] : string} = {}; + for (let i : int = 0; i <= 3; i += 1) + vars["s" + i.toFixed(0)] = ("  "); + return lib_string.stance(text, vars); } + + /** + * @author kcf + */ + export type type_game = + { + model : mod_model.mod_game.type_game; + area : Element; + intervall : lib_errormonade.type_errormonade; + } + ; + + + /** + * @author kcf + */ + function create + ( + model : mod_model.mod_game.type_game, + area : Element + ) + : type_game + { + return { + "model": model, + "area": area, + "intervall": (lib_errormonade.create_nothing()), + }; + } + + + /** + * @author kcf + */ + export function create_extended + ( + model : mod_model.mod_game.type_game, + area : Element + ) + : type_manifestation + { + return ( + lib_call.wrap + ( + "web_game", + create(model, area) + ) + ); + } + + + /** + * @author kcf + */ + function update_task(game : type_game) : void + { + document.querySelector("#task_text").innerHTML = ( + text_postprocess + ( + mod_vtm.mod_model.mod_task.text + ( + mod_vtm.mod_model.mod_game.task_read(game.model) + ) + ) + ); + } + + + /** + * @author kcf + */ + function update_world(game : type_game) : void + { + let node_svg : lib_xml.type_node = lib_svg.root + ( + -4, -4, + +4, +4, + 800, 800, + [mod_manifestation.view(mod_svg.mod_game.create_extended(game.model))] + ) + ; + game.area.innerHTML = lib_xml.view(node_svg); + } + + + /** + * @author kcf + */ + function update_token(game : type_game) : void + { + let node_svg : lib_xml.type_node = lib_svg.root + ( + -4, -4, + +4, +4, + 800, 800, + [mod_manifestation.view(mod_svg.mod_game.create_extended(game.model))] + ) + ; + game.area.innerHTML = lib_xml.view(node_svg); + } + + + /** + * @author kcf + */ + function update_mode(game : type_game) : void + { + let status : string; + switch (mod_vtm.mod_model.mod_game.mode_read(game.model)) + { + case mod_vtm.mod_model.mod_mode.initial: + { + status = lib_translate.get("model.modes.initial"); + break; + } + case mod_vtm.mod_model.mod_mode.uncertain: + { + status = lib_translate.get("model.modes.uncertain"); + break; + } + case mod_vtm.mod_model.mod_mode.wrong: + { + status = lib_translate.get("model.modes.wrong"); + break; + } + case mod_vtm.mod_model.mod_mode.correct: + { + status = lib_translate.get("model.modes.correct"); + break; + } + default: + { + let message : string = "unbehandelter Modus"; + throw (new Error(message)); + break; + } + } + document.querySelector("#task_status").textContent = status; + } + + + /** + * @author kcf + */ + function update_buttons(game : type_game) : void + { + let mode : mod_vtm.mod_model.mod_mode.type_mode = mod_vtm.mod_model.mod_game.mode_read(game.model); + let class_ : string; + switch (mode) + { + case mod_vtm.mod_model.mod_mode.initial: + { + class_ = "initial"; + break; + } + case mod_vtm.mod_model.mod_mode.uncertain: + { + class_ = ( + lib_errormonade.filled(game.intervall) + ? "uncertain_running" + : "uncertain_standing" + ); + break; + } + case mod_vtm.mod_model.mod_mode.wrong: + case mod_vtm.mod_model.mod_mode.correct: + { + class_ = "done"; + break; + } + default: + { + throw (new Error("unbehandelt!")); + break; + } + } + document.querySelector("#buttons").setAttribute("class", class_); + } + + + /** + * @author kcf + */ + function view(game : type_game) : void + { + update_task(game); + update_world(game); + update_token(game); + update_mode(game); + update_buttons(game); + } + + + /** + * @author kcf + */ + function stop(game : type_game) : void + { + if (lib_errormonade.filled(game.intervall)) + { + clearInterval(lib_errormonade.read(game.intervall)); + game.intervall = (lib_errormonade.create_nothing()); + } + else + { + let message : string = "kein Intervall gesetzt"; + console.warn(message); + } + update_buttons(game); + } + + + /** + * @author kcf + */ + function resume(game : type_game) : void + { + mod_vtm.mod_model.mod_game.resume(game.model); + let mode : mod_vtm.mod_model.mod_mode.type_mode = mod_vtm.mod_model.mod_game.mode_read(game.model); + if (mode <= 1) + { + // nothing tun + } + else + { + stop(game); + } + update_buttons(game); + } + + + /** + * @author kcf + */ + function testen(game : type_game) : void + { + let handle : any = setInterval(() => resume(game), 500); + game.intervall = (lib_errormonade.create_just(handle)); + } + + + /** + * @author kcf + */ + function edit(game : type_game) : void + { + stop(game); + mod_vtm.mod_model.mod_game.reset(game.model); + } + + + /** + * @author kcf + */ + function clear(game : type_game) : void + { + mod_vtm.mod_model.mod_game.world_clear(game.model); + mod_vtm.mod_model.mod_game.reset(game.model); + } + + + /** + * @author kcf + */ + function bind(game : type_game) : void + { + let spot_determine = (target : EventTarget) => + { + let spot : lib_errormonade.type_errormonade; + let dom_tile : Element = target["closest"](".tile"); + if (dom_tile == null) + { + spot = (lib_errormonade.create_nothing()); + } + else + { + let rel : string = dom_tile.getAttribute("rel") + spot = (lib_errormonade.create_just(mod_vtm.mod_model.mod_spot.from_hash(rel))); + } + return spot; + } + ; + mod_vtm.mod_model.mod_game.listen + ( + game.model, + "change_task", + (data) => + { + update_task(game); + } + ) + ; + mod_vtm.mod_model.mod_game.listen + ( + game.model, + "change_world", + (data) => + { + update_world(game); + } + ) + ; + mod_vtm.mod_model.mod_game.listen + ( + game.model, + "change_token", + (data) => + { + update_token(game); + } + ) + ; + mod_vtm.mod_model.mod_game.listen + ( + game.model, + "change_mode", + (data) => + { + update_mode(game); + update_buttons(game); + } + ) + ; + // Links-Klick + game.area.addEventListener + ( + "click", + event => + { + event.preventDefault(); + let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); + if (lib_errormonade.filled(spot_)) + { + mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), false); + } + else + { + console.info("-- kein Feld"); + } + } + ) + ; + // Rechts-Klick + game.area.addEventListener + ( + "contextmenu", + event => + { + event.preventDefault(); + let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); + if (lib_errormonade.filled(spot_)) + { + mod_vtm.mod_model.mod_game.world_tile_change(game.model, lib_errormonade.read(spot_), true); + } + else + { + console.info("-- kein Feld"); + } + } + ) + ; + // Mausrad + game.area.addEventListener + ( + "wheel", + event => + { + event.preventDefault(); + let spot_ : lib_errormonade.type_errormonade = spot_determine(event.target); + if (lib_errormonade.filled(spot_)) + { + let increment : int = ((event["deltaY"] < 0) ? -1 : +1); + mod_vtm.mod_model.mod_game.world_tile_rotate(game.model, lib_errormonade.read(spot_), increment); + } + else + { + console.info("-- kein Feld"); + } + } + ) + ; + // Schritt + document.querySelector("#button_step").addEventListener + ( + "click", + event => + { + stop(game); + resume(game); + } + ) + ; + // Testen + document.querySelector("#button_test").addEventListener + ( + "click", + event => + { + testen(game); + } + ) + ; + // stop + document.querySelector("#button_stop").addEventListener + ( + "click", + event => + { + stop(game); + } + ) + ; + // edit + document.querySelector("#button_edit").addEventListener + ( + "click", + event => + { + edit(game); + } + ) + ; + // Leeren + document.querySelector("#button_clear").addEventListener + ( + "click", + event => + { + clear(game); + } + ) + ; + } + + + /** + * @author kcf + */ + lib_trait.attend> + ( + trait_manifestation, + "web_game", + { + "view": (manifestation) => view(manifestation.data), + "bind": (manifestation) => bind(manifestation.data), + } + ) + ; + } diff --git a/source/model/actuators/_actuator.ts b/source/model/actuators/_actuator.ts index 245c653..bf1b54f 100644 --- a/source/model/actuators/_actuator.ts +++ b/source/model/actuators/_actuator.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { /** diff --git a/source/model/actuators/acceptor.ts b/source/model/actuators/acceptor.ts index 3ea703d..072f322 100644 --- a/source/model/actuators/acceptor.ts +++ b/source/model/actuators/acceptor.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_acceptor + export namespace mod_acceptor { /** diff --git a/source/model/actuators/conveyer.ts b/source/model/actuators/conveyer.ts index 7a5e603..f12be3e 100644 --- a/source/model/actuators/conveyer.ts +++ b/source/model/actuators/conveyer.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_conveyer + export namespace mod_conveyer { /** diff --git a/source/model/actuators/generator.ts b/source/model/actuators/generator.ts index 96df12d..f4b6a40 100644 --- a/source/model/actuators/generator.ts +++ b/source/model/actuators/generator.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_generator + export namespace mod_generator { /** diff --git a/source/model/actuators/reader.ts b/source/model/actuators/reader.ts index 43c82c5..5a5cad0 100644 --- a/source/model/actuators/reader.ts +++ b/source/model/actuators/reader.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_reader + export namespace mod_reader { /** diff --git a/source/model/actuators/rejector.ts b/source/model/actuators/rejector.ts index 14f74fb..182cbbf 100644 --- a/source/model/actuators/rejector.ts +++ b/source/model/actuators/rejector.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_rejector + export namespace mod_rejector { /** diff --git a/source/model/actuators/writer.ts b/source/model/actuators/writer.ts index ce18c2a..43c683f 100644 --- a/source/model/actuators/writer.ts +++ b/source/model/actuators/writer.ts @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_actuator + export namespace mod_actuator { - export module mod_writer + export namespace mod_writer { /** diff --git a/source/model/direction.ts b/source/model/direction.ts index 05d9cbe..2e1e72e 100644 --- a/source/model/direction.ts +++ b/source/model/direction.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_direction + export namespace mod_direction { /** diff --git a/source/model/game.ts b/source/model/game.ts index dca46ba..05759dd 100644 --- a/source/model/game.ts +++ b/source/model/game.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_game + export namespace mod_game { /** diff --git a/source/model/mode.ts b/source/model/mode.ts index 72d5720..c49a15c 100644 --- a/source/model/mode.ts +++ b/source/model/mode.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_mode + export namespace mod_mode { /** diff --git a/source/model/spot.ts b/source/model/spot.ts index 671eef0..fa01d94 100644 --- a/source/model/spot.ts +++ b/source/model/spot.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_spot + export namespace mod_spot { /** diff --git a/source/model/state.ts b/source/model/state.ts index 34c6a90..ae1f8e5 100644 --- a/source/model/state.ts +++ b/source/model/state.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_state + export namespace mod_state { /** diff --git a/source/model/symbol.ts b/source/model/symbol.ts index 2a897d4..770d166 100644 --- a/source/model/symbol.ts +++ b/source/model/symbol.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_symbol + export namespace mod_symbol { /** diff --git a/source/model/tasks/acceptortask.ts b/source/model/tasks/acceptortask.ts index 55deb06..84be380 100644 --- a/source/model/tasks/acceptortask.ts +++ b/source/model/tasks/acceptortask.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_acceptortask + export namespace mod_acceptortask { /** diff --git a/source/model/tasks/acceptortest.ts b/source/model/tasks/acceptortest.ts index 245f3b5..bf1ceea 100644 --- a/source/model/tasks/acceptortest.ts +++ b/source/model/tasks/acceptortest.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_acceptortest + export namespace mod_acceptortest { /** diff --git a/source/model/tasks/task.ts b/source/model/tasks/task.ts index ceaf208..f4521f4 100644 --- a/source/model/tasks/task.ts +++ b/source/model/tasks/task.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_task + export namespace mod_task { /** diff --git a/source/model/tasks/test.ts b/source/model/tasks/test.ts index 516923c..fcc8459 100644 --- a/source/model/tasks/test.ts +++ b/source/model/tasks/test.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_test + export namespace mod_test { /** diff --git a/source/model/tasks/transducertask.ts b/source/model/tasks/transducertask.ts index 142f9ae..8a4dd3a 100644 --- a/source/model/tasks/transducertask.ts +++ b/source/model/tasks/transducertask.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_transducertask + export namespace mod_transducertask { /** diff --git a/source/model/tasks/transducertest.ts b/source/model/tasks/transducertest.ts index 8cd4d47..1e2354e 100644 --- a/source/model/tasks/transducertest.ts +++ b/source/model/tasks/transducertest.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_transducertest + export namespace mod_transducertest { /** diff --git a/source/model/token.ts b/source/model/token.ts index cf89efd..d7d93f2 100644 --- a/source/model/token.ts +++ b/source/model/token.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_token + export namespace mod_token { /** diff --git a/source/model/world.ts b/source/model/world.ts index 174e005..8373d60 100644 --- a/source/model/world.ts +++ b/source/model/world.ts @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -module mod_vtm +namespace mod_vtm { - export module mod_model + export namespace mod_model { - export module mod_world + export namespace mod_world { /** diff --git a/source/music/elan.ogg b/source/music/elan.ogg new file mode 100644 index 0000000..003231e Binary files /dev/null and b/source/music/elan.ogg differ diff --git a/source/music/lux_aeterna.ogg b/source/music/lux_aeterna.ogg new file mode 100644 index 0000000..d0971f9 Binary files /dev/null and b/source/music/lux_aeterna.ogg differ diff --git a/source/music/marble_machine.ogg b/source/music/marble_machine.ogg new file mode 100644 index 0000000..bae7913 Binary files /dev/null and b/source/music/marble_machine.ogg differ diff --git a/source/music/sweet_dreams.ogg b/source/music/sweet_dreams.ogg new file mode 100644 index 0000000..c651752 Binary files /dev/null and b/source/music/sweet_dreams.ogg differ diff --git a/source/music/time.ogg b/source/music/time.ogg new file mode 100644 index 0000000..2d2529b Binary files /dev/null and b/source/music/time.ogg differ diff --git a/todo.md b/todo.md index 9a27c9c..4e6f469 100644 --- a/todo.md +++ b/todo.md @@ -2,4 +2,5 @@ - Tests anzeigen? - zufällige Tests? - Drehung beibehalten? +- bessere Musik-Steuerung diff --git a/tools/build b/tools/build new file mode 100755 index 0000000..2acaab1 --- /dev/null +++ b/tools/build @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +make --file=tools/makefile all + diff --git a/tools/build.sh b/tools/build.sh deleted file mode 100755 index 3d449a8..0000000 --- a/tools/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -make all - diff --git a/tools/rollout.sh b/tools/deploy similarity index 82% rename from tools/rollout.sh rename to tools/deploy index a242250..d71a742 100755 --- a/tools/rollout.sh +++ b/tools/deploy @@ -2,9 +2,8 @@ rsync \ --verbose \ - --archive \ - --compress \ --recursive \ + --delete \ --rsh=ssh \ build/* \ mehl:~/websites/folksprak.org/htdocs/vtm/ diff --git a/makefile b/tools/makefile similarity index 92% rename from makefile rename to tools/makefile index 79bbbd4..94f6d47 100644 --- a/makefile +++ b/tools/makefile @@ -1,10 +1,10 @@ cmd_md := mkdir -p cmd_rm := rm -rf cmd_echo := echo # -e -cmd_cp := cp -ruv +cmd_cp := cp -r -u -v cmd_cat := cat -cmd_tsc := tsc --allowUnreachableCode -cmd_sass := sass +cmd_tsc := tsc --target ES5 --allowUnreachableCode +cmd_sass := sassc dir_source := source dir_build := build @@ -13,7 +13,8 @@ all: \ ${dir_build}/vtm.html \ ${dir_build}/vtm.css \ ${dir_build}/vtm.dat.js \ - ${dir_build}/vtm.js + ${dir_build}/vtm.js \ + music .PHONY: all clear: @@ -96,3 +97,7 @@ ${dir_build}/vtm.js: \ @ ${cmd_md} ${dir_build} @ ${cmd_tsc} $^ --outFile $@ +music: + @ ${cmd_md} ${dir_build}/music + @ ${cmd_cp} ${dir_source}/music/* ${dir_build}/music/ +.PHONY: music diff --git a/tools/pack.sh b/tools/pack similarity index 100% rename from tools/pack.sh rename to tools/pack diff --git a/tools/reset.sh b/tools/reset similarity index 100% rename from tools/reset.sh rename to tools/reset diff --git a/version.txt b/version.txt index 8f0916f..4b9fcbe 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.5.0 +0.5.1