diff --git a/makefile b/makefile index 8a28d4d..3b80aa9 100644 --- a/makefile +++ b/makefile @@ -46,12 +46,8 @@ ${dir_erzeugnis}/vtm.js: \ ${dir_quelldatein}/helfer/typen.ts \ ${dir_quelldatein}/helfer/aufruf.ts \ ${dir_quelldatein}/helfer/brauch.ts \ - ${dir_quelldatein}/helfer/fehlermonade/_fehlermonade.ts \ - ${dir_quelldatein}/helfer/fehlermonade/nichts.ts \ - ${dir_quelldatein}/helfer/fehlermonade/schlicht.ts \ - ${dir_quelldatein}/helfer/xmlknoten/_xmlknoten.ts \ - ${dir_quelldatein}/helfer/xmlknoten/text.ts \ - ${dir_quelldatein}/helfer/xmlknoten/normal.ts \ + ${dir_quelldatein}/helfer/fehlermonade.ts \ + ${dir_quelldatein}/helfer/xml.ts \ ${dir_quelldatein}/helfer/verschiedenes.ts \ ${dir_quelldatein}/helfer/mathematik.ts \ ${dir_quelldatein}/helfer/vektor.ts \ diff --git a/quelldatein/aufbau/figur.ts b/quelldatein/aufbau/figur.ts index 25e6ab1..3f7a217 100644 --- a/quelldatein/aufbau/figur.ts +++ b/quelldatein/aufbau/figur.ts @@ -134,11 +134,11 @@ module mod_vtm { if (figur.band.length <= 0) { - return (lib_fehlermonade.mod_nichts.erstellen()); + return (lib_fehlermonade.erstellen_nichts()); } else { - return (lib_fehlermonade.mod_schlicht.erstellen(figur.band[0])); + return (lib_fehlermonade.erstellen_schlicht(figur.band[0])); } } diff --git a/quelldatein/aufbau/partie.ts b/quelldatein/aufbau/partie.ts index 72e4356..4e281ee 100644 --- a/quelldatein/aufbau/partie.ts +++ b/quelldatein/aufbau/partie.ts @@ -72,7 +72,13 @@ module mod_vtm /** * @author kcf */ - export function lauschen(partie : typ_partie, ereignis : string, prozedur : (angaben ?: any)=>void) : void + export function lauschen + ( + partie : typ_partie, + ereignis : string, + prozedur : (angaben ?: any)=>void + ) + : void { if (ereignis in partie.lauscher) { @@ -89,7 +95,12 @@ module mod_vtm /** * @author kcf */ - function benachrichtigen(partie : typ_partie, ereignis : string, angaben : any = {}) : void + function benachrichtigen + ( + partie : typ_partie, + ereignis : string, + angaben : any = {} + ) : void { if (ereignis in partie.lauscher) { @@ -113,10 +124,15 @@ module mod_vtm /** * @author kcf */ - export function zuruecksetzen(partie : typ_partie, bescheid_geben : boolean = true) : void + export function zuruecksetzen + ( + partie : typ_partie, + bescheid_geben : boolean = true + ) + : void { - partie.figur = (lib_fehlermonade.mod_nichts.erstellen()); - partie.testindex = (lib_fehlermonade.mod_nichts.erstellen()); + partie.figur = (lib_fehlermonade.erstellen_nichts()); + partie.testindex = (lib_fehlermonade.erstellen_nichts()); partie.modus = mod_modus.initial; if (bescheid_geben) { @@ -133,7 +149,11 @@ module mod_vtm /** * @author kcf */ - export function aufgabe_lesen(partie : typ_partie) : mod_aufgabe.typ_aufgabe + export function aufgabe_lesen + ( + partie : typ_partie + ) + : mod_aufgabe.typ_aufgabe { return partie.aufgabe; } @@ -142,7 +162,11 @@ module mod_vtm /** * @author kcf */ - export function aufgabe_setzen(partie : typ_partie, aufgabe : mod_aufgabe.typ_aufgabe) : void + export function aufgabe_setzen + ( + partie : typ_partie, + aufgabe : mod_aufgabe.typ_aufgabe + ) : void { partie.aufgabe = aufgabe; // partie.welt_leeren(); @@ -154,7 +178,11 @@ module mod_vtm /** * @author kcf */ - export function welt_lesen(partie : typ_partie) : mod_welt.typ_welt + export function welt_lesen + ( + partie : typ_partie + ) + : mod_welt.typ_welt { return partie.welt; } @@ -163,7 +191,13 @@ module mod_vtm /** * @author kcf */ - export function welt_setzen(partie : typ_partie, welt : mod_welt.typ_welt, bescheid_geben : boolean = true) : void + export function welt_setzen + ( + partie : typ_partie, + welt : mod_welt.typ_welt, + bescheid_geben : boolean = true + ) + : void { partie.welt = welt; if (bescheid_geben) @@ -180,7 +214,12 @@ module mod_vtm /** * @author kcf */ - export function welt_leeren(partie : typ_partie, bescheid_geben : boolean = true) : void + export function welt_leeren + ( + partie : typ_partie, + bescheid_geben : boolean = true + ) + : void { partie.welt = mod_welt.blanko(); if (bescheid_geben) @@ -197,7 +236,11 @@ module mod_vtm /** * @author kcf */ - export function figur_lesen(partie : typ_partie) : lib_fehlermonade.typ_fehlermonade + export function figur_lesen + ( + partie : typ_partie + ) + : lib_fehlermonade.typ_fehlermonade { return partie.figur; } @@ -206,7 +249,11 @@ module mod_vtm /** * @author kcf */ - export function modus_lesen(partie : typ_partie) : mod_modus.typ_modus + export function modus_lesen + ( + partie : typ_partie + ) + : mod_modus.typ_modus { return partie.modus; } @@ -215,7 +262,13 @@ module mod_vtm /** * @author kcf */ - export function welt_feld_wechseln(partie : typ_partie, stelle : mod_stelle.typ_stelle, umgekehrt : boolean = false) : void + export function welt_feld_wechseln + ( + partie : typ_partie, + stelle : mod_stelle.typ_stelle, + umgekehrt : boolean = false + ) + : void { if (! (partie.modus === mod_modus.initial)) { @@ -246,7 +299,13 @@ module mod_vtm /** * @author kcf */ - export function welt_feld_drehen(partie : typ_partie, stelle : mod_stelle.typ_stelle, inkrement : int = +1) : void + export function welt_feld_drehen + ( + partie : typ_partie, + stelle : mod_stelle.typ_stelle, + inkrement : int = +1 + ) + : void { if (! (partie.modus === mod_modus.initial)) { @@ -263,26 +322,30 @@ module mod_vtm /** * @author kcf */ - export function fortfahren(partie : typ_partie) : void + export function fortfahren + ( + partie : typ_partie + ) + : void { switch (partie.modus) { case mod_modus.initial: { partie.modus = mod_modus.ungewiss; - partie.testindex = (lib_fehlermonade.mod_schlicht.erstellen(0)); + partie.testindex = (lib_fehlermonade.erstellen_schlicht(0)); benachrichtigen(partie, "aenderung_modus", {}); break; } case mod_modus.ungewiss: { - if (! lib_fehlermonade.voll(partie.figur)) + if (! lib_fehlermonade.voll(partie.figur)) { - let test : mod_test.typ_test = mod_aufgabe.tests(partie.aufgabe)[lib_fehlermonade.lesen(partie.testindex)]; + let test : mod_test.typ_test = mod_aufgabe.tests(partie.aufgabe)[lib_fehlermonade.lesen(partie.testindex)]; let band : Array = mod_vtm.mod_helfer.liste_kopieren(mod_test.eingabe(test)); let stelle : mod_stelle.typ_stelle = mod_welt.erzeuger_finden(partie.welt); partie.figur = ( - lib_fehlermonade.mod_schlicht.erstellen + lib_fehlermonade.erstellen_schlicht ( mod_figur.erstellen ( @@ -294,12 +357,12 @@ module mod_vtm } else { - let figur : mod_figur.typ_figur = lib_fehlermonade.lesen(partie.figur); + let figur : mod_figur.typ_figur = lib_fehlermonade.lesen(partie.figur); let stelle : mod_stelle.typ_stelle = mod_figur.stelle_lesen(figur); let aktor_ : lib_fehlermonade.typ_fehlermonade = mod_welt.feld_holen(partie.welt, stelle); let aktor : mod_aktor.typ_aktor = ( - lib_fehlermonade.voll(aktor_) - ? lib_fehlermonade.lesen(aktor_) + lib_fehlermonade.voll(aktor_) + ? lib_fehlermonade.lesen(aktor_) : mod_aktor.mod_verwerfer.erstellen_aktor() ); mod_aktor.verwenden(aktor, figur); @@ -312,8 +375,8 @@ module mod_vtm { let angenommen : boolean = (zustand === mod_zustand.angenommen); let ausgabe : Array = mod_figur.band_lesen(figur); - partie.figur = (lib_fehlermonade.mod_nichts.erstellen()); - let testindex : int = lib_fehlermonade.lesen(partie.testindex); + partie.figur = (lib_fehlermonade.erstellen_nichts()); + let testindex : int = lib_fehlermonade.lesen(partie.testindex); let tests : Array = mod_aufgabe.tests(partie.aufgabe); let test : mod_test.typ_test = tests[testindex]; if (! mod_test.pruefen(test, angenommen, ausgabe)) @@ -327,12 +390,12 @@ module mod_vtm if (testindex < tests.length) { // nächsten Test auswählen - partie.testindex = (lib_fehlermonade.mod_schlicht.erstellen(testindex)); + partie.testindex = (lib_fehlermonade.erstellen_schlicht(testindex)); } else { // auf Modus "korrekt" wechseln - partie.testindex = (lib_fehlermonade.mod_nichts.erstellen()); + partie.testindex = (lib_fehlermonade.erstellen_nichts()); partie.modus = mod_modus.korrekt; benachrichtigen(partie, "aenderung_modus", {}); } diff --git a/quelldatein/aufbau/welt.ts b/quelldatein/aufbau/welt.ts index 86eecd3..dc307a9 100644 --- a/quelldatein/aufbau/welt.ts +++ b/quelldatein/aufbau/welt.ts @@ -53,7 +53,11 @@ module mod_vtm /** * @author kcf */ - export function felder_lesen(welt : typ_welt) : Array<{stelle : mod_stelle.typ_stelle; aktor : mod_aktor.typ_aktor;}> + export function felder_lesen + ( + welt : typ_welt + ) + : Array<{stelle : mod_stelle.typ_stelle; aktor : mod_aktor.typ_aktor;}> { let felder : Array<{stelle : mod_stelle.typ_stelle; aktor : mod_aktor.typ_aktor;}> = []; lib_hashmap.iterieren @@ -69,7 +73,12 @@ module mod_vtm /** * @author kcf */ - export function feld_holen(welt : typ_welt, stelle : mod_stelle.typ_stelle) : lib_fehlermonade.typ_fehlermonade + export function feld_holen + ( + welt : typ_welt, + stelle : mod_stelle.typ_stelle + ) + : lib_fehlermonade.typ_fehlermonade { return lib_hashmap.holen(welt.felder, stelle); } @@ -78,7 +87,13 @@ module mod_vtm /** * @author kcf */ - export function feld_setzen(welt : typ_welt, stelle : mod_stelle.typ_stelle, aktor : mod_aktor.typ_aktor) : void + export function feld_setzen + ( + welt : typ_welt, + stelle : mod_stelle.typ_stelle, + aktor : mod_aktor.typ_aktor + ) + : void { lib_hashmap.setzen(welt.felder, stelle, aktor); } @@ -87,7 +102,13 @@ module mod_vtm /** * @author kcf */ - export function feld_wechseln(welt : typ_welt, stelle : mod_stelle.typ_stelle, umgekehrt : boolean = false) : void + export function feld_wechseln + ( + welt : typ_welt, + stelle : mod_stelle.typ_stelle, + umgekehrt : boolean = false + ) + : void { let erweitert : boolean = true; let liste : Array<{pruefer : (aktor : mod_aktor.typ_aktor)=>boolean; ersteller : ()=>mod_aktor.typ_aktor;}> = ( @@ -168,7 +189,7 @@ module mod_vtm ); let index_alt : lib_fehlermonade.typ_fehlermonade; let aktor_alt_ : lib_fehlermonade.typ_fehlermonade = lib_hashmap.holen(welt.felder, stelle); - if (lib_fehlermonade.voll(aktor_alt_)) + if (lib_fehlermonade.voll(aktor_alt_)) { let aktor_alt : mod_aktor.typ_aktor = lib_fehlermonade.lesen(aktor_alt_); let gefunden : boolean = ( @@ -178,7 +199,7 @@ module mod_vtm { if (eintrag.pruefer(aktor_alt)) { - index_alt = (lib_fehlermonade.mod_schlicht.erstellen(index)); + index_alt = (lib_fehlermonade.erstellen_schlicht(index)); return true; } else @@ -190,7 +211,7 @@ module mod_vtm ); if (! gefunden) { - index_alt = (lib_fehlermonade.mod_nichts.erstellen()); + index_alt = (lib_fehlermonade.erstellen_nichts()); } else { @@ -201,11 +222,11 @@ module mod_vtm { let meldung : string = "kein Aktor gesetzt"; // console.warn(meldung); - index_alt = (lib_fehlermonade.mod_schlicht.erstellen(0)); + index_alt = (lib_fehlermonade.erstellen_schlicht(0)); } - if (lib_fehlermonade.voll(index_alt)) + if (lib_fehlermonade.voll(index_alt)) { - let index_neu : int = lib_mathematik.mod(lib_fehlermonade.lesen(index_alt) + (umgekehrt ? -1 : +1), liste.length); + let index_neu : int = lib_mathematik.mod(lib_fehlermonade.lesen(index_alt) + (umgekehrt ? -1 : +1), liste.length); let aktor_neu : mod_aktor.typ_aktor = liste[index_neu].ersteller(); feld_setzen(welt, stelle, aktor_neu); } @@ -221,12 +242,18 @@ module mod_vtm /** * @author kcf */ - export function feld_drehen(welt : typ_welt, stelle : mod_stelle.typ_stelle, inkrement : int = +1) : void + export function feld_drehen + ( + welt : typ_welt, + stelle : mod_stelle.typ_stelle, + inkrement : int = +1 + ) + : void { let aktor_ : lib_fehlermonade.typ_fehlermonade = lib_hashmap.holen(welt.felder, stelle); - if (lib_fehlermonade.voll(aktor_)) + if (lib_fehlermonade.voll(aktor_)) { - mod_aktor.drehen(lib_fehlermonade.lesen(aktor_), inkrement); + mod_aktor.drehen(lib_fehlermonade.lesen(aktor_), inkrement); } else { @@ -239,9 +266,13 @@ module mod_vtm * @author kcf * @throws {Error} */ - export function erzeuger_finden(welt : typ_welt) : mod_stelle.typ_stelle + export function erzeuger_finden + ( + welt : typ_welt + ) + : mod_stelle.typ_stelle { - let stelle : lib_fehlermonade.typ_fehlermonade = (lib_fehlermonade.mod_nichts.erstellen()); + let stelle : lib_fehlermonade.typ_fehlermonade = (lib_fehlermonade.erstellen_nichts()); lib_hashmap.iterieren ( welt.felder, @@ -249,22 +280,22 @@ module mod_vtm { if (aktor.art === "erzeuger") { - if (lib_fehlermonade.voll(stelle)) + if (lib_fehlermonade.voll(stelle)) { let meldung : string = "mehrere Erzeuger gefunden"; throw (new Error(meldung)); } else { - stelle = (lib_fehlermonade.mod_schlicht.erstellen(stelle_)); + stelle = (lib_fehlermonade.erstellen_schlicht(stelle_)); } } } ) ; - if (lib_fehlermonade.voll(stelle)) + if (lib_fehlermonade.voll(stelle)) { - return lib_fehlermonade.lesen(stelle); + return lib_fehlermonade.lesen(stelle); } else { @@ -277,7 +308,11 @@ module mod_vtm /** * @author kcf */ - export function blanko(groesse : int = 3) : typ_welt + export function blanko + ( + groesse : int = 3 + ) + : typ_welt { let welt : typ_welt = erstellen(); for (let u : int = -groesse; u <= +groesse; u += 1) @@ -311,7 +346,11 @@ module mod_vtm /** * @author kcf */ - export function exportieren(welt : typ_welt) : any + export function exportieren + ( + welt : typ_welt + ) + : any { let roh : any = {}; roh["felder"] = {}; @@ -333,7 +372,11 @@ module mod_vtm /** * @author kcf */ - export function importieren(roh : any) : typ_welt + export function importieren + ( + roh : any + ) + : typ_welt { let felder : lib_hashmap.typ_hashmap = (lib_hashmap.erstellen(mod_stelle.hash)); for (let stelle_ in roh["felder"]) diff --git a/quelldatein/daten.ts b/quelldatein/daten.ts index 498b9a9..42a644a 100644 --- a/quelldatein/daten.ts +++ b/quelldatein/daten.ts @@ -44,11 +44,11 @@ module mod_vtm { if (schluessel in _speicher) { - return (lib_fehlermonade.mod_schlicht.erstellen(_speicher[schluessel])); + return (lib_fehlermonade.erstellen_schlicht(_speicher[schluessel])); } else { - return (lib_fehlermonade.mod_nichts.erstellen()); + return (lib_fehlermonade.erstellen_nichts()); } } diff --git a/quelldatein/haupt.ts b/quelldatein/haupt.ts index e53cf46..e194b73 100644 --- a/quelldatein/haupt.ts +++ b/quelldatein/haupt.ts @@ -153,7 +153,7 @@ module mod_vtm mod_aufbau.mod_stelle.null_() ) ); - let xmlknoten : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( + let xmlknoten : lib_xml.typ_knoten = ( mod_manifestation.mod_svg.wurzel ( von_x, von_y, @@ -162,7 +162,7 @@ module mod_vtm [mod_manifestation.darstellen(manifestation)] ) ); - eintrag.bereich.querySelector(".hilfe_aktoren_aktor_bild").innerHTML = mod_vtm.mod_helfer.mod_xml.darstellen(xmlknoten); + eintrag.bereich.querySelector(".hilfe_aktoren_aktor_bild").innerHTML = lib_xml.darstellen(xmlknoten); } ) ; diff --git a/quelldatein/helfer/fehlermonade.ts b/quelldatein/helfer/fehlermonade.ts new file mode 100644 index 0000000..fae04f0 --- /dev/null +++ b/quelldatein/helfer/fehlermonade.ts @@ -0,0 +1,135 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +module lib_fehlermonade + { + + /** + * @author kcf + */ + export type typ_fehlermonade = lib_aufruf.typ_komplex; + + + /** + * @author kcf + */ + export function erstellen_nichts + ( + ) + : typ_fehlermonade + { + return ( + lib_aufruf.einpacken + ( + "nichts", + { + } + ) + ); + } + + + /** + * @author kcf + */ + export function erstellen_schlicht + ( + wert : typ_wert + ) + : typ_fehlermonade + { + return ( + lib_aufruf.einpacken + ( + "schlicht", + { + "wert": wert + } + ) + ); + } + + + /** + * @author kcf + */ + export function voll + ( + fehlermonade : typ_fehlermonade + ) + : boolean + { + return ( + lib_aufruf.fallunterscheidung + ( + fehlermonade, + { + "nichts": ({}) => false, + "schlicht": ({"wert": wert}) => true, + } + ) + ); + } + + + /** + * @author kcf + */ + export function lesen + ( + fehlermonade : typ_fehlermonade + ) + : typ_wert + { + return ( + lib_aufruf.fallunterscheidung + ( + fehlermonade, + { + "nichts": ({}) => {throw (new Error("lesen von nichts"));}, + "schlicht": ({"wert": wert}) => wert, + } + ) + ); + } + + + /** + * @author kcf + */ + export function fortfuehren + ( + fehlermonade : typ_fehlermonade, + funktion : (wert1 : typ_wert1)=>typ_fehlermonade + ) + : typ_fehlermonade + { + return ( + lib_aufruf.fallunterscheidung + ( + fehlermonade, + { + "nichts": ({}) => erstellen_nichts(), + "schlicht": ({"wert": wert1}) => funktion(wert1), + } + ) + ); + } + + } + diff --git a/quelldatein/helfer/fehlermonade/_fehlermonade.ts b/quelldatein/helfer/fehlermonade/_fehlermonade.ts deleted file mode 100644 index 3b95ff4..0000000 --- a/quelldatein/helfer/fehlermonade/_fehlermonade.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module lib_fehlermonade - { - - /** - * @author kcf - */ - export type typ_fehlermonade = lib_aufruf.typ_komplex; - - - /** - * @author kcf - */ - export type signatur_fehlermonade = - { - voll : (fehlermonade : typ_fehlermonade)=>boolean; - lesen : (fehlermonade : typ_fehlermonade)=>typ_wert; - } - ; - - - /** - * @author kcf - */ - export var brauch_fehlermonade : lib_brauch.typ_brauch> = lib_brauch.erstellen>(); - - - /** - * @author kcf - */ - export function voll(fehlermonade : typ_fehlermonade) : boolean - { - return lib_brauch.anwenden(brauch_fehlermonade, fehlermonade.art)["voll"](fehlermonade); - } - - - /** - * @author kcf - */ - export function lesen(fehlermonade : typ_fehlermonade) : typ_wert - { - return lib_brauch.anwenden(brauch_fehlermonade, fehlermonade.art)["lesen"](fehlermonade); - } - - } - diff --git a/quelldatein/helfer/fehlermonade/nichts.ts b/quelldatein/helfer/fehlermonade/nichts.ts deleted file mode 100644 index adc11e9..0000000 --- a/quelldatein/helfer/fehlermonade/nichts.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module lib_fehlermonade - { - - export module mod_nichts - { - - /** - * @author kcf - */ - export function erstellen() : typ_fehlermonade - { - return lib_aufruf.einpacken("nichts", {}); - } - - - /** - * @author kcf - */ - lib_brauch.umsetzen> - ( - brauch_fehlermonade, - "nichts", - { - "voll": (fehlermonade) => false, - "lesen": (fehlermonade) => {throw (new Error("lesen von nichts"));}, - } - ) - ; - - } - - } - diff --git a/quelldatein/helfer/fehlermonade/schlicht.ts b/quelldatein/helfer/fehlermonade/schlicht.ts deleted file mode 100644 index e91db4e..0000000 --- a/quelldatein/helfer/fehlermonade/schlicht.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module lib_fehlermonade - { - - export module mod_schlicht - { - - /** - * @author kcf - */ - export function erstellen(wert : typ_wert) : typ_fehlermonade - { - return lib_aufruf.einpacken("schlicht", {"wert": wert}); - } - - - /** - * @author kcf - */ - lib_brauch.umsetzen> - ( - brauch_fehlermonade, - "schlicht", - { - "voll": (fehlermonade) => true, - "lesen": (fehlermonade) => lib_aufruf.auspacken(fehlermonade).wert, - } - ) - ; - - } - - } - diff --git a/quelldatein/helfer/hashmap.ts b/quelldatein/helfer/hashmap.ts index c987a39..f3000da 100644 --- a/quelldatein/helfer/hashmap.ts +++ b/quelldatein/helfer/hashmap.ts @@ -76,11 +76,11 @@ module lib_hashmap if (hashwert in hashmap.speicher) { let wert : typ_wert = hashmap.speicher[hashwert].wert; - return (lib_fehlermonade.mod_schlicht.erstellen(wert)); + return (lib_fehlermonade.erstellen_schlicht(wert)); } else { - return (lib_fehlermonade.mod_nichts.erstellen()); + return (lib_fehlermonade.erstellen_nichts()); } } diff --git a/quelldatein/helfer/uebersetzung.ts b/quelldatein/helfer/uebersetzung.ts index d1bbfcf..baf7dde 100644 --- a/quelldatein/helfer/uebersetzung.ts +++ b/quelldatein/helfer/uebersetzung.ts @@ -74,20 +74,20 @@ module lib_uebersetzung let satz : {[schluessel : string] : string} = _daten[sprache]; if (schluessel in satz) { - return (lib_fehlermonade.mod_schlicht.erstellen(satz[schluessel])); + return (lib_fehlermonade.erstellen_schlicht(satz[schluessel])); } else { let meldung : string = ("keine Zeichenketten für Schlüssel '" + schluessel + "' in Sprache '" + sprache + "'"); console.warn(meldung); - return (lib_fehlermonade.mod_nichts.erstellen()); + return (lib_fehlermonade.erstellen_nichts()); } } else { let meldung : string = ("keine Zeichenketten für Sprache '" + sprache + "'"); console.warn(meldung); - return (lib_fehlermonade.mod_nichts.erstellen()); + return (lib_fehlermonade.erstellen_nichts()); } } @@ -97,7 +97,7 @@ module lib_uebersetzung */ export function holen(schluessel : string, vars : {[name : string] : string} = {}) : string { - let ergebnis : lib_fehlermonade.typ_fehlermonade = (lib_fehlermonade.mod_nichts.erstellen()); + let ergebnis : lib_fehlermonade.typ_fehlermonade = (lib_fehlermonade.erstellen_nichts()); let gefunden : boolean = ( _sprachstapel .some diff --git a/quelldatein/helfer/xml.ts b/quelldatein/helfer/xml.ts new file mode 100644 index 0000000..31d82f4 --- /dev/null +++ b/quelldatein/helfer/xml.ts @@ -0,0 +1,156 @@ +/* + * Verrückte Turing-Maschinen — A turing complete game + * Copyright (C) 2016 Christian Fraß + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +module lib_xml + { + + /** + * @author kcf + */ + function einrueckung + ( + tiefe : int, + zeichen : string = "\t" + ) + : string + { + return ( + (tiefe === 0) + ? "" + : (zeichen + einrueckung(tiefe-1)) + ); + } + + + /** + * @author kcf + */ + export type typ_knoten = lib_aufruf.typ_komplex; + + + /** + * @author kcf + */ + export function erstellen_text + ( + inhalt : string + ) + : typ_knoten + { + return ( + lib_aufruf.einpacken + ( + "text", + { + "inhalt": inhalt + } + ) + ); + } + + + /** + * @author kcf + */ + export function erstellen_normal + ( + name : string, + attribute : {[schluessel : string] : string} = {}, + kinder : Array = [] + ) + : typ_knoten + { + return ( + lib_aufruf.einpacken + ( + "normal", + { + "name": name, + "attribute": attribute, + "kinder": kinder + } + ) + ); + } + + + /** + * @author kcf + */ + export function darstellen + ( + knoten : typ_knoten, + tiefe : int = 0 + ) + : string + { + return ( + lib_aufruf.fallunterscheidung + ( + knoten, + { + "text": ({"inhalt": inhalt}) => + { + return inhalt; + } + , + "normal": ({"name": name, "attribute": attribute, "kinder": kinder}) => + { + let str : string = ""; + // anfang + { + let str_anfang : string = ""; + str_anfang += name; + // attribute + { + let str_attribute : string = ""; + Object.keys(attribute).forEach + ( + schluessel => + { + let wert : string = attribute[schluessel]; + str_attribute += (" " + schluessel + "=" + ("\"" + wert + "\"")); + } + ) + ; + str_anfang += str_attribute; + } + str_anfang = (einrueckung(tiefe) + "<" + str_anfang + ">" + "\n"); + str += str_anfang; + } + // kinder + { + kinder.forEach(kind => (str += darstellen(kind, tiefe+1))); + } + // ende + { + let str_ende : string = ""; + str_ende += name; + str_ende = (einrueckung(tiefe) + "<" + "/" + str_ende + ">" + "\n"); + str += str_ende; + } + return str; + } + , + } + ) + ); + } + + } + diff --git a/quelldatein/helfer/xmlknoten/_xmlknoten.ts b/quelldatein/helfer/xmlknoten/_xmlknoten.ts deleted file mode 100644 index 83cfd41..0000000 --- a/quelldatein/helfer/xmlknoten/_xmlknoten.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module mod_vtm - { - - export module mod_helfer - { - - export module mod_xml - { - - /** - * @author kcf - */ - export type typ_knoten = lib_aufruf.typ_komplex; - - - /** - * @author kcf - */ - export type signatur_knoten = - { - darstellen : (knoten : typ_knoten, tiefe : int)=>string; - } - ; - - - /** - * @author kcf - */ - export var brauch_knoten : lib_brauch.typ_brauch = lib_brauch.erstellen(); - - - /** - * @author kcf - */ - export function darstellen(knoten : typ_knoten, tiefe : int = 0) : string - { - return lib_brauch.anwenden(brauch_knoten, knoten.art)["darstellen"](knoten, tiefe); - } - - } - - } - - } - diff --git a/quelldatein/helfer/xmlknoten/normal.ts b/quelldatein/helfer/xmlknoten/normal.ts deleted file mode 100644 index e739a0a..0000000 --- a/quelldatein/helfer/xmlknoten/normal.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module mod_vtm - { - - export module mod_helfer - { - - export module mod_xml - { - - export module mod_normal - { - - /** - * @author kcf - */ - function einrueckung(tiefe : int, zeichen : string = "\t") : string - { - return ((tiefe === 0) ? "" : (zeichen + einrueckung(tiefe-1))); - } - - - /** - * @author kcf - */ - export type typ_normal = - { - name : string; - attribute : {[schluessel : string] : string}; - kinder : Array; - } - ; - - - /** - * @author kcf - */ - function erstellen - ( - name : string, - attribute : {[schluessel : string] : string} = {}, - kinder : Array = [] - ) - : typ_normal - { - return { - "name": name, - "attribute": attribute, - "kinder": kinder - }; - } - - - /** - * @author kcf - */ - export function erstellen_erweitert - ( - name : string, - attribute : {[schluessel : string] : string} = {}, - kinder : Array = [] - ) - : typ_knoten - { - return lib_aufruf.einpacken("normal", erstellen(name, attribute, kinder)); - } - - - /** - * @author kcf - */ - function darstellen - ( - normal : typ_normal, - tiefe : int - ) - : string - { - let str : string = ""; - // anfang - { - let str_anfang : string = ""; - str_anfang += normal.name; - // attribute - { - let str_attribute : string = ""; - Object.keys(normal.attribute).forEach - ( - schluessel => - { - let wert : string = normal.attribute[schluessel]; - str_attribute += (" " + schluessel + "=" + ("\"" + wert + "\"")); - } - ) - ; - str_anfang += str_attribute; - } - str_anfang = (einrueckung(tiefe) + "<" + str_anfang + ">" + "\n"); - str += str_anfang; - } - // kinder - { - normal.kinder.forEach(kind => (str += mod_xml.darstellen(kind, tiefe+1))); - } - // ende - { - let str_ende : string = ""; - str_ende += normal.name; - str_ende = (einrueckung(tiefe) + "<" + "/" + str_ende + ">" + "\n"); - str += str_ende; - } - return str; - } - - - /** - * @author kcf - */ - lib_brauch.umsetzen - ( - brauch_knoten, - "normal", - { - "darstellen": (knoten, tiefe) => darstellen(knoten.angaben, tiefe), - } - ) - ; - - } - - } - - } - - } - diff --git a/quelldatein/helfer/xmlknoten/text.ts b/quelldatein/helfer/xmlknoten/text.ts deleted file mode 100644 index 5ca026d..0000000 --- a/quelldatein/helfer/xmlknoten/text.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Verrückte Turing-Maschinen — A turing complete game - * Copyright (C) 2016 Christian Fraß - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -module mod_vtm - { - - export module mod_helfer - { - - export module mod_xml - { - - export module mod_text - { - - /** - * @author kcf - */ - export type typ_text = - { - inhalt : string - } - ; - - - /** - * @author kcf - */ - function erstellen - ( - inhalt : string - ) - : typ_text - { - return { - "inhalt": inhalt - }; - } - - - /** - * @author kcf - */ - export function erstellen_erweitert - ( - inhalt : string - ) - : typ_knoten - { - return lib_aufruf.einpacken("text", erstellen(inhalt)); - } - - - /** - * @author kcf - */ - function darstellen - ( - knoten : typ_text, - tiefe : int - ) - : string - { - return knoten.inhalt; - } - - - /** - * @author kcf - */ - lib_brauch.umsetzen - ( - brauch_knoten, - "text", - { - "darstellen": (knoten, tiefe) => darstellen(knoten.angaben, tiefe), - } - ) - ; - - } - - } - - } - - } - diff --git a/quelldatein/manifestation/svg/aktor.ts b/quelldatein/manifestation/svg/aktor.ts index f8d3e6f..11830d1 100644 --- a/quelldatein/manifestation/svg/aktor.ts +++ b/quelldatein/manifestation/svg/aktor.ts @@ -76,10 +76,10 @@ module mod_vtm /** * @author kcf */ - function darstellen(aktor_ : typ_aktor) : mod_vtm.mod_helfer.mod_xml.typ_knoten + function darstellen(aktor_ : typ_aktor) : lib_xml.typ_knoten { let aktor : mod_vtm.mod_aufbau.mod_aktor.typ_aktor = aktor_.aufbau; - let knoten_rahmen = function () : mod_vtm.mod_helfer.mod_xml.typ_knoten + let knoten_rahmen = function () : lib_xml.typ_knoten { return ( pfad @@ -93,7 +93,7 @@ module mod_vtm ); } ; - let kinder_feld : Array = []; + let kinder_feld : Array = []; lib_aufruf.fallunterscheidung ( aktor, @@ -102,8 +102,8 @@ module mod_vtm { kinder_feld.push(knoten_rahmen()); let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor.mod_erzeuger.richtung_lesen(angaben); - let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_pfeil : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "path", { @@ -131,8 +131,8 @@ module mod_vtm { kinder_feld.push(knoten_rahmen()); let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor.mod_befoerderer.richtung_lesen(angaben); - let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_pfeil : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "path", { @@ -161,8 +161,8 @@ module mod_vtm kinder_feld.push(knoten_rahmen()); let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor.mod_schreiber.richtung_lesen(angaben); let symbol : mod_vtm.mod_aufbau.mod_symbol.typ_symbol = mod_vtm.mod_aufbau.mod_aktor.mod_schreiber.symbol_lesen(angaben); - let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_pfeil : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "path", { @@ -196,15 +196,15 @@ module mod_vtm [ { "summand": 0, - "symbol": lib_fehlermonade.mod_nichts.erstellen(), + "symbol": lib_fehlermonade.erstellen_nichts(), }, { "summand": +2, - "symbol": lib_fehlermonade.mod_schlicht.erstellen(symbol_links), + "symbol": lib_fehlermonade.erstellen_schlicht(symbol_links), }, { "summand": -2, - "symbol": lib_fehlermonade.mod_schlicht.erstellen(symbol_rechts), + "symbol": lib_fehlermonade.erstellen_schlicht(symbol_rechts), }, ] ; @@ -213,8 +213,8 @@ module mod_vtm eintrag => { let winkel : float = ((mod_vtm.mod_aufbau.mod_richtung.addieren(richtung, eintrag.summand) / 6) * 360); - let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_pfeil : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "path", { @@ -223,8 +223,8 @@ module mod_vtm [ "pfeil", ( - lib_fehlermonade.voll(eintrag.symbol) - ? "symbol_" + lib_fehlermonade.lesen(eintrag.symbol).toFixed(0) + lib_fehlermonade.voll(eintrag.symbol) + ? "symbol_" + lib_fehlermonade.lesen(eintrag.symbol).toFixed(0) : "neutral" ), ].join(" ") @@ -249,8 +249,8 @@ module mod_vtm "verwerfer": (angaben) => { kinder_feld.push(knoten_rahmen()); - let knoten_kreis : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_kreis : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "circle", { @@ -272,8 +272,8 @@ module mod_vtm "annehmer": (angaben) => { kinder_feld.push(knoten_rahmen()); - let knoten_kreis : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_kreis : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "circle", { @@ -296,8 +296,8 @@ module mod_vtm ) ; let position : mod_position.typ_position = mod_position.von_stelle(aktor_.stelle); - let knoten_feld : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_feld : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "g", { diff --git a/quelldatein/manifestation/svg/figur.ts b/quelldatein/manifestation/svg/figur.ts index 7f287d1..b13e0c8 100644 --- a/quelldatein/manifestation/svg/figur.ts +++ b/quelldatein/manifestation/svg/figur.ts @@ -76,14 +76,14 @@ module mod_vtm ( figur_ : typ_figur ) - : mod_vtm.mod_helfer.mod_xml.typ_knoten + : lib_xml.typ_knoten { let figur : mod_vtm.mod_aufbau.mod_figur.typ_figur = figur_.aufbau; - let kinder_figur : Array = []; + let kinder_figur : Array = []; // Stein { - let knoten_stein : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_stein : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "circle", { @@ -99,7 +99,7 @@ module mod_vtm // Band { let band : Array = mod_vtm.mod_aufbau.mod_figur.band_lesen(figur); - let kinder_band : Array = []; + let kinder_band : Array = []; band.forEach ( (symbol, index) => @@ -107,8 +107,8 @@ module mod_vtm let r : float = 0.06125; let x : float = (+0.1+(2*r*1.25)*index); let y : float = (-0.1); - let knoten_eintrag : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_eintrag : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "circle", { @@ -135,7 +135,7 @@ module mod_vtm ) ; let knoten_band = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + lib_xml.erstellen_normal ( "g", { @@ -148,7 +148,7 @@ module mod_vtm } let position : mod_position.typ_position = mod_position.von_stelle(mod_vtm.mod_aufbau.mod_figur.stelle_lesen(figur)); let knoten_figur = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + lib_xml.erstellen_normal ( "g", { diff --git a/quelldatein/manifestation/svg/partie.ts b/quelldatein/manifestation/svg/partie.ts index 2df4a2d..f7e6b99 100644 --- a/quelldatein/manifestation/svg/partie.ts +++ b/quelldatein/manifestation/svg/partie.ts @@ -64,27 +64,27 @@ module mod_vtm /** * @author kcf */ - function darstellen(partie : typ_partie) : mod_vtm.mod_helfer.mod_xml.typ_knoten + function darstellen(partie : typ_partie) : lib_xml.typ_knoten { - let kinder_partie : Array = []; + let kinder_partie : Array = []; // Welt { - let kinder_welt : Array = []; + let kinder_welt : Array = []; // Felder { - let kinder_felder : Array = []; + let kinder_felder : Array = []; mod_vtm.mod_aufbau.mod_welt.felder_lesen(mod_vtm.mod_aufbau.mod_partie.welt_lesen(partie.aufbau)).forEach ( ({"stelle": stelle, "aktor": aktor}) => { let manifestation_feld : typ_manifestation = mod_aktor.erstellen_manifestation(aktor, stelle); - let knoten_feld : mod_vtm.mod_helfer.mod_xml.typ_knoten = mod_manifestation.darstellen(manifestation_feld); + let knoten_feld : lib_xml.typ_knoten = mod_manifestation.darstellen(manifestation_feld); kinder_felder.push(knoten_feld); } ) ; - let knoten_felder : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_felder : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "g", { @@ -96,8 +96,8 @@ module mod_vtm ); kinder_welt.push(knoten_felder); } - let knoten_welt : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_welt : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "g", { @@ -115,7 +115,7 @@ module mod_vtm { let figur : mod_vtm.mod_aufbau.mod_figur.typ_figur = lib_fehlermonade.lesen(figur_); let manifestation_figur : typ_manifestation = mod_figur.erstellen_manifestation(figur); - let knoten_figur : mod_vtm.mod_helfer.mod_xml.typ_knoten = mod_manifestation.darstellen(manifestation_figur); + let knoten_figur : lib_xml.typ_knoten = mod_manifestation.darstellen(manifestation_figur); kinder_partie.push(knoten_figur); } else @@ -123,8 +123,8 @@ module mod_vtm // nichts tun } } - let knoten_partie : mod_vtm.mod_helfer.mod_xml.typ_knoten = ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + let knoten_partie : lib_xml.typ_knoten = ( + lib_xml.erstellen_normal ( "g", { diff --git a/quelldatein/manifestation/svg/svg.ts b/quelldatein/manifestation/svg/svg.ts index e20ec9e..3d02fea 100644 --- a/quelldatein/manifestation/svg/svg.ts +++ b/quelldatein/manifestation/svg/svg.ts @@ -46,7 +46,7 @@ module mod_vtm schliessen : boolean = true, attribute : {[schlussel : string] : string} = {}, ) - : mod_vtm.mod_helfer.mod_xml.typ_knoten + : lib_xml.typ_knoten { let d : string = ""; vertices.forEach @@ -63,7 +63,7 @@ module mod_vtm if (schliessen) d += "Z"; attribute["d"] = d; - return (mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert("path", attribute)); + return (lib_xml.erstellen_normal("path", attribute)); } @@ -78,12 +78,12 @@ module mod_vtm bis_y : float, hoehe : int = 500, breite : int = 500, - kinder : Array = [] + kinder : Array = [] ) - : mod_vtm.mod_helfer.mod_xml.typ_knoten + : lib_xml.typ_knoten { return ( - mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert + lib_xml.erstellen_normal ( "svg", { diff --git a/quelldatein/manifestation/web/partie.ts b/quelldatein/manifestation/web/partie.ts index 9afe65b..92abb0f 100644 --- a/quelldatein/manifestation/web/partie.ts +++ b/quelldatein/manifestation/web/partie.ts @@ -63,7 +63,7 @@ module mod_vtm return { "aufbau": aufbau, "bereich": bereich, - "intervall": (lib_fehlermonade.mod_nichts.erstellen()), + "intervall": (lib_fehlermonade.erstellen_nichts()), }; } @@ -107,7 +107,7 @@ module mod_vtm */ function erneuern_welt(partie : typ_partie) : void { - let knoten_svg : mod_vtm.mod_helfer.mod_xml.typ_knoten = mod_svg.wurzel + let knoten_svg : lib_xml.typ_knoten = mod_svg.wurzel ( -4, -4, +4, +4, @@ -115,7 +115,7 @@ module mod_vtm [mod_manifestation.darstellen(mod_svg.mod_partie.erstellen_manifestation(partie.aufbau))] ) ; - partie.bereich.innerHTML = mod_vtm.mod_helfer.mod_xml.darstellen(knoten_svg); + partie.bereich.innerHTML = lib_xml.darstellen(knoten_svg); } @@ -124,7 +124,7 @@ module mod_vtm */ function erneuern_figur(partie : typ_partie) : void { - let knoten_svg : mod_vtm.mod_helfer.mod_xml.typ_knoten = mod_svg.wurzel + let knoten_svg : lib_xml.typ_knoten = mod_svg.wurzel ( -4, -4, +4, +4, @@ -132,7 +132,7 @@ module mod_vtm [mod_manifestation.darstellen(mod_svg.mod_partie.erstellen_manifestation(partie.aufbau))] ) ; - partie.bereich.innerHTML = mod_vtm.mod_helfer.mod_xml.darstellen(knoten_svg); + partie.bereich.innerHTML = lib_xml.darstellen(knoten_svg); } @@ -192,7 +192,7 @@ module mod_vtm case mod_vtm.mod_aufbau.mod_modus.ungewiss: { klasse = ( - lib_fehlermonade.lesen(partie.intervall) + lib_fehlermonade.voll(partie.intervall) ? "ungewiss_laufend" : "ungewiss_stehend" ); @@ -235,7 +235,7 @@ module mod_vtm if (lib_fehlermonade.voll(partie.intervall)) { clearInterval(lib_fehlermonade.lesen(partie.intervall)); - partie.intervall = (lib_fehlermonade.mod_nichts.erstellen()); + partie.intervall = (lib_fehlermonade.erstellen_nichts()); } else { @@ -271,7 +271,7 @@ module mod_vtm function testen(partie : typ_partie) : void { let handle : any = setInterval(() => fortfahren(partie), 500); - partie.intervall = (lib_fehlermonade.mod_schlicht.erstellen(handle)); + partie.intervall = (lib_fehlermonade.erstellen_schlicht(handle)); } @@ -306,12 +306,12 @@ module mod_vtm let dom_feld : Element = target["closest"](".feld"); if (dom_feld == null) { - stelle = (lib_fehlermonade.mod_nichts.erstellen()); + stelle = (lib_fehlermonade.erstellen_nichts()); } else { let rel : string = dom_feld.getAttribute("rel") - stelle = (lib_fehlermonade.mod_schlicht.erstellen(mod_vtm.mod_aufbau.mod_stelle.von_hash(rel))); + stelle = (lib_fehlermonade.erstellen_schlicht(mod_vtm.mod_aufbau.mod_stelle.von_hash(rel))); } return stelle; } diff --git a/werkzeuge/anpassen.sed b/werkzeuge/anpassen.sed deleted file mode 100644 index cbbcd7f..0000000 --- a/werkzeuge/anpassen.sed +++ /dev/null @@ -1,7 +0,0 @@ -s:mod_aktor_annehmer:mod_aktor.mod_annehmer:g -s:mod_aktor_verwerfer:mod_aktor.mod_verwerfer:g -s:mod_aktor_erzeuger:mod_aktor.mod_erzeuger:g -s:mod_aktor_schreiber:mod_aktor.mod_schreiber:g -s:mod_aktor_leser:mod_aktor.mod_leser:g -s:mod_aktor_befoerderer:mod_aktor.mod_befoerderer:g -