save
This commit is contained in:
parent
dac259a252
commit
c5282e424c
1
makefile
1
makefile
|
|
@ -45,6 +45,7 @@ ${dir_erzeugnis}/vtm.dat.js: \
|
||||||
${dir_erzeugnis}/vtm.js: \
|
${dir_erzeugnis}/vtm.js: \
|
||||||
${dir_quelldatein}/helfer/typen.ts \
|
${dir_quelldatein}/helfer/typen.ts \
|
||||||
${dir_quelldatein}/helfer/aufruf.ts \
|
${dir_quelldatein}/helfer/aufruf.ts \
|
||||||
|
${dir_quelldatein}/helfer/brauch.ts \
|
||||||
${dir_quelldatein}/helfer/fehlermonade/_fehlermonade.ts \
|
${dir_quelldatein}/helfer/fehlermonade/_fehlermonade.ts \
|
||||||
${dir_quelldatein}/helfer/fehlermonade/nichts.ts \
|
${dir_quelldatein}/helfer/fehlermonade/nichts.ts \
|
||||||
${dir_quelldatein}/helfer/fehlermonade/schlicht.ts \
|
${dir_quelldatein}/helfer/fehlermonade/schlicht.ts \
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_aktor = typ_komplex<any>;
|
export type typ_aktor = lib_aufruf.typ_komplex<any>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type schnittstelle_aktor =
|
export type signatur_aktor =
|
||||||
{
|
{
|
||||||
beispiel : ()=>typ_aktor;
|
beispiel : ()=>typ_aktor;
|
||||||
drehen : (aktor : typ_aktor, inkrement : int)=>void;
|
drehen : (aktor : typ_aktor, inkrement : int)=>void;
|
||||||
|
|
@ -48,7 +48,7 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export var implementierung_aktor : {[art : string] : schnittstelle_aktor} = {};
|
export var brauch_aktor : lib_brauch.typ_brauch<signatur_aktor> = lib_brauch.erstellen<signatur_aktor>();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,7 +57,7 @@ module mod_vtm
|
||||||
/*
|
/*
|
||||||
export function erstellen(art : string, kern : any) : typ_aktor
|
export function erstellen(art : string, kern : any) : typ_aktor
|
||||||
{
|
{
|
||||||
return einpacken(art, kern);
|
return lib_aufruf.einpacken(art, kern);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function beispiel(art : string) : typ_aktor
|
export function beispiel(art : string) : typ_aktor
|
||||||
{
|
{
|
||||||
return implementierung_aktor[art].beispiel();
|
return lib_brauch.anwenden(brauch_aktor, art)["beispiel"]();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function drehen(aktor : typ_aktor, inkrement ?: int) : void
|
export function drehen(aktor : typ_aktor, inkrement ?: int) : void
|
||||||
{
|
{
|
||||||
return implementierung_aktor[aktor.art].drehen(aktor, inkrement);
|
return lib_brauch.anwenden(brauch_aktor, aktor.art)["drehen"](aktor, inkrement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function verwenden(aktor : typ_aktor, figur : mod_figur.typ_figur) : void
|
export function verwenden(aktor : typ_aktor, figur : mod_figur.typ_figur) : void
|
||||||
{
|
{
|
||||||
return implementierung_aktor[aktor.art].verwenden(aktor, figur);
|
return lib_brauch.anwenden(brauch_aktor, aktor.art)["verwenden"](aktor, figur);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function exportieren(aktor : typ_aktor) : any
|
export function exportieren(aktor : typ_aktor) : any
|
||||||
{
|
{
|
||||||
return implementierung_aktor[aktor.art].exportieren(aktor);
|
return lib_brauch.anwenden(brauch_aktor, aktor.art)["exportieren"](aktor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function importieren(roh : any) : typ_aktor
|
export function importieren(roh : any) : typ_aktor
|
||||||
{
|
{
|
||||||
return implementierung_aktor[roh.art].importieren(roh);
|
return lib_brauch.anwenden(brauch_aktor, roh.art)["importieren"](roh);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,131 +22,140 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_annehmer
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_annehmer
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "annehmer";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_annehmer =
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
let art : string = "annehmer";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_annehmer =
|
||||||
|
{
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_annehmer
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_annehmer
|
||||||
|
{
|
||||||
|
return erstellen();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
annehmer : typ_annehmer,
|
||||||
|
inkrement ?: int
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
annehmer : typ_annehmer,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
mod_figur.annehmen(figur);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
annehmer : typ_annehmer
|
||||||
|
)
|
||||||
|
: any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
roh : any
|
||||||
|
)
|
||||||
|
: typ_annehmer
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function erstellen
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_annehmer
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_annehmer
|
|
||||||
{
|
|
||||||
return erstellen();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
annehmer : typ_annehmer,
|
|
||||||
inkrement ?: int
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
annehmer : typ_annehmer,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
mod_figur.annehmen(figur);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
annehmer : typ_annehmer
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
roh : any
|
|
||||||
)
|
|
||||||
: typ_annehmer
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor[art] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,151 +22,160 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_befoerderer
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_befoerderer
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "befoerderer";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_befoerderer =
|
|
||||||
{
|
{
|
||||||
richtung : mod_richtung.typ_richtung;
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
let art : string = "befoerderer";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_befoerderer =
|
||||||
|
{
|
||||||
|
richtung : mod_richtung.typ_richtung;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung
|
||||||
|
)
|
||||||
|
: typ_befoerderer
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": richtung,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen(richtung));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_befoerderer
|
||||||
|
{
|
||||||
|
return erstellen(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function richtung_lesen
|
||||||
|
(
|
||||||
|
befoerderer : typ_befoerderer
|
||||||
|
)
|
||||||
|
: mod_richtung.typ_richtung
|
||||||
|
{
|
||||||
|
return befoerderer.richtung;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
befoerderer : typ_befoerderer,
|
||||||
|
inkrement : int = +1
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
befoerderer.richtung = mod_richtung.addieren(befoerderer.richtung, inkrement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
befoerderer : typ_befoerderer,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
mod_figur.bewegen(figur, befoerderer.richtung);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
befoerderer : typ_befoerderer
|
||||||
|
)
|
||||||
|
: any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": mod_richtung.exportieren(befoerderer.richtung),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
befoerderer_ : any
|
||||||
|
)
|
||||||
|
: typ_befoerderer
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
mod_richtung.importieren(befoerderer_["richtung"])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function erstellen
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung
|
|
||||||
)
|
|
||||||
: typ_befoerderer
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": richtung,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen(richtung));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_befoerderer
|
|
||||||
{
|
|
||||||
return erstellen(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function richtung_lesen
|
|
||||||
(
|
|
||||||
befoerderer : typ_befoerderer
|
|
||||||
)
|
|
||||||
: mod_richtung.typ_richtung
|
|
||||||
{
|
|
||||||
return befoerderer.richtung;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
befoerderer : typ_befoerderer,
|
|
||||||
inkrement : int = +1
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
befoerderer.richtung = mod_richtung.addieren(befoerderer.richtung, inkrement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
befoerderer : typ_befoerderer,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
mod_figur.bewegen(figur, befoerderer.richtung);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
befoerderer : typ_befoerderer
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": mod_richtung.exportieren(befoerderer.richtung),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
befoerderer_ : any
|
|
||||||
)
|
|
||||||
: typ_befoerderer
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
mod_richtung.importieren(befoerderer_["richtung"])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor[art] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,151 +22,160 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_erzeuger
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_erzeuger
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "erzeuger";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_erzeuger =
|
|
||||||
{
|
{
|
||||||
richtung : mod_richtung.typ_richtung;
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
let art : string = "erzeuger";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_erzeuger =
|
||||||
|
{
|
||||||
|
richtung : mod_richtung.typ_richtung;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung
|
||||||
|
)
|
||||||
|
: typ_erzeuger
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": richtung,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen(richtung));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_erzeuger
|
||||||
|
{
|
||||||
|
return erstellen(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function richtung_lesen
|
||||||
|
(
|
||||||
|
erzeuger : typ_erzeuger
|
||||||
|
)
|
||||||
|
: mod_richtung.typ_richtung
|
||||||
|
{
|
||||||
|
return erzeuger.richtung;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
erzeuger : typ_erzeuger,
|
||||||
|
inkrement : int = +1
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
erzeuger.richtung = mod_richtung.addieren(erzeuger.richtung, inkrement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
erzeuger : typ_erzeuger,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
mod_figur.bewegen(figur, erzeuger.richtung);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
erzeuger : typ_erzeuger
|
||||||
|
)
|
||||||
|
: any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": mod_richtung.exportieren(erzeuger.richtung),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
roh : any
|
||||||
|
)
|
||||||
|
: typ_erzeuger
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
mod_richtung.importieren(roh["richtung"])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function erstellen
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung
|
|
||||||
)
|
|
||||||
: typ_erzeuger
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": richtung,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen(richtung));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_erzeuger
|
|
||||||
{
|
|
||||||
return erstellen(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function richtung_lesen
|
|
||||||
(
|
|
||||||
erzeuger : typ_erzeuger
|
|
||||||
)
|
|
||||||
: mod_richtung.typ_richtung
|
|
||||||
{
|
|
||||||
return erzeuger.richtung;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
erzeuger : typ_erzeuger,
|
|
||||||
inkrement : int = +1
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
erzeuger.richtung = mod_richtung.addieren(erzeuger.richtung, inkrement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
erzeuger : typ_erzeuger,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
mod_figur.bewegen(figur, erzeuger.richtung);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
erzeuger : typ_erzeuger
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": mod_richtung.exportieren(erzeuger.richtung),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
roh : any
|
|
||||||
)
|
|
||||||
: typ_erzeuger
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
mod_richtung.importieren(roh["richtung"])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor[art] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(auspacken(aktor))}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,215 +22,224 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_leser
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_leser
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "leser";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_leser =
|
|
||||||
{
|
{
|
||||||
"richtung": mod_richtung.typ_richtung,
|
|
||||||
"symbol_links": mod_symbol.typ_symbol,
|
/**
|
||||||
"symbol_rechts": mod_symbol.typ_symbol,
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
}
|
*/
|
||||||
;
|
let art : string = "leser";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
function erstellen
|
export type typ_leser =
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung,
|
|
||||||
symbol_links : mod_symbol.typ_symbol,
|
|
||||||
symbol_rechts : mod_symbol.typ_symbol
|
|
||||||
)
|
|
||||||
: typ_leser
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": richtung,
|
|
||||||
"symbol_links": symbol_links,
|
|
||||||
"symbol_rechts": symbol_rechts,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung,
|
|
||||||
symbol_links : mod_symbol.typ_symbol,
|
|
||||||
symbol_rechts : mod_symbol.typ_symbol
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen(richtung, symbol_links, symbol_rechts));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_leser
|
|
||||||
{
|
|
||||||
return erstellen(0, 0, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function richtung_lesen
|
|
||||||
(
|
|
||||||
leser : typ_leser
|
|
||||||
)
|
|
||||||
: mod_richtung.typ_richtung
|
|
||||||
{
|
|
||||||
return leser.richtung;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function symbol_links_lesen
|
|
||||||
(
|
|
||||||
leser : typ_leser
|
|
||||||
)
|
|
||||||
: mod_symbol.typ_symbol
|
|
||||||
{
|
|
||||||
return leser.symbol_links;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function symbol_rechts_lesen
|
|
||||||
(
|
|
||||||
leser : typ_leser
|
|
||||||
)
|
|
||||||
: mod_symbol.typ_symbol
|
|
||||||
{
|
|
||||||
return leser.symbol_rechts;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
leser : typ_leser,
|
|
||||||
inkrement : int = +1
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
leser.richtung = mod_richtung.addieren(leser.richtung, inkrement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
leser : typ_leser,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
let symbol_ : lib_fehlermonade.typ_fehlermonade<mod_symbol.typ_symbol> = mod_figur.lesen(figur);
|
|
||||||
let summand : mod_richtung.typ_richtung;
|
|
||||||
if (lib_fehlermonade.voll(symbol_))
|
|
||||||
{
|
{
|
||||||
let symbol : mod_symbol.typ_symbol = lib_fehlermonade.lesen(symbol_);
|
"richtung": mod_richtung.typ_richtung,
|
||||||
if (symbol === leser.symbol_links)
|
"symbol_links": mod_symbol.typ_symbol,
|
||||||
|
"symbol_rechts": mod_symbol.typ_symbol,
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung,
|
||||||
|
symbol_links : mod_symbol.typ_symbol,
|
||||||
|
symbol_rechts : mod_symbol.typ_symbol
|
||||||
|
)
|
||||||
|
: typ_leser
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": richtung,
|
||||||
|
"symbol_links": symbol_links,
|
||||||
|
"symbol_rechts": symbol_rechts,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung,
|
||||||
|
symbol_links : mod_symbol.typ_symbol,
|
||||||
|
symbol_rechts : mod_symbol.typ_symbol
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen(richtung, symbol_links, symbol_rechts));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_leser
|
||||||
|
{
|
||||||
|
return erstellen(0, 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function richtung_lesen
|
||||||
|
(
|
||||||
|
leser : typ_leser
|
||||||
|
)
|
||||||
|
: mod_richtung.typ_richtung
|
||||||
|
{
|
||||||
|
return leser.richtung;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function symbol_links_lesen
|
||||||
|
(
|
||||||
|
leser : typ_leser
|
||||||
|
)
|
||||||
|
: mod_symbol.typ_symbol
|
||||||
|
{
|
||||||
|
return leser.symbol_links;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function symbol_rechts_lesen
|
||||||
|
(
|
||||||
|
leser : typ_leser
|
||||||
|
)
|
||||||
|
: mod_symbol.typ_symbol
|
||||||
|
{
|
||||||
|
return leser.symbol_rechts;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
leser : typ_leser,
|
||||||
|
inkrement : int = +1
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
leser.richtung = mod_richtung.addieren(leser.richtung, inkrement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
leser : typ_leser,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
let symbol_ : lib_fehlermonade.typ_fehlermonade<mod_symbol.typ_symbol> = mod_figur.lesen(figur);
|
||||||
|
let summand : mod_richtung.typ_richtung;
|
||||||
|
if (lib_fehlermonade.voll(symbol_))
|
||||||
{
|
{
|
||||||
mod_figur.schieben(figur);
|
let symbol : mod_symbol.typ_symbol = lib_fehlermonade.lesen(symbol_);
|
||||||
summand = +2;
|
if (symbol === leser.symbol_links)
|
||||||
}
|
{
|
||||||
else if (symbol === leser.symbol_rechts)
|
mod_figur.schieben(figur);
|
||||||
{
|
summand = +2;
|
||||||
mod_figur.schieben(figur);
|
}
|
||||||
summand = -2;
|
else if (symbol === leser.symbol_rechts)
|
||||||
|
{
|
||||||
|
mod_figur.schieben(figur);
|
||||||
|
summand = -2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
summand = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
summand = 0;
|
summand = 0;
|
||||||
}
|
}
|
||||||
|
let richtung : mod_richtung.typ_richtung = mod_richtung.addieren(leser.richtung, summand);
|
||||||
|
mod_figur.bewegen(figur, richtung);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
leser : typ_leser
|
||||||
|
)
|
||||||
|
: any
|
||||||
{
|
{
|
||||||
summand = 0;
|
return {
|
||||||
|
"richtung": mod_richtung.exportieren(leser.richtung),
|
||||||
|
"symbol_links": mod_symbol.exportieren(leser.symbol_links),
|
||||||
|
"symbol_rechts": mod_symbol.exportieren(leser.symbol_rechts),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
let richtung : mod_richtung.typ_richtung = mod_richtung.addieren(leser.richtung, summand);
|
|
||||||
mod_figur.bewegen(figur, richtung);
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
roh : any
|
||||||
|
)
|
||||||
|
: typ_leser
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
mod_richtung.importieren(roh["richtung"]),
|
||||||
|
mod_symbol.importieren(roh["symbol_links"]),
|
||||||
|
mod_symbol.importieren(roh["symbol_rechts"])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
leser : typ_leser
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": mod_richtung.exportieren(leser.richtung),
|
|
||||||
"symbol_links": mod_symbol.exportieren(leser.symbol_links),
|
|
||||||
"symbol_rechts": mod_symbol.exportieren(leser.symbol_rechts),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
roh : any
|
|
||||||
)
|
|
||||||
: typ_leser
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
mod_richtung.importieren(roh["richtung"]),
|
|
||||||
mod_symbol.importieren(roh["symbol_links"]),
|
|
||||||
mod_symbol.importieren(roh["symbol_rechts"])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor[art] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": "leser", "angaben": exportieren(aktor.angaben)}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,171 +22,180 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_schreiber
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_schreiber
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "schreiber";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_schreiber =
|
|
||||||
{
|
{
|
||||||
richtung : mod_richtung.typ_richtung;
|
|
||||||
symbol : mod_symbol.typ_symbol;
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
let art : string = "schreiber";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_schreiber =
|
||||||
|
{
|
||||||
|
richtung : mod_richtung.typ_richtung;
|
||||||
|
symbol : mod_symbol.typ_symbol;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung,
|
||||||
|
symbol : mod_symbol.typ_symbol
|
||||||
|
)
|
||||||
|
: typ_schreiber
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": richtung,
|
||||||
|
"symbol": symbol,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
richtung : mod_richtung.typ_richtung,
|
||||||
|
symbol : mod_symbol.typ_symbol
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen(richtung, symbol));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_schreiber
|
||||||
|
{
|
||||||
|
return erstellen(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function richtung_lesen
|
||||||
|
(
|
||||||
|
schreiber : typ_schreiber
|
||||||
|
)
|
||||||
|
: mod_richtung.typ_richtung
|
||||||
|
{
|
||||||
|
return schreiber.richtung;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function symbol_lesen
|
||||||
|
(
|
||||||
|
schreiber : typ_schreiber
|
||||||
|
)
|
||||||
|
: mod_symbol.typ_symbol
|
||||||
|
{
|
||||||
|
return schreiber.symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
schreiber : typ_schreiber,
|
||||||
|
inkrement : int = +1
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
schreiber.richtung = mod_richtung.addieren(schreiber.richtung, inkrement);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
schreiber : typ_schreiber,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
mod_figur.schreiben(figur, schreiber.symbol);
|
||||||
|
mod_figur.bewegen(figur, schreiber.richtung);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
schreiber : typ_schreiber
|
||||||
|
)
|
||||||
|
: any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"richtung": mod_richtung.exportieren(schreiber.richtung),
|
||||||
|
"symbol": mod_symbol.exportieren(schreiber.symbol),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
roh : any
|
||||||
|
)
|
||||||
|
: typ_schreiber
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
mod_richtung.importieren(roh["richtung"]),
|
||||||
|
mod_symbol.importieren(roh["symbol"])
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function erstellen
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung,
|
|
||||||
symbol : mod_symbol.typ_symbol
|
|
||||||
)
|
|
||||||
: typ_schreiber
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": richtung,
|
|
||||||
"symbol": symbol,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
richtung : mod_richtung.typ_richtung,
|
|
||||||
symbol : mod_symbol.typ_symbol
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen(richtung, symbol));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_schreiber
|
|
||||||
{
|
|
||||||
return erstellen(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function richtung_lesen
|
|
||||||
(
|
|
||||||
schreiber : typ_schreiber
|
|
||||||
)
|
|
||||||
: mod_richtung.typ_richtung
|
|
||||||
{
|
|
||||||
return schreiber.richtung;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function symbol_lesen
|
|
||||||
(
|
|
||||||
schreiber : typ_schreiber
|
|
||||||
)
|
|
||||||
: mod_symbol.typ_symbol
|
|
||||||
{
|
|
||||||
return schreiber.symbol;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
schreiber : typ_schreiber,
|
|
||||||
inkrement : int = +1
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
schreiber.richtung = mod_richtung.addieren(schreiber.richtung, inkrement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
schreiber : typ_schreiber,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
mod_figur.schreiben(figur, schreiber.symbol);
|
|
||||||
mod_figur.bewegen(figur, schreiber.richtung);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
schreiber : typ_schreiber
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"richtung": mod_richtung.exportieren(schreiber.richtung),
|
|
||||||
"symbol": mod_symbol.exportieren(schreiber.symbol),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
roh : any
|
|
||||||
)
|
|
||||||
: typ_schreiber
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
mod_richtung.importieren(roh["richtung"]),
|
|
||||||
mod_symbol.importieren(roh["symbol"])
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor["schreiber"] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": "schreiber", "angaben": exportieren(aktor.angaben)}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,131 +22,140 @@ module mod_vtm
|
||||||
export module mod_aufbau
|
export module mod_aufbau
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_aktor_verwerfer
|
export module mod_aktor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_verwerfer
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
let art : string = "verwerfer";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_verwerfer =
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
let art : string = "verwerfer";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_verwerfer =
|
||||||
|
{
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function erstellen
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_verwerfer
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen_aktor
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: mod_aktor.typ_aktor
|
||||||
|
{
|
||||||
|
return lib_aufruf.einpacken(art, erstellen());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function beispiel
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_verwerfer
|
||||||
|
{
|
||||||
|
return erstellen();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function drehen
|
||||||
|
(
|
||||||
|
verwerfer : typ_verwerfer,
|
||||||
|
inkrement ?: int
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function verwenden
|
||||||
|
(
|
||||||
|
verwerfer : typ_verwerfer,
|
||||||
|
figur : mod_figur.typ_figur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
mod_figur.verwerfen(figur);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function exportieren
|
||||||
|
(
|
||||||
|
verwerfer : typ_verwerfer
|
||||||
|
)
|
||||||
|
: any
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function importieren
|
||||||
|
(
|
||||||
|
roh : any
|
||||||
|
)
|
||||||
|
: typ_verwerfer
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
erstellen
|
||||||
|
(
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
lib_brauch.umsetzen<signatur_aktor>
|
||||||
|
(
|
||||||
|
brauch_aktor,
|
||||||
|
art,
|
||||||
|
{
|
||||||
|
"beispiel": () => lib_aufruf.einpacken(art, beispiel()),
|
||||||
|
"drehen": (aktor, inkrement) => drehen(lib_aufruf.auspacken(aktor), inkrement),
|
||||||
|
"verwenden": (aktor, figur) => verwenden(lib_aufruf.auspacken(aktor), figur),
|
||||||
|
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
||||||
|
"importieren": (roh) => lib_aufruf.einpacken(art, importieren(roh["angaben"])),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
}
|
}
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function erstellen
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_verwerfer
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen_aktor
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: mod_aktor.typ_aktor
|
|
||||||
{
|
|
||||||
return einpacken(art, erstellen());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function beispiel
|
|
||||||
(
|
|
||||||
)
|
|
||||||
: typ_verwerfer
|
|
||||||
{
|
|
||||||
return erstellen();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function drehen
|
|
||||||
(
|
|
||||||
verwerfer : typ_verwerfer,
|
|
||||||
inkrement ?: int
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function verwenden
|
|
||||||
(
|
|
||||||
verwerfer : typ_verwerfer,
|
|
||||||
figur : mod_figur.typ_figur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
mod_figur.verwerfen(figur);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function exportieren
|
|
||||||
(
|
|
||||||
verwerfer : typ_verwerfer
|
|
||||||
)
|
|
||||||
: any
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function importieren
|
|
||||||
(
|
|
||||||
roh : any
|
|
||||||
)
|
|
||||||
: typ_verwerfer
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
erstellen
|
|
||||||
(
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
mod_aktor.implementierung_aktor[art] =
|
|
||||||
{
|
|
||||||
"beispiel": () => einpacken(art, beispiel()),
|
|
||||||
"drehen": (aktor, inkrement) => drehen(auspacken(aktor), inkrement),
|
|
||||||
"verwenden": (aktor, figur) => verwenden(auspacken(aktor), figur),
|
|
||||||
"exportieren": (aktor) => ({"art": art, "angaben": exportieren(aktor.angaben)}),
|
|
||||||
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_aufgabe = typ_komplex<Object>;
|
export type typ_aufgabe = lib_aufruf.typ_komplex<Object>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -47,7 +47,7 @@ module mod_vtm
|
||||||
: string
|
: string
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<string>
|
lib_aufruf.fallunterscheidung<string>
|
||||||
(
|
(
|
||||||
aufgabe,
|
aufgabe,
|
||||||
{
|
{
|
||||||
|
|
@ -69,7 +69,7 @@ module mod_vtm
|
||||||
: string
|
: string
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<string>
|
lib_aufruf.fallunterscheidung<string>
|
||||||
(
|
(
|
||||||
aufgabe,
|
aufgabe,
|
||||||
{
|
{
|
||||||
|
|
@ -91,7 +91,7 @@ module mod_vtm
|
||||||
: string
|
: string
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<string>
|
lib_aufruf.fallunterscheidung<string>
|
||||||
(
|
(
|
||||||
aufgabe,
|
aufgabe,
|
||||||
{
|
{
|
||||||
|
|
@ -113,7 +113,7 @@ module mod_vtm
|
||||||
: Array<mod_test.typ_test>
|
: Array<mod_test.typ_test>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<Array<mod_test.typ_test>>
|
lib_aufruf.fallunterscheidung<Array<mod_test.typ_test>>
|
||||||
(
|
(
|
||||||
aufgabe,
|
aufgabe,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_test = typ_komplex<Object>;
|
export type typ_test = lib_aufruf.typ_komplex<Object>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,7 +41,7 @@ module mod_vtm
|
||||||
: Array<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>
|
: Array<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<Array<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>>
|
lib_aufruf.fallunterscheidung<Array<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>>
|
||||||
(
|
(
|
||||||
test,
|
test,
|
||||||
{
|
{
|
||||||
|
|
@ -65,7 +65,7 @@ module mod_vtm
|
||||||
: boolean
|
: boolean
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
fallunterscheidung<boolean>
|
lib_aufruf.fallunterscheidung<boolean>
|
||||||
(
|
(
|
||||||
test,
|
test,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ module mod_vtm
|
||||||
let aktor : mod_aktor.typ_aktor = (
|
let aktor : mod_aktor.typ_aktor = (
|
||||||
lib_fehlermonade.voll(aktor_)
|
lib_fehlermonade.voll(aktor_)
|
||||||
? lib_fehlermonade.lesen(aktor_)
|
? lib_fehlermonade.lesen(aktor_)
|
||||||
: mod_aktor_verwerfer.erstellen_aktor()
|
: mod_aktor.mod_verwerfer.erstellen_aktor()
|
||||||
);
|
);
|
||||||
mod_aktor.verwenden(aktor, figur);
|
mod_aktor.verwenden(aktor, figur);
|
||||||
let zustand : mod_zustand.typ_zustand = mod_figur.zustand_lesen(figur);
|
let zustand : mod_zustand.typ_zustand = mod_figur.zustand_lesen(figur);
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function addieren(richtung1 : typ_richtung, richtung2 : typ_richtung) : typ_richtung
|
export function addieren(richtung1 : typ_richtung, richtung2 : typ_richtung) : typ_richtung
|
||||||
{
|
{
|
||||||
return mod_vtm.mod_helfer.mod_mathematik.mod(richtung1 + richtung2, 6);
|
return lib_mathematik.mod(richtung1 + richtung2, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export type typ_welt =
|
export type typ_welt =
|
||||||
{
|
{
|
||||||
felder : mod_vtm.mod_helfer.mod_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor>;
|
felder : lib_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor>;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function erstellen
|
export function erstellen
|
||||||
(
|
(
|
||||||
felder : mod_vtm.mod_helfer.mod_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor> = mod_vtm.mod_helfer.mod_hashmap.erstellen<mod_stelle.typ_stelle, mod_aktor.typ_aktor>(mod_stelle.hash)
|
felder : lib_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor> = lib_hashmap.erstellen<mod_stelle.typ_stelle, mod_aktor.typ_aktor>(mod_stelle.hash)
|
||||||
)
|
)
|
||||||
: typ_welt
|
: typ_welt
|
||||||
{
|
{
|
||||||
|
|
@ -56,7 +56,7 @@ module mod_vtm
|
||||||
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;}> = [];
|
let felder : Array<{stelle : mod_stelle.typ_stelle; aktor : mod_aktor.typ_aktor;}> = [];
|
||||||
mod_vtm.mod_helfer.mod_hashmap.iterieren
|
lib_hashmap.iterieren
|
||||||
(
|
(
|
||||||
welt.felder,
|
welt.felder,
|
||||||
(stelle, aktor) => felder.push({"stelle": stelle, "aktor": aktor})
|
(stelle, aktor) => felder.push({"stelle": stelle, "aktor": aktor})
|
||||||
|
|
@ -71,7 +71,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function feld_holen(welt : typ_welt, stelle : mod_stelle.typ_stelle) : lib_fehlermonade.typ_fehlermonade<mod_aktor.typ_aktor>
|
export function feld_holen(welt : typ_welt, stelle : mod_stelle.typ_stelle) : lib_fehlermonade.typ_fehlermonade<mod_aktor.typ_aktor>
|
||||||
{
|
{
|
||||||
return mod_vtm.mod_helfer.mod_hashmap.holen(welt.felder, stelle);
|
return lib_hashmap.holen(welt.felder, stelle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -80,7 +80,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
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
|
||||||
{
|
{
|
||||||
mod_vtm.mod_helfer.mod_hashmap.setzen(welt.felder, stelle, aktor);
|
lib_hashmap.setzen(welt.felder, stelle, aktor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,7 +97,7 @@ module mod_vtm
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"pruefer": (aktor) => (aktor.art === "befoerderer"),
|
"pruefer": (aktor) => (aktor.art === "befoerderer"),
|
||||||
"ersteller": () => mod_aktor_befoerderer.erstellen_aktor(0),
|
"ersteller": () => mod_aktor.mod_befoerderer.erstellen_aktor(0),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
@ -111,7 +111,7 @@ module mod_vtm
|
||||||
{
|
{
|
||||||
if (aktor.art === "schreiber")
|
if (aktor.art === "schreiber")
|
||||||
{
|
{
|
||||||
return (mod_aktor_schreiber.symbol_lesen(aktor.angaben) === symbol);
|
return (mod_aktor.mod_schreiber.symbol_lesen(aktor.angaben) === symbol);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -119,7 +119,7 @@ module mod_vtm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
"ersteller": () => mod_aktor_schreiber.erstellen_aktor(0, symbol)
|
"ersteller": () => mod_aktor.mod_schreiber.erstellen_aktor(0, symbol)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -139,9 +139,9 @@ module mod_vtm
|
||||||
if (aktor.art === "leser")
|
if (aktor.art === "leser")
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
(mod_aktor_leser.symbol_links_lesen(aktor.angaben) === symbol_links)
|
(mod_aktor.mod_leser.symbol_links_lesen(aktor.angaben) === symbol_links)
|
||||||
&&
|
&&
|
||||||
(mod_aktor_leser.symbol_rechts_lesen(aktor.angaben) === symbol_rechts)
|
(mod_aktor.mod_leser.symbol_rechts_lesen(aktor.angaben) === symbol_rechts)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -150,7 +150,7 @@ module mod_vtm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
"ersteller": () => mod_aktor_leser.erstellen_aktor(0, symbol_links, symbol_rechts)
|
"ersteller": () => mod_aktor.mod_leser.erstellen_aktor(0, symbol_links, symbol_rechts)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -161,13 +161,13 @@ module mod_vtm
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"pruefer": (aktor) => (aktor.art === "verwerfer"),
|
"pruefer": (aktor) => (aktor.art === "verwerfer"),
|
||||||
"ersteller": () => mod_aktor_verwerfer.erstellen_aktor(),
|
"ersteller": () => mod_aktor.mod_verwerfer.erstellen_aktor(),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
let index_alt : lib_fehlermonade.typ_fehlermonade<int>;
|
let index_alt : lib_fehlermonade.typ_fehlermonade<int>;
|
||||||
let aktor_alt_ : lib_fehlermonade.typ_fehlermonade<mod_aktor.typ_aktor> = mod_vtm.mod_helfer.mod_hashmap.holen(welt.felder, stelle);
|
let aktor_alt_ : lib_fehlermonade.typ_fehlermonade<mod_aktor.typ_aktor> = 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 aktor_alt : mod_aktor.typ_aktor = lib_fehlermonade.lesen(aktor_alt_);
|
||||||
|
|
@ -205,7 +205,7 @@ module mod_vtm
|
||||||
}
|
}
|
||||||
if (lib_fehlermonade.voll(index_alt))
|
if (lib_fehlermonade.voll(index_alt))
|
||||||
{
|
{
|
||||||
let index_neu : int = mod_vtm.mod_helfer.mod_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();
|
let aktor_neu : mod_aktor.typ_aktor = liste[index_neu].ersteller();
|
||||||
feld_setzen(welt, stelle, aktor_neu);
|
feld_setzen(welt, stelle, aktor_neu);
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +223,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
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<mod_aktor.typ_aktor> = mod_vtm.mod_helfer.mod_hashmap.holen(welt.felder, stelle);
|
let aktor_ : lib_fehlermonade.typ_fehlermonade<mod_aktor.typ_aktor> = 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);
|
||||||
|
|
@ -242,7 +242,7 @@ module mod_vtm
|
||||||
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<mod_stelle.typ_stelle> = (lib_fehlermonade.mod_nichts.erstellen<mod_stelle.typ_stelle>());
|
let stelle : lib_fehlermonade.typ_fehlermonade<mod_stelle.typ_stelle> = (lib_fehlermonade.mod_nichts.erstellen<mod_stelle.typ_stelle>());
|
||||||
mod_vtm.mod_helfer.mod_hashmap.iterieren
|
lib_hashmap.iterieren
|
||||||
(
|
(
|
||||||
welt.felder,
|
welt.felder,
|
||||||
(stelle_, aktor) =>
|
(stelle_, aktor) =>
|
||||||
|
|
@ -290,17 +290,17 @@ module mod_vtm
|
||||||
let aktor : mod_aktor.typ_aktor;
|
let aktor : mod_aktor.typ_aktor;
|
||||||
if ((u === -groesse) && (v === 0))
|
if ((u === -groesse) && (v === 0))
|
||||||
{
|
{
|
||||||
aktor = mod_aktor_erzeuger.erstellen_aktor(0);
|
aktor = mod_aktor.mod_erzeuger.erstellen_aktor(0);
|
||||||
}
|
}
|
||||||
else if ((u === +groesse) && (v === 0))
|
else if ((u === +groesse) && (v === 0))
|
||||||
{
|
{
|
||||||
aktor = mod_aktor_annehmer.erstellen_aktor();
|
aktor = mod_aktor.mod_annehmer.erstellen_aktor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aktor = mod_aktor_verwerfer.erstellen_aktor();
|
aktor = mod_aktor.mod_verwerfer.erstellen_aktor();
|
||||||
}
|
}
|
||||||
mod_vtm.mod_helfer.mod_hashmap.setzen(welt.felder, stelle, aktor);
|
lib_hashmap.setzen(welt.felder, stelle, aktor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -315,7 +315,7 @@ module mod_vtm
|
||||||
{
|
{
|
||||||
let roh : any = {};
|
let roh : any = {};
|
||||||
roh["felder"] = {};
|
roh["felder"] = {};
|
||||||
mod_vtm.mod_helfer.mod_hashmap.iterieren
|
lib_hashmap.iterieren
|
||||||
(
|
(
|
||||||
welt.felder,
|
welt.felder,
|
||||||
(stelle, aktor) =>
|
(stelle, aktor) =>
|
||||||
|
|
@ -335,13 +335,13 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function importieren(roh : any) : typ_welt
|
export function importieren(roh : any) : typ_welt
|
||||||
{
|
{
|
||||||
let felder : mod_vtm.mod_helfer.mod_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor> = (mod_vtm.mod_helfer.mod_hashmap.erstellen<mod_stelle.typ_stelle, mod_aktor.typ_aktor>(mod_stelle.hash));
|
let felder : lib_hashmap.typ_hashmap<mod_stelle.typ_stelle, mod_aktor.typ_aktor> = (lib_hashmap.erstellen<mod_stelle.typ_stelle, mod_aktor.typ_aktor>(mod_stelle.hash));
|
||||||
for (let stelle_ in roh["felder"])
|
for (let stelle_ in roh["felder"])
|
||||||
{
|
{
|
||||||
let stelle : mod_stelle.typ_stelle = mod_stelle.importieren(stelle_);
|
let stelle : mod_stelle.typ_stelle = mod_stelle.importieren(stelle_);
|
||||||
let aktor_ : mod_aktor.typ_aktor = roh["felder"][stelle_];
|
let aktor_ : mod_aktor.typ_aktor = roh["felder"][stelle_];
|
||||||
let aktor : mod_aktor.typ_aktor = mod_aktor.importieren(aktor_);
|
let aktor : mod_aktor.typ_aktor = mod_aktor.importieren(aktor_);
|
||||||
mod_vtm.mod_helfer.mod_hashmap.setzen(felder, stelle, aktor);
|
lib_hashmap.setzen(felder, stelle, aktor);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
erstellen
|
erstellen
|
||||||
|
|
|
||||||
|
|
@ -16,37 +16,42 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module mod_vtm_daten
|
module mod_vtm
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
export module mod_daten
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
var _speicher = {};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function schreiben(schluessel : string, wert : any) : void
|
|
||||||
{
|
{
|
||||||
_speicher[schluessel] = wert;
|
|
||||||
}
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
var _speicher = {};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export function lesen(schluessel : string) : lib_fehlermonade.typ_fehlermonade<any>
|
export function schreiben(schluessel : string, wert : any) : void
|
||||||
{
|
|
||||||
if (schluessel in _speicher)
|
|
||||||
{
|
{
|
||||||
return (lib_fehlermonade.mod_schlicht.erstellen<any>(_speicher[schluessel]));
|
_speicher[schluessel] = wert;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function lesen(schluessel : string) : lib_fehlermonade.typ_fehlermonade<any>
|
||||||
{
|
{
|
||||||
return (lib_fehlermonade.mod_nichts.erstellen<any>());
|
if (schluessel in _speicher)
|
||||||
|
{
|
||||||
|
return (lib_fehlermonade.mod_schlicht.erstellen<any>(_speicher[schluessel]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (lib_fehlermonade.mod_nichts.erstellen<any>());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -57,6 +62,6 @@ module mod_vtm_daten
|
||||||
*/
|
*/
|
||||||
function jsonp_behandlung(objekt : {schluessel : string; wert : any;}) : void
|
function jsonp_behandlung(objekt : {schluessel : string; wert : any;}) : void
|
||||||
{
|
{
|
||||||
mod_vtm_daten.schreiben(objekt.schluessel, objekt.wert);
|
mod_vtm.mod_daten.schreiben(objekt.schluessel, objekt.wert);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
function aufgaben_eintragen(behandler : (aufgabe : mod_aufbau.mod_aufgabe.typ_aufgabe)=>void) : void
|
function aufgaben_eintragen(behandler : (aufgabe : mod_aufbau.mod_aufgabe.typ_aufgabe)=>void) : void
|
||||||
{
|
{
|
||||||
let aufgaben_roh_ : lib_fehlermonade.typ_fehlermonade<Array<any>> = mod_vtm_daten.lesen("aufgaben");
|
let aufgaben_roh_ : lib_fehlermonade.typ_fehlermonade<Array<any>> = mod_vtm.mod_daten.lesen("aufgaben");
|
||||||
if (lib_fehlermonade.voll(aufgaben_roh_))
|
if (lib_fehlermonade.voll(aufgaben_roh_))
|
||||||
{
|
{
|
||||||
let aufgaben_roh : Array<any> = lib_fehlermonade.lesen(aufgaben_roh_);
|
let aufgaben_roh : Array<any> = lib_fehlermonade.lesen(aufgaben_roh_);
|
||||||
|
|
@ -42,8 +42,8 @@ module mod_vtm
|
||||||
{
|
{
|
||||||
let praefix : string = (
|
let praefix : string = (
|
||||||
{
|
{
|
||||||
"akzeptor": mod_vtm.mod_helfer.mod_uebersetzung.holen("aufbau.aufgaben.arten.akzeptor.kuerzel"),
|
"akzeptor": lib_uebersetzung.holen("aufbau.aufgaben.arten.akzeptor.kuerzel"),
|
||||||
"transduktor": mod_vtm.mod_helfer.mod_uebersetzung.holen("aufbau.aufgaben.arten.transduktor.kuerzel"),
|
"transduktor": lib_uebersetzung.holen("aufbau.aufgaben.arten.transduktor.kuerzel"),
|
||||||
}[aufgabe_roh["art"]]
|
}[aufgabe_roh["art"]]
|
||||||
);
|
);
|
||||||
let titel : string = ("[" + praefix + "]" + " " + aufgabe_roh["parameter"]["titel"]);
|
let titel : string = ("[" + praefix + "]" + " " + aufgabe_roh["parameter"]["titel"]);
|
||||||
|
|
@ -87,15 +87,15 @@ module mod_vtm
|
||||||
let sprache_nativ : string = "de";
|
let sprache_nativ : string = "de";
|
||||||
if (! sprachen[""+"includes"](sprache_nativ))
|
if (! sprachen[""+"includes"](sprache_nativ))
|
||||||
sprachen.push(sprache_nativ);
|
sprachen.push(sprache_nativ);
|
||||||
mod_vtm.mod_helfer.mod_uebersetzung.einrichten(sprachen);
|
lib_uebersetzung.einrichten(sprachen);
|
||||||
mod_vtm.mod_helfer.mod_uebersetzung.anwenden(document);
|
lib_uebersetzung.anwenden(document);
|
||||||
}
|
}
|
||||||
// Hilfe
|
// Hilfe
|
||||||
{
|
{
|
||||||
// Einleitung
|
// Einleitung
|
||||||
{
|
{
|
||||||
document.querySelector("#hilfe_einleitung").innerHTML = (
|
document.querySelector("#hilfe_einleitung").innerHTML = (
|
||||||
mod_vtm.mod_helfer.mod_uebersetzung.holen
|
lib_uebersetzung.holen
|
||||||
(
|
(
|
||||||
"hilfe.einleitung",
|
"hilfe.einleitung",
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,105 +16,57 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
module lib_aufruf
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
type typ_komplex<typ_angaben> = {art : string; angaben ?: typ_angaben;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function einpacken<typ_angaben>(art : string, angaben : typ_angaben) : typ_komplex<typ_angaben>
|
|
||||||
{
|
|
||||||
return {"art": art, "angaben": angaben};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function auspacken<typ_angaben>(komplex : typ_komplex<typ_angaben>) : typ_angaben
|
|
||||||
{
|
|
||||||
return komplex.angaben;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function fallunterscheidung<typ_ergebnis>
|
|
||||||
(
|
|
||||||
komplex : typ_komplex<any>,
|
|
||||||
faelle : {[art : string] : (angaben ?: any)=>typ_ergebnis},
|
|
||||||
ersatz : (komplex : typ_komplex<any>)=>typ_ergebnis = ((komplex) => {throw (new Error("unbehandelt"));})
|
|
||||||
)
|
|
||||||
: typ_ergebnis
|
|
||||||
{
|
|
||||||
if (komplex.art in faelle)
|
|
||||||
{
|
|
||||||
let funktion : (angaben ?: any)=>typ_ergebnis = faelle[komplex.art];
|
|
||||||
let ergebnis : typ_ergebnis = funktion(komplex.angaben);
|
|
||||||
return ergebnis;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
let meldung : string = ("unbehandelte Art '" + komplex.art + "'");
|
|
||||||
console.warn(meldung);
|
|
||||||
let ergebnis : typ_ergebnis = ersatz(komplex);
|
|
||||||
return ergebnis;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
module lib_brauch
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_brauch<typ_signatur> = {[domäne : string] : typ_signatur};
|
export type typ_komplex<typ_angaben> = {art : string; angaben ?: typ_angaben;};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export function erstellen<typ_signatur>
|
export function einpacken<typ_angaben>(art : string, angaben : typ_angaben) : typ_komplex<typ_angaben>
|
||||||
|
{
|
||||||
|
return {"art": art, "angaben": angaben};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function auspacken<typ_angaben>(komplex : typ_komplex<typ_angaben>) : typ_angaben
|
||||||
|
{
|
||||||
|
return komplex.angaben;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function fallunterscheidung<typ_ergebnis>
|
||||||
(
|
(
|
||||||
|
komplex : typ_komplex<any>,
|
||||||
|
faelle : {[art : string] : (angaben ?: any)=>typ_ergebnis},
|
||||||
|
ersatz : (komplex : typ_komplex<any>)=>typ_ergebnis = ((komplex) => {throw (new Error("unbehandelt"));})
|
||||||
)
|
)
|
||||||
: typ_brauch<typ_signatur>
|
: typ_ergebnis
|
||||||
{
|
{
|
||||||
return {};
|
if (komplex.art in faelle)
|
||||||
|
{
|
||||||
|
let funktion : (angaben ?: any)=>typ_ergebnis = faelle[komplex.art];
|
||||||
|
let ergebnis : typ_ergebnis = funktion(komplex.angaben);
|
||||||
|
return ergebnis;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let meldung : string = ("unbehandelte Art '" + komplex.art + "'");
|
||||||
|
console.warn(meldung);
|
||||||
|
let ergebnis : typ_ergebnis = ersatz(komplex);
|
||||||
|
return ergebnis;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function umsetzen<typ_signatur>
|
|
||||||
(
|
|
||||||
brauch : typ_brauch<typ_signatur>,
|
|
||||||
domäne : string,
|
|
||||||
implementierung : typ_signatur
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
brauch[domäne] = implementierung;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function anwenden<typ_signatur>
|
|
||||||
(
|
|
||||||
brauch : typ_brauch<typ_signatur>,
|
|
||||||
domäne : string
|
|
||||||
)
|
|
||||||
: typ_signatur
|
|
||||||
{
|
|
||||||
return brauch[domäne];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
86
quelldatein/helfer/brauch.ts
Normal file
86
quelldatein/helfer/brauch.ts
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
/*
|
||||||
|
* Verrückte Turing-Maschinen — A turing complete game
|
||||||
|
* Copyright (C) 2016 Christian Fraß <vidofnir@folksprak.org>
|
||||||
|
*
|
||||||
|
* 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
module lib_brauch
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_brauch<typ_signatur> = {[domäne : string] : typ_signatur};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen<typ_signatur>
|
||||||
|
(
|
||||||
|
)
|
||||||
|
: typ_brauch<typ_signatur>
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function umsetzen<typ_signatur>
|
||||||
|
(
|
||||||
|
brauch : typ_brauch<typ_signatur>,
|
||||||
|
domaene : string,
|
||||||
|
implementierung : typ_signatur
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
if (domaene in brauch)
|
||||||
|
{
|
||||||
|
let meldung : string = ("Domäne '" + domaene + "' bereits vorhanden");
|
||||||
|
throw (new Error(meldung));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
brauch[domaene] = implementierung;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function anwenden<typ_signatur>
|
||||||
|
(
|
||||||
|
brauch : typ_brauch<typ_signatur>,
|
||||||
|
domaene : string
|
||||||
|
)
|
||||||
|
: typ_signatur
|
||||||
|
{
|
||||||
|
if (! (domaene in brauch))
|
||||||
|
{
|
||||||
|
let meldung : string = ("keine Implementierung für Domäne '" + domaene + "' vorhanden");
|
||||||
|
throw (new Error(meldung));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return brauch[domaene];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ module lib_fehlermonade
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_fehlermonade<typ_wert> = typ_komplex<typ_wert>;
|
export type typ_fehlermonade<typ_wert> = lib_aufruf.typ_komplex<typ_wert>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ module lib_fehlermonade
|
||||||
*/
|
*/
|
||||||
export function erstellen<typ_wert>() : typ_fehlermonade<typ_wert>
|
export function erstellen<typ_wert>() : typ_fehlermonade<typ_wert>
|
||||||
{
|
{
|
||||||
return einpacken<any>("nichts", {});
|
return lib_aufruf.einpacken<any>("nichts", {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ module lib_fehlermonade
|
||||||
*/
|
*/
|
||||||
export function erstellen<typ_wert>(wert : typ_wert) : typ_fehlermonade<typ_wert>
|
export function erstellen<typ_wert>(wert : typ_wert) : typ_fehlermonade<typ_wert>
|
||||||
{
|
{
|
||||||
return einpacken<any>("schlicht", {"wert": wert});
|
return lib_aufruf.einpacken<any>("schlicht", {"wert": wert});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ module lib_fehlermonade
|
||||||
"schlicht",
|
"schlicht",
|
||||||
{
|
{
|
||||||
"voll": (fehlermonade) => true,
|
"voll": (fehlermonade) => true,
|
||||||
"lesen": (fehlermonade) => auspacken<any>(fehlermonade).wert,
|
"lesen": (fehlermonade) => lib_aufruf.auspacken<any>(fehlermonade).wert,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -16,104 +16,95 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module mod_vtm
|
module lib_hashmap
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_helfer
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_hashmap<typ_schluessel, typ_wert> =
|
||||||
{
|
{
|
||||||
|
hashfunction : (schluessel : typ_schluessel)=>string;
|
||||||
|
speicher : {[hashwert : string] : {schluessel : typ_schluessel; wert : typ_wert;}};
|
||||||
|
}
|
||||||
|
;
|
||||||
|
|
||||||
export module mod_hashmap
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function erstellen<typ_schluessel, typ_wert>
|
||||||
|
(
|
||||||
|
hashfunction : (schluessel : typ_schluessel)=>string
|
||||||
|
)
|
||||||
|
: typ_hashmap<typ_schluessel, typ_wert>
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"hashfunction": hashfunction,
|
||||||
|
"speicher": {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function setzen<typ_schluessel, typ_wert>
|
||||||
|
(
|
||||||
|
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
||||||
|
schluessel : typ_schluessel,
|
||||||
|
wert : typ_wert
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
let hashwert : string = hashmap.hashfunction(schluessel);
|
||||||
|
hashmap.speicher[hashwert] = {"schluessel": schluessel, "wert": wert};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function holen<typ_schluessel, typ_wert>
|
||||||
|
(
|
||||||
|
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
||||||
|
schluessel : typ_schluessel
|
||||||
|
)
|
||||||
|
: lib_fehlermonade.typ_fehlermonade<typ_wert>
|
||||||
|
{
|
||||||
|
let hashwert : string = hashmap.hashfunction(schluessel);
|
||||||
|
if (hashwert in hashmap.speicher)
|
||||||
{
|
{
|
||||||
|
let wert : typ_wert = hashmap.speicher[hashwert].wert;
|
||||||
/**
|
return (lib_fehlermonade.mod_schlicht.erstellen<typ_wert>(wert));
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_hashmap<typ_schluessel, typ_wert> =
|
|
||||||
{
|
|
||||||
hashfunction : (schluessel : typ_schluessel)=>string;
|
|
||||||
speicher : {[hashwert : string] : {schluessel : typ_schluessel; wert : typ_wert;}};
|
|
||||||
}
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function erstellen<typ_schluessel, typ_wert>
|
|
||||||
(
|
|
||||||
hashfunction : (schluessel : typ_schluessel)=>string
|
|
||||||
)
|
|
||||||
: typ_hashmap<typ_schluessel, typ_wert>
|
|
||||||
{
|
|
||||||
return {
|
|
||||||
"hashfunction": hashfunction,
|
|
||||||
"speicher": {},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function setzen<typ_schluessel, typ_wert>
|
|
||||||
(
|
|
||||||
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
|
||||||
schluessel : typ_schluessel,
|
|
||||||
wert : typ_wert
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
let hashwert : string = hashmap.hashfunction(schluessel);
|
|
||||||
hashmap.speicher[hashwert] = {"schluessel": schluessel, "wert": wert};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function holen<typ_schluessel, typ_wert>
|
|
||||||
(
|
|
||||||
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
|
||||||
schluessel : typ_schluessel
|
|
||||||
)
|
|
||||||
: lib_fehlermonade.typ_fehlermonade<typ_wert>
|
|
||||||
{
|
|
||||||
let hashwert : string = hashmap.hashfunction(schluessel);
|
|
||||||
if (hashwert in hashmap.speicher)
|
|
||||||
{
|
|
||||||
let wert : typ_wert = hashmap.speicher[hashwert].wert;
|
|
||||||
return (lib_fehlermonade.mod_schlicht.erstellen<typ_wert>(wert));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return (lib_fehlermonade.mod_nichts.erstellen<typ_wert>());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function iterieren<typ_schluessel, typ_wert>
|
|
||||||
(
|
|
||||||
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
|
||||||
prozedur : (schluessel ?: typ_schluessel, wert ?: typ_wert)=>void
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
Object.keys(hashmap.speicher).forEach
|
|
||||||
(
|
|
||||||
(hashwert) =>
|
|
||||||
{
|
|
||||||
let paar : {schluessel : typ_schluessel; wert : typ_wert;} = hashmap.speicher[hashwert];
|
|
||||||
prozedur(paar.schluessel, paar.wert);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (lib_fehlermonade.mod_nichts.erstellen<typ_wert>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function iterieren<typ_schluessel, typ_wert>
|
||||||
|
(
|
||||||
|
hashmap : typ_hashmap<typ_schluessel, typ_wert>,
|
||||||
|
prozedur : (schluessel ?: typ_schluessel, wert ?: typ_wert)=>void
|
||||||
|
)
|
||||||
|
: void
|
||||||
|
{
|
||||||
|
Object.keys(hashmap.speicher).forEach
|
||||||
|
(
|
||||||
|
(hashwert) =>
|
||||||
|
{
|
||||||
|
let paar : {schluessel : typ_schluessel; wert : typ_wert;} = hashmap.speicher[hashwert];
|
||||||
|
prozedur(paar.schluessel, paar.wert);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,33 +16,25 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module mod_vtm
|
module lib_mathematik
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_helfer
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function div(x : int, y : int) : int
|
||||||
{
|
{
|
||||||
|
return Math.floor(x/y);
|
||||||
export module mod_mathematik
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function div(x : int, y : int) : int
|
|
||||||
{
|
|
||||||
return Math.floor(x/y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function mod(x : int, y : int) : int
|
|
||||||
{
|
|
||||||
return (x - (y * div(x, y)));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function mod(x : int, y : int) : int
|
||||||
|
{
|
||||||
|
return (x - (y * div(x, y)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,166 +16,157 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module mod_vtm
|
|
||||||
|
module lib_uebersetzung
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_helfer
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
var _sprachstapel : Array<string>;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
var _daten : {[sprache : string] : {[schluessel : string] : string}} = {};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function einrichten(sprachen : Array<string>) : void
|
||||||
{
|
{
|
||||||
|
_sprachstapel = [];
|
||||||
export module mod_uebersetzung
|
sprachen.forEach
|
||||||
{
|
(
|
||||||
|
sprache =>
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
var _sprachstapel : Array<string>;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
var _daten : {[sprache : string] : {[schluessel : string] : string}} = {};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function einrichten(sprachen : Array<string>) : void
|
|
||||||
{
|
{
|
||||||
_sprachstapel = [];
|
let zeichenketten_roh_ : lib_fehlermonade.typ_fehlermonade<any> = mod_vtm.mod_daten.lesen("zeichenketten-" + sprache);
|
||||||
sprachen.forEach
|
if (lib_fehlermonade.voll(zeichenketten_roh_))
|
||||||
(
|
|
||||||
sprache =>
|
|
||||||
{
|
|
||||||
let zeichenketten_roh_ : lib_fehlermonade.typ_fehlermonade<any> = mod_vtm_daten.lesen("zeichenketten-" + sprache);
|
|
||||||
if (lib_fehlermonade.voll(zeichenketten_roh_))
|
|
||||||
{
|
|
||||||
let zeichenketten_roh : {[schluessel : string] : string} = (<{[schluessel : string] : string}>(lib_fehlermonade.lesen(zeichenketten_roh_)));
|
|
||||||
_daten[sprache] = {};
|
|
||||||
for (let schluessel in zeichenketten_roh)
|
|
||||||
{
|
|
||||||
_daten[sprache][schluessel] = (<string>(zeichenketten_roh[schluessel]));
|
|
||||||
}
|
|
||||||
_sprachstapel.push(sprache);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
let meldung : string = ("Zeichenketten für Sprache '" + sprache + "' konnten nicht geladen werden");
|
|
||||||
console.warn(meldung);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
function lesen(sprache : string, schluessel : string) : lib_fehlermonade.typ_fehlermonade<string>
|
|
||||||
{
|
|
||||||
if (sprache in _daten)
|
|
||||||
{
|
{
|
||||||
let satz : {[schluessel : string] : string} = _daten[sprache];
|
let zeichenketten_roh : {[schluessel : string] : string} = (<{[schluessel : string] : string}>(lib_fehlermonade.lesen(zeichenketten_roh_)));
|
||||||
if (schluessel in satz)
|
_daten[sprache] = {};
|
||||||
|
for (let schluessel in zeichenketten_roh)
|
||||||
{
|
{
|
||||||
return (lib_fehlermonade.mod_schlicht.erstellen<string>(satz[schluessel]));
|
_daten[sprache][schluessel] = (<string>(zeichenketten_roh[schluessel]));
|
||||||
|
}
|
||||||
|
_sprachstapel.push(sprache);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let meldung : string = ("Zeichenketten für Sprache '" + sprache + "' konnten nicht geladen werden");
|
||||||
|
console.warn(meldung);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
function lesen(sprache : string, schluessel : string) : lib_fehlermonade.typ_fehlermonade<string>
|
||||||
|
{
|
||||||
|
if (sprache in _daten)
|
||||||
|
{
|
||||||
|
let satz : {[schluessel : string] : string} = _daten[sprache];
|
||||||
|
if (schluessel in satz)
|
||||||
|
{
|
||||||
|
return (lib_fehlermonade.mod_schlicht.erstellen<string>(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<string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
let meldung : string = ("keine Zeichenketten für Sprache '" + sprache + "'");
|
||||||
|
console.warn(meldung);
|
||||||
|
return (lib_fehlermonade.mod_nichts.erstellen<string>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function holen(schluessel : string, vars : {[name : string] : string} = {}) : string
|
||||||
|
{
|
||||||
|
let ergebnis : lib_fehlermonade.typ_fehlermonade<string> = (lib_fehlermonade.mod_nichts.erstellen<string>());
|
||||||
|
let gefunden : boolean = (
|
||||||
|
_sprachstapel
|
||||||
|
.some
|
||||||
|
(
|
||||||
|
sprache =>
|
||||||
|
{
|
||||||
|
let ergebnis_ : lib_fehlermonade.typ_fehlermonade<string> = lesen(sprache, schluessel);
|
||||||
|
if (lib_fehlermonade.voll(ergebnis_))
|
||||||
|
{
|
||||||
|
ergebnis = ergebnis_;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (gefunden)
|
||||||
|
{
|
||||||
|
let str : string = lib_fehlermonade.lesen(ergebnis);
|
||||||
|
for (let name in vars)
|
||||||
|
{
|
||||||
|
let muster : RegExp = (new RegExp("!var:" + name));
|
||||||
|
let wert : string = vars[name];
|
||||||
|
str = str.replace(muster, wert);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ("{" + schluessel + "}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function anwenden(kontext : DocumentFragment) : void
|
||||||
|
{
|
||||||
|
let muster : RegExp = (new RegExp("^!translate:([a-z0-9\.]*)$"));
|
||||||
|
document.querySelectorAll("*")[""+"forEach"]
|
||||||
|
(
|
||||||
|
element =>
|
||||||
|
{
|
||||||
|
if (element.childElementCount === 0)
|
||||||
|
{
|
||||||
|
let inhalt : string = element.textContent;
|
||||||
|
let fund : any = muster.exec(inhalt);
|
||||||
|
if (fund != null)
|
||||||
|
{
|
||||||
|
let schluessel : string = fund[1];
|
||||||
|
let inhalt_ : string = holen(schluessel);
|
||||||
|
element.textContent = inhalt_;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
let meldung : string = ("keine Zeichenketten für Schlüssel '" + schluessel + "' in Sprache '" + sprache + "'");
|
// nichts tun
|
||||||
console.warn(meldung);
|
|
||||||
return (lib_fehlermonade.mod_nichts.erstellen<string>());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
let meldung : string = ("keine Zeichenketten für Sprache '" + sprache + "'");
|
// nichts tun
|
||||||
console.warn(meldung);
|
|
||||||
return (lib_fehlermonade.mod_nichts.erstellen<string>());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
;
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function holen(schluessel : string, vars : {[name : string] : string} = {}) : string
|
|
||||||
{
|
|
||||||
let ergebnis : lib_fehlermonade.typ_fehlermonade<string> = (lib_fehlermonade.mod_nichts.erstellen<string>());
|
|
||||||
let gefunden : boolean = (
|
|
||||||
_sprachstapel
|
|
||||||
.some
|
|
||||||
(
|
|
||||||
sprache =>
|
|
||||||
{
|
|
||||||
let ergebnis_ : lib_fehlermonade.typ_fehlermonade<string> = lesen(sprache, schluessel);
|
|
||||||
if (lib_fehlermonade.voll(ergebnis_))
|
|
||||||
{
|
|
||||||
ergebnis = ergebnis_;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
if (gefunden)
|
|
||||||
{
|
|
||||||
let str : string = lib_fehlermonade.lesen(ergebnis);
|
|
||||||
for (let name in vars)
|
|
||||||
{
|
|
||||||
let muster : RegExp = (new RegExp("!var:" + name));
|
|
||||||
let wert : string = vars[name];
|
|
||||||
str = str.replace(muster, wert);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return ("{" + schluessel + "}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function anwenden(kontext : DocumentFragment) : void
|
|
||||||
{
|
|
||||||
let muster : RegExp = (new RegExp("^!translate:([a-z0-9\.]*)$"));
|
|
||||||
document.querySelectorAll("*")[""+"forEach"]
|
|
||||||
(
|
|
||||||
element =>
|
|
||||||
{
|
|
||||||
if (element.childElementCount === 0)
|
|
||||||
{
|
|
||||||
let inhalt : string = element.textContent;
|
|
||||||
let fund : any = muster.exec(inhalt);
|
|
||||||
if (fund != null)
|
|
||||||
{
|
|
||||||
let schluessel : string = fund[1];
|
|
||||||
let inhalt_ : string = holen(schluessel);
|
|
||||||
element.textContent = inhalt_;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// nichts tun
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// nichts tun
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,49 +16,39 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module mod_vtm
|
module lib_vektor
|
||||||
{
|
{
|
||||||
|
|
||||||
export module mod_helfer
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export type typ_vektor = {x : float; y : float;};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
|
*/
|
||||||
|
export function polar(winkel : float, radius : float = 1) : typ_vektor
|
||||||
{
|
{
|
||||||
|
return {"x": (radius * Math.cos(winkel)), "y": (radius * Math.sin(winkel))};
|
||||||
export module mod_vektor
|
}
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export type typ_vektor = {x : float; y : float;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export function polar(winkel : float, radius : float = 1) : typ_vektor
|
export function skalieren(vektor : typ_vektor, faktor : float) : typ_vektor
|
||||||
{
|
{
|
||||||
return {"x": (radius * Math.cos(winkel)), "y": (radius * Math.sin(winkel))};
|
return {"x": (vektor.x * faktor), "y": (vektor.y * faktor)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export function skalieren(vektor : typ_vektor, faktor : float) : typ_vektor
|
export function addieren(vektor1 : typ_vektor, vektor2 : typ_vektor) : typ_vektor
|
||||||
{
|
{
|
||||||
return {"x": (vektor.x * faktor), "y": (vektor.y * faktor)};
|
return {"x": (vektor1.x + vektor2.x), "y": (vektor1.y + vektor2.y)};
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
|
||||||
*/
|
|
||||||
export function addieren(vektor1 : typ_vektor, vektor2 : typ_vektor) : typ_vektor
|
|
||||||
{
|
|
||||||
return {"x": (vektor1.x + vektor2.x), "y": (vektor1.y + vektor2.y)};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_knoten = typ_komplex<any>;
|
export type typ_knoten = lib_aufruf.typ_komplex<any>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ module mod_vtm
|
||||||
)
|
)
|
||||||
: typ_knoten
|
: typ_knoten
|
||||||
{
|
{
|
||||||
return einpacken("normal", erstellen(name, attribute, kinder));
|
return lib_aufruf.einpacken("normal", erstellen(name, attribute, kinder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ module mod_vtm
|
||||||
)
|
)
|
||||||
: typ_knoten
|
: typ_knoten
|
||||||
{
|
{
|
||||||
return einpacken("text", erstellen(inhalt));
|
return lib_aufruf.einpacken("text", erstellen(inhalt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_manifestation<typ_aufbau> = typ_komplex<any>;
|
export type typ_manifestation<typ_aufbau> = lib_aufruf.typ_komplex<any>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,14 @@ module mod_vtm
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
export type typ_position = mod_vtm.mod_helfer.mod_vektor.typ_vektor;
|
export type typ_position = lib_vektor.typ_vektor;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kcf <vidofnir@folksprak.org>
|
* @author kcf <vidofnir@folksprak.org>
|
||||||
*/
|
*/
|
||||||
var basis1 : typ_position = mod_vtm.mod_helfer.mod_vektor.polar((0/6) * (2*Math.PI));
|
var basis1 : typ_position = lib_vektor.polar((0/6) * (2*Math.PI));
|
||||||
var basis2 : typ_position = mod_vtm.mod_helfer.mod_vektor.polar((2/6) * (2*Math.PI));
|
var basis2 : typ_position = lib_vektor.polar((2/6) * (2*Math.PI));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,10 +44,10 @@ module mod_vtm
|
||||||
export function von_stelle(stelle : mod_vtm.mod_aufbau.mod_stelle.typ_stelle) : typ_position
|
export function von_stelle(stelle : mod_vtm.mod_aufbau.mod_stelle.typ_stelle) : typ_position
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
mod_vtm.mod_helfer.mod_vektor.addieren
|
lib_vektor.addieren
|
||||||
(
|
(
|
||||||
mod_vtm.mod_helfer.mod_vektor.skalieren(basis1, stelle.u),
|
lib_vektor.skalieren(basis1, stelle.u),
|
||||||
mod_vtm.mod_helfer.mod_vektor.skalieren(basis2, stelle.v)
|
lib_vektor.skalieren(basis2, stelle.v)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ module mod_vtm
|
||||||
return (
|
return (
|
||||||
pfad
|
pfad
|
||||||
(
|
(
|
||||||
mod_vtm.mod_helfer.sequenz(6).map(i => mod_vtm.mod_helfer.mod_vektor.polar(((i+0.5)/6) * (2*Math.PI), 0.5)),
|
mod_vtm.mod_helfer.sequenz(6).map(i => lib_vektor.polar(((i+0.5)/6) * (2*Math.PI), 0.5)),
|
||||||
true,
|
true,
|
||||||
{
|
{
|
||||||
"class": "rahmen"
|
"class": "rahmen"
|
||||||
|
|
@ -94,14 +94,14 @@ module mod_vtm
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
let kinder_feld : Array<mod_vtm.mod_helfer.mod_xml.typ_knoten> = [];
|
let kinder_feld : Array<mod_vtm.mod_helfer.mod_xml.typ_knoten> = [];
|
||||||
fallunterscheidung<void>
|
lib_aufruf.fallunterscheidung<void>
|
||||||
(
|
(
|
||||||
aktor,
|
aktor,
|
||||||
{
|
{
|
||||||
"erzeuger": (angaben) =>
|
"erzeuger": (angaben) =>
|
||||||
{
|
{
|
||||||
kinder_feld.push(knoten_rahmen());
|
kinder_feld.push(knoten_rahmen());
|
||||||
let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor_erzeuger.richtung_lesen(angaben);
|
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 = (
|
let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = (
|
||||||
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
||||||
(
|
(
|
||||||
|
|
@ -130,7 +130,7 @@ module mod_vtm
|
||||||
"befoerderer": (angaben) =>
|
"befoerderer": (angaben) =>
|
||||||
{
|
{
|
||||||
kinder_feld.push(knoten_rahmen());
|
kinder_feld.push(knoten_rahmen());
|
||||||
let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor_befoerderer.richtung_lesen(angaben);
|
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 = (
|
let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = (
|
||||||
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
||||||
(
|
(
|
||||||
|
|
@ -159,8 +159,8 @@ module mod_vtm
|
||||||
"schreiber": (angaben) =>
|
"schreiber": (angaben) =>
|
||||||
{
|
{
|
||||||
kinder_feld.push(knoten_rahmen());
|
kinder_feld.push(knoten_rahmen());
|
||||||
let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor_schreiber.richtung_lesen(angaben);
|
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_schreiber.symbol_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 = (
|
let knoten_pfeil : mod_vtm.mod_helfer.mod_xml.typ_knoten = (
|
||||||
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert
|
||||||
(
|
(
|
||||||
|
|
@ -189,9 +189,9 @@ module mod_vtm
|
||||||
"leser": (angaben) =>
|
"leser": (angaben) =>
|
||||||
{
|
{
|
||||||
kinder_feld.push(knoten_rahmen());
|
kinder_feld.push(knoten_rahmen());
|
||||||
let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor_leser.richtung_lesen(angaben);
|
let richtung : mod_vtm.mod_aufbau.mod_richtung.typ_richtung = mod_vtm.mod_aufbau.mod_aktor.mod_leser.richtung_lesen(angaben);
|
||||||
let symbol_links : mod_vtm.mod_aufbau.mod_symbol.typ_symbol = mod_vtm.mod_aufbau.mod_aktor_leser.symbol_links_lesen(angaben);
|
let symbol_links : mod_vtm.mod_aufbau.mod_symbol.typ_symbol = mod_vtm.mod_aufbau.mod_aktor.mod_leser.symbol_links_lesen(angaben);
|
||||||
let symbol_rechts : mod_vtm.mod_aufbau.mod_symbol.typ_symbol = mod_vtm.mod_aufbau.mod_aktor_leser.symbol_rechts_lesen(angaben);
|
let symbol_rechts : mod_vtm.mod_aufbau.mod_symbol.typ_symbol = mod_vtm.mod_aufbau.mod_aktor.mod_leser.symbol_rechts_lesen(angaben);
|
||||||
let ausgaenge : Array<{summand : mod_vtm.mod_aufbau.mod_richtung.typ_richtung, symbol : lib_fehlermonade.typ_fehlermonade<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>;}> =
|
let ausgaenge : Array<{summand : mod_vtm.mod_aufbau.mod_richtung.typ_richtung, symbol : lib_fehlermonade.typ_fehlermonade<mod_vtm.mod_aufbau.mod_symbol.typ_symbol>;}> =
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module mod_vtm
|
||||||
*/
|
*/
|
||||||
export function pfad
|
export function pfad
|
||||||
(
|
(
|
||||||
vertices : Array<mod_vtm.mod_helfer.mod_vektor.typ_vektor>,
|
vertices : Array<lib_vektor.typ_vektor>,
|
||||||
schliessen : boolean = true,
|
schliessen : boolean = true,
|
||||||
attribute : {[schlussel : string] : string} = {},
|
attribute : {[schlussel : string] : string} = {},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
s:mod_vtm_helfer.typ_xmlknoten:mod_vtm.mod_helfer.mod_xml.typ_knoten:g
|
s:mod_aktor_annehmer:mod_aktor.mod_annehmer:g
|
||||||
s:mod_vtm_helfer.xmlknoten_normal_erstellen_erweitert:mod_vtm.mod_helfer.mod_xml.mod_normal.erstellen_erweitert:g
|
s:mod_aktor_verwerfer:mod_aktor.mod_verwerfer:g
|
||||||
s:mod_vtm_helfer.xmlknoten_text_erstellen_erweitert:mod_vtm.mod_helfer.mod_xml.mod_text.erstellen_erweitert:g
|
s:mod_aktor_erzeuger:mod_aktor.mod_erzeuger:g
|
||||||
s:mod_vtm_helfer.xmlknoten_darstellen:mod_vtm.mod_helfer.mod_xml.darstellen: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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue