diff --git a/quelldatein/aufbau/aktoren/_aktor.ts b/quelldatein/aufbau/aktoren/_aktor.ts
index 252042a..2e17fbf 100644
--- a/quelldatein/aufbau/aktoren/_aktor.ts
+++ b/quelldatein/aufbau/aktoren/_aktor.ts
@@ -16,88 +16,99 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
-
- /**
- * @author kcf
- */
- export type typ_aktor = typ_komplex;
-
- /**
- * @author kcf
- */
- export type schnittstelle_aktor =
+ export module mod_aufbau
{
- beispiel : ()=>typ_aktor;
- drehen : (aktor : typ_aktor, inkrement : int)=>void;
- verwenden : (aktor : typ_aktor, figur : typ_figur)=>void;
- exportieren : (aktor : typ_aktor)=>any;
- importieren : (roh : any)=>typ_aktor;
- }
- ;
-
-
- /**
- * @author kcf
- */
- export var implementierung_aktor : {[art : string] : schnittstelle_aktor} = {};
-
-
- /**
- * @author kcf
- */
- export function aktor_erstellen(art : string, kern : any) : typ_aktor
- {
- return {"art": art, "angaben": kern};
- }
-
-
- /**
- * @author kcf
- */
- export function aktor_beispiel(art : string) : typ_aktor
- {
- return implementierung_aktor[art].beispiel();
- }
-
-
- /**
- * @author kcf
- */
- export function aktor_drehen(aktor : typ_aktor, inkrement ?: int) : void
- {
- return implementierung_aktor[aktor.art].drehen(aktor, inkrement);
- }
-
-
- /**
- * @author kcf
- */
- export function aktor_verwenden(aktor : typ_aktor, figur : typ_figur) : void
- {
- return implementierung_aktor[aktor.art].verwenden(aktor, figur);
- }
-
-
- /**
- * @author kcf
- */
- export function aktor_exportieren(aktor : typ_aktor) : any
- {
- return implementierung_aktor[aktor.art].exportieren(aktor);
- }
-
-
- /**
- * @author kcf
- */
- export function aktor_importieren(roh : any) : typ_aktor
- {
- return implementierung_aktor[roh.art].importieren(roh);
+
+ export module mod_aktor
+ {
+
+ /**
+ * @author kcf
+ */
+ export type typ_aktor = typ_komplex;
+
+
+ /**
+ * @author kcf
+ */
+ export type schnittstelle_aktor =
+ {
+ beispiel : ()=>typ_aktor;
+ drehen : (aktor : typ_aktor, inkrement : int)=>void;
+ verwenden : (aktor : typ_aktor, figur : mod_figur.typ_figur)=>void;
+ exportieren : (aktor : typ_aktor)=>any;
+ importieren : (roh : any)=>typ_aktor;
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ export var implementierung_aktor : {[art : string] : schnittstelle_aktor} = {};
+
+
+ /**
+ * @author kcf
+ */
+ /*
+ export function erstellen(art : string, kern : any) : typ_aktor
+ {
+ return einpacken(art, kern);
+ }
+ */
+
+
+ /**
+ * @author kcf
+ */
+ export function beispiel(art : string) : typ_aktor
+ {
+ return implementierung_aktor[art].beispiel();
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function drehen(aktor : typ_aktor, inkrement ?: int) : void
+ {
+ return implementierung_aktor[aktor.art].drehen(aktor, inkrement);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function verwenden(aktor : typ_aktor, figur : mod_figur.typ_figur) : void
+ {
+ return implementierung_aktor[aktor.art].verwenden(aktor, figur);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function exportieren(aktor : typ_aktor) : any
+ {
+ return implementierung_aktor[aktor.art].exportieren(aktor);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function importieren(roh : any) : typ_aktor
+ {
+ return implementierung_aktor[roh.art].importieren(roh);
+ }
+
+ }
+
}
}
-
diff --git a/quelldatein/aufbau/aktoren/annehmer.ts b/quelldatein/aufbau/aktoren/annehmer.ts
index 552c29f..3bcf81b 100644
--- a/quelldatein/aufbau/aktoren/annehmer.ts
+++ b/quelldatein/aufbau/aktoren/annehmer.ts
@@ -16,128 +16,141 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_annehmer =
+ export module mod_aufbau
{
+
+ export module mod_aktor_annehmer
+ {
+
+ /**
+ * @author kcf
+ */
+ let art : string = "annehmer";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_annehmer =
+ {
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ )
+ : typ_annehmer
+ {
+ return {
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen_aktor
+ (
+ )
+ : mod_aktor.typ_aktor
+ {
+ return einpacken(art, erstellen());
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function beispiel
+ (
+ )
+ : typ_annehmer
+ {
+ return erstellen();
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ annehmer : typ_annehmer,
+ inkrement ?: int
+ )
+ : void
+ {
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function verwenden
+ (
+ annehmer : typ_annehmer,
+ figur : mod_figur.typ_figur
+ )
+ : void
+ {
+ mod_figur.annehmen(figur);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function exportieren
+ (
+ annehmer : typ_annehmer
+ )
+ : any
+ {
+ return {
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function importieren
+ (
+ roh : any
+ )
+ : typ_annehmer
+ {
+ return (
+ erstellen
+ (
+ )
+ );
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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)),
+ }
+ ;
+
+ }
+
}
- ;
-
-
- /**
- * @author kcf
- */
- function annehmer_erstellen
- (
- )
- : typ_annehmer
- {
- return {
- };
- }
-
-
- /**
- * @author kcf
- */
- export function annehmer_erstellen_aktor
- (
- )
- : typ_aktor
- {
- return {"art": "annehmer", "angaben": annehmer_erstellen()};
- }
-
-
- /**
- * @author kcf
- */
- function annehmer_beispiel
- (
- )
- : typ_annehmer
- {
- return annehmer_erstellen();
- }
-
-
- /**
- * @author kcf
- */
- function annehmer_drehen
- (
- annehmer : typ_annehmer,
- inkrement ?: int
- )
- : void
- {
- }
-
-
- /**
- * @author kcf
- */
- function annehmer_verwenden
- (
- annehmer : typ_annehmer,
- figur : typ_figur
- )
- : void
- {
- figur_annehmen(figur);
- }
-
-
- /**
- * @author kcf
- */
- function annehmer_exportieren
- (
- annehmer : typ_annehmer
- )
- : any
- {
- return {
- };
- }
-
-
- /**
- * @author kcf
- */
- function annehmer_importieren
- (
- roh : any
- )
- : typ_annehmer
- {
- return (
- annehmer_erstellen
- (
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "annehmer", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["annehmer"] =
- {
- "beispiel": () => wrap(annehmer_beispiel()),
- "drehen": (aktor, inkrement) => annehmer_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => annehmer_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "annehmer_", "angaben": annehmer_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(annehmer_importieren(roh)),
- }
- ;
}
-
diff --git a/quelldatein/aufbau/aktoren/befoerderer.ts b/quelldatein/aufbau/aktoren/befoerderer.ts
index 388450c..d75bf2a 100644
--- a/quelldatein/aufbau/aktoren/befoerderer.ts
+++ b/quelldatein/aufbau/aktoren/befoerderer.ts
@@ -16,148 +16,161 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_befoerderer =
+ export module mod_aufbau
{
- richtung : typ_richtung;
+
+ export module mod_aktor_befoerderer
+ {
+
+ /**
+ * @author kcf
+ */
+ let art : string = "befoerderer";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_befoerderer =
+ {
+ richtung : mod_richtung.typ_richtung;
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ richtung : mod_richtung.typ_richtung
+ )
+ : typ_befoerderer
+ {
+ return {
+ "richtung": richtung,
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen_aktor
+ (
+ richtung : mod_richtung.typ_richtung
+ )
+ : mod_aktor.typ_aktor
+ {
+ return einpacken(art, erstellen(richtung));
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function beispiel
+ (
+ )
+ : typ_befoerderer
+ {
+ return erstellen(0);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function richtung_lesen
+ (
+ befoerderer : typ_befoerderer
+ )
+ : mod_richtung.typ_richtung
+ {
+ return befoerderer.richtung;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ befoerderer : typ_befoerderer,
+ inkrement : int = +1
+ )
+ : void
+ {
+ befoerderer.richtung = mod_richtung.addieren(befoerderer.richtung, inkrement);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function verwenden
+ (
+ befoerderer : typ_befoerderer,
+ figur : mod_figur.typ_figur
+ )
+ : void
+ {
+ mod_figur.bewegen(figur, befoerderer.richtung);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function exportieren
+ (
+ befoerderer : typ_befoerderer
+ )
+ : any
+ {
+ return {
+ "richtung": mod_richtung.exportieren(befoerderer.richtung),
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function importieren
+ (
+ roh : any
+ )
+ : typ_befoerderer
+ {
+ return (
+ erstellen
+ (
+ mod_richtung.importieren(roh["richtung"])
+ )
+ );
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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)),
+ }
+ ;
+
+ }
+
}
- ;
-
-
- /**
- * @author kcf
- */
- function befoerderer_erstellen
- (
- richtung : typ_richtung
- )
- : typ_befoerderer
- {
- return {
- "richtung": richtung,
- };
- }
-
-
- /**
- * @author kcf
- */
- export function befoerderer_erstellen_aktor
- (
- richtung : typ_richtung
- )
- : typ_aktor
- {
- return {"art": "befoerderer", "angaben": befoerderer_erstellen(richtung)};
- }
-
-
- /**
- * @author kcf
- */
- function befoerderer_beispiel
- (
- )
- : typ_befoerderer
- {
- return befoerderer_erstellen(0);
- }
-
-
- /**
- * @author kcf
- */
- export function befoerderer_richtung_lesen
- (
- befoerderer : typ_befoerderer
- )
- : typ_richtung
- {
- return befoerderer.richtung;
- }
-
-
- /**
- * @author kcf
- */
- function befoerderer_drehen
- (
- befoerderer : typ_befoerderer,
- inkrement : int = +1
- )
- : void
- {
- befoerderer.richtung = richtung_addieren(befoerderer.richtung, inkrement);
- }
-
-
- /**
- * @author kcf
- */
- function befoerderer_verwenden
- (
- befoerderer : typ_befoerderer,
- figur : typ_figur
- )
- : void
- {
- figur_bewegen(figur, befoerderer.richtung);
- }
-
-
- /**
- * @author kcf
- */
- function befoerderer_exportieren
- (
- befoerderer : typ_befoerderer
- )
- : any
- {
- return {
- "richtung": richtung_exportieren(befoerderer.richtung),
- };
- }
-
-
- /**
- * @author kcf
- */
- function befoerderer_importieren
- (
- roh : any
- )
- : typ_befoerderer
- {
- return (
- befoerderer_erstellen
- (
- richtung_importieren(roh["richtung"])
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "befoerderer", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["befoerderer"] =
- {
- "beispiel": () => wrap(befoerderer_beispiel()),
- "drehen": (aktor, inkrement) => befoerderer_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => befoerderer_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "befoerderer", "angaben": befoerderer_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(befoerderer_importieren(roh)),
- }
- ;
}
-
diff --git a/quelldatein/aufbau/aktoren/erzeuger.ts b/quelldatein/aufbau/aktoren/erzeuger.ts
index 2ff8b9f..87e97f0 100644
--- a/quelldatein/aufbau/aktoren/erzeuger.ts
+++ b/quelldatein/aufbau/aktoren/erzeuger.ts
@@ -16,148 +16,161 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_erzeuger =
+ export module mod_aufbau
{
- richtung : typ_richtung;
+
+ export module mod_aktor_erzeuger
+ {
+
+ /**
+ * @author kcf
+ */
+ let art : string = "erzeuger";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_erzeuger =
+ {
+ richtung : mod_richtung.typ_richtung;
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ richtung : mod_richtung.typ_richtung
+ )
+ : typ_erzeuger
+ {
+ return {
+ "richtung": richtung,
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen_aktor
+ (
+ richtung : mod_richtung.typ_richtung
+ )
+ : mod_aktor.typ_aktor
+ {
+ return einpacken(art, erstellen(richtung));
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function beispiel
+ (
+ )
+ : typ_erzeuger
+ {
+ return erstellen(0);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function richtung_lesen
+ (
+ erzeuger : typ_erzeuger
+ )
+ : mod_richtung.typ_richtung
+ {
+ return erzeuger.richtung;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ erzeuger : typ_erzeuger,
+ inkrement : int = +1
+ )
+ : void
+ {
+ erzeuger.richtung = mod_richtung.addieren(erzeuger.richtung, inkrement);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function verwenden
+ (
+ erzeuger : typ_erzeuger,
+ figur : mod_figur.typ_figur
+ )
+ : void
+ {
+ mod_figur.bewegen(figur, erzeuger.richtung);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function exportieren
+ (
+ erzeuger : typ_erzeuger
+ )
+ : any
+ {
+ return {
+ "richtung": mod_richtung.exportieren(erzeuger.richtung),
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function importieren
+ (
+ roh : any
+ )
+ : typ_erzeuger
+ {
+ return (
+ erstellen
+ (
+ mod_richtung.importieren(roh["richtung"])
+ )
+ );
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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)),
+ }
+ ;
+
+ }
+
}
- ;
-
-
- /**
- * @author kcf
- */
- function erzeuger_erstellen
- (
- richtung : typ_richtung
- )
- : typ_erzeuger
- {
- return {
- "richtung": richtung,
- };
- }
-
-
- /**
- * @author kcf
- */
- export function erzeuger_erstellen_aktor
- (
- richtung : typ_richtung
- )
- : typ_aktor
- {
- return {"art": "erzeuger", "angaben": erzeuger_erstellen(richtung)};
- }
-
-
- /**
- * @author kcf
- */
- function erzeuger_beispiel
- (
- )
- : typ_erzeuger
- {
- return erzeuger_erstellen(0);
- }
-
-
- /**
- * @author kcf
- */
- export function erzeuger_richtung_lesen
- (
- erzeuger : typ_erzeuger
- )
- : typ_richtung
- {
- return erzeuger.richtung;
- }
-
-
- /**
- * @author kcf
- */
- function erzeuger_drehen
- (
- erzeuger : typ_erzeuger,
- inkrement : int = +1
- )
- : void
- {
- erzeuger.richtung = richtung_addieren(erzeuger.richtung, inkrement);
- }
-
-
- /**
- * @author kcf
- */
- function erzeuger_verwenden
- (
- erzeuger : typ_erzeuger,
- figur : typ_figur
- )
- : void
- {
- figur_bewegen(figur, erzeuger.richtung);
- }
-
-
- /**
- * @author kcf
- */
- function erzeuger_exportieren
- (
- erzeuger : typ_erzeuger
- )
- : any
- {
- return {
- "richtung": richtung_exportieren(erzeuger.richtung),
- };
- }
-
-
- /**
- * @author kcf
- */
- function erzeuger_importieren
- (
- roh : any
- )
- : typ_erzeuger
- {
- return (
- erzeuger_erstellen
- (
- richtung_importieren(roh["richtung"])
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "erzeuger", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["erzeuger"] =
- {
- "beispiel": () => wrap(erzeuger_beispiel()),
- "drehen": (aktor, inkrement) => erzeuger_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => erzeuger_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "erzeuger", "angaben": erzeuger_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(erzeuger_importieren(roh)),
- }
- ;
}
-
diff --git a/quelldatein/aufbau/aktoren/leser.ts b/quelldatein/aufbau/aktoren/leser.ts
index 49dbe53..8436f97 100644
--- a/quelldatein/aufbau/aktoren/leser.ts
+++ b/quelldatein/aufbau/aktoren/leser.ts
@@ -16,211 +16,224 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_leser =
+ export module mod_aufbau
{
- "richtung": typ_richtung,
- "symbol_links": typ_symbol,
- "symbol_rechts": typ_symbol,
- }
- ;
-
-
- /**
- * @author kcf
- */
- function leser_erstellen
- (
- richtung : typ_richtung,
- symbol_links : typ_symbol,
- symbol_rechts : typ_symbol
- )
- : typ_leser
- {
- return {
- "richtung": richtung,
- "symbol_links": symbol_links,
- "symbol_rechts": symbol_rechts,
- };
- }
-
-
- /**
- * @author kcf
- */
- export function leser_erstellen_aktor
- (
- richtung : typ_richtung,
- symbol_links : typ_symbol,
- symbol_rechts : typ_symbol
- )
- : typ_aktor
- {
- return {"art": "leser", "angaben": leser_erstellen(richtung, symbol_links, symbol_rechts)};
- }
-
-
- /**
- * @author kcf
- */
- function leser_beispiel
- (
- )
- : typ_leser
- {
- return leser_erstellen(0, 0, 1);
- }
-
-
- /**
- * @author kcf
- */
- export function leser_richtung_lesen
- (
- leser : typ_leser
- )
- : typ_richtung
- {
- return leser.richtung;
- }
-
-
- /**
- * @author kcf
- */
- export function leser_symbol_links_lesen
- (
- leser : typ_leser
- )
- : typ_symbol
- {
- return leser.symbol_links;
- }
-
-
- /**
- * @author kcf
- */
- export function leser_symbol_rechts_lesen
- (
- leser : typ_leser
- )
- : typ_symbol
- {
- return leser.symbol_rechts;
- }
-
-
- /**
- * @author kcf
- */
- function leser_drehen
- (
- leser : typ_leser,
- inkrement : int = +1
- )
- : void
- {
- leser.richtung = richtung_addieren(leser.richtung, inkrement);
- }
-
-
- /**
- * @author kcf
- */
- function leser_verwenden
- (
- leser : typ_leser,
- figur : typ_figur
- )
- : void
- {
- let symbol_ : schnittstelle_fehlermonade = figur_lesen(figur);
- let summand : typ_richtung;
- if (symbol_.ist_schlicht())
+
+ export module mod_aktor_leser
{
- let symbol : typ_symbol = symbol_.lesen();
- if (symbol === leser.symbol_links)
+
+ /**
+ * @author kcf
+ */
+ let art : string = "leser";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_leser =
{
- figur_schieben(figur);
- summand = +2;
+ "richtung": mod_richtung.typ_richtung,
+ "symbol_links": mod_symbol.typ_symbol,
+ "symbol_rechts": mod_symbol.typ_symbol,
}
- else if (symbol === leser.symbol_rechts)
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ richtung : mod_richtung.typ_richtung,
+ symbol_links : mod_symbol.typ_symbol,
+ symbol_rechts : mod_symbol.typ_symbol
+ )
+ : typ_leser
{
- figur_schieben(figur);
- summand = -2;
+ return {
+ "richtung": richtung,
+ "symbol_links": symbol_links,
+ "symbol_rechts": symbol_rechts,
+ };
}
- else
+
+
+ /**
+ * @author kcf
+ */
+ 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
{
- summand = 0;
+ return einpacken(art, erstellen(richtung, symbol_links, symbol_rechts));
}
+
+
+ /**
+ * @author kcf
+ */
+ function beispiel
+ (
+ )
+ : typ_leser
+ {
+ return erstellen(0, 0, 1);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function richtung_lesen
+ (
+ leser : typ_leser
+ )
+ : mod_richtung.typ_richtung
+ {
+ return leser.richtung;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function symbol_links_lesen
+ (
+ leser : typ_leser
+ )
+ : mod_symbol.typ_symbol
+ {
+ return leser.symbol_links;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function symbol_rechts_lesen
+ (
+ leser : typ_leser
+ )
+ : mod_symbol.typ_symbol
+ {
+ return leser.symbol_rechts;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ leser : typ_leser,
+ inkrement : int = +1
+ )
+ : void
+ {
+ leser.richtung = mod_richtung.addieren(leser.richtung, inkrement);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function verwenden
+ (
+ leser : typ_leser,
+ figur : mod_figur.typ_figur
+ )
+ : void
+ {
+ let symbol_ : schnittstelle_fehlermonade = mod_figur.lesen(figur);
+ let summand : mod_richtung.typ_richtung;
+ if (symbol_.ist_schlicht())
+ {
+ let symbol : mod_symbol.typ_symbol = symbol_.lesen();
+ if (symbol === leser.symbol_links)
+ {
+ mod_figur.schieben(figur);
+ summand = +2;
+ }
+ else if (symbol === leser.symbol_rechts)
+ {
+ mod_figur.schieben(figur);
+ summand = -2;
+ }
+ else
+ {
+ summand = 0;
+ }
+ }
+ else
+ {
+ summand = 0;
+ }
+ let richtung : mod_richtung.typ_richtung = mod_richtung.addieren(leser.richtung, summand);
+ mod_figur.bewegen(figur, richtung);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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
+ */
+ 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
+ */
+ 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)),
+ }
+ ;
+
}
- else
- {
- summand = 0;
- }
- let richtung : typ_richtung = richtung_addieren(leser.richtung, summand);
- figur_bewegen(figur, richtung);
+
}
-
- /**
- * @author kcf
- */
- function leser_exportieren
- (
- leser : typ_leser
- )
- : any
- {
- return {
- "richtung": richtung_exportieren(leser.richtung),
- "symbol_links": symbol_exportieren(leser.symbol_links),
- "symbol_rechts": symbol_exportieren(leser.symbol_rechts),
- };
- }
-
-
- /**
- * @author kcf
- */
- function leser_importieren
- (
- roh : any
- )
- : typ_leser
- {
- return (
- leser_erstellen
- (
- richtung_importieren(roh["richtung"]),
- symbol_importieren(roh["symbol_links"]),
- symbol_importieren(roh["symbol_rechts"])
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "leser", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["leser"] =
- {
- "beispiel": () => wrap(leser_beispiel()),
- "drehen": (aktor, inkrement) => leser_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => leser_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "leser", "angaben": leser_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(leser_importieren(roh)),
- }
- ;
-
}
-
diff --git a/quelldatein/aufbau/aktoren/schreiber.ts b/quelldatein/aufbau/aktoren/schreiber.ts
index 90c222c..808df3a 100644
--- a/quelldatein/aufbau/aktoren/schreiber.ts
+++ b/quelldatein/aufbau/aktoren/schreiber.ts
@@ -16,168 +16,181 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_schreiber =
+ export module mod_aufbau
{
- richtung : typ_richtung;
- symbol : typ_symbol;
+
+ export module mod_aktor_schreiber
+ {
+
+ /**
+ * @author kcf
+ */
+ let art : string = "schreiber";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_schreiber =
+ {
+ richtung : mod_richtung.typ_richtung;
+ symbol : mod_symbol.typ_symbol;
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ richtung : mod_richtung.typ_richtung,
+ symbol : mod_symbol.typ_symbol
+ )
+ : typ_schreiber
+ {
+ return {
+ "richtung": richtung,
+ "symbol": symbol,
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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
+ */
+ function beispiel
+ (
+ )
+ : typ_schreiber
+ {
+ return erstellen(0, 0);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function richtung_lesen
+ (
+ schreiber : typ_schreiber
+ )
+ : mod_richtung.typ_richtung
+ {
+ return schreiber.richtung;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function symbol_lesen
+ (
+ schreiber : typ_schreiber
+ )
+ : mod_symbol.typ_symbol
+ {
+ return schreiber.symbol;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ schreiber : typ_schreiber,
+ inkrement : int = +1
+ )
+ : void
+ {
+ schreiber.richtung = mod_richtung.addieren(schreiber.richtung, inkrement);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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
+ */
+ function exportieren
+ (
+ schreiber : typ_schreiber
+ )
+ : any
+ {
+ return {
+ "richtung": mod_richtung.exportieren(schreiber.richtung),
+ "symbol": mod_symbol.exportieren(schreiber.symbol),
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function importieren
+ (
+ roh : any
+ )
+ : typ_schreiber
+ {
+ return (
+ erstellen
+ (
+ mod_richtung.importieren(roh["richtung"]),
+ mod_symbol.importieren(roh["symbol"])
+ )
+ );
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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)),
+ }
+ ;
+
+ }
+
}
- ;
-
-
- /**
- * @author kcf
- */
- function schreiber_erstellen
- (
- richtung : typ_richtung,
- symbol : typ_symbol
- )
- : typ_schreiber
- {
- return {
- "richtung": richtung,
- "symbol": symbol,
- };
- }
-
-
- /**
- * @author kcf
- */
- export function schreiber_erstellen_aktor
- (
- richtung : typ_richtung,
- symbol : typ_symbol
- )
- : typ_aktor
- {
- return {"art": "schreiber", "angaben": schreiber_erstellen(richtung, symbol)};
- }
-
-
- /**
- * @author kcf
- */
- function schreiber_beispiel
- (
- )
- : typ_schreiber
- {
- return schreiber_erstellen(0, 0);
- }
-
-
- /**
- * @author kcf
- */
- export function schreiber_richtung_lesen
- (
- schreiber : typ_schreiber
- )
- : typ_richtung
- {
- return schreiber.richtung;
- }
-
-
- /**
- * @author kcf
- */
- export function schreiber_symbol_lesen
- (
- schreiber : typ_schreiber
- )
- : typ_symbol
- {
- return schreiber.symbol;
- }
-
-
- /**
- * @author kcf
- */
- function schreiber_drehen
- (
- schreiber : typ_schreiber,
- inkrement : int = +1
- )
- : void
- {
- schreiber.richtung = richtung_addieren(schreiber.richtung, inkrement);
- }
-
-
- /**
- * @author kcf
- */
- function schreiber_verwenden
- (
- schreiber : typ_schreiber,
- figur : typ_figur
- )
- : void
- {
- figur_schreiben(figur, schreiber.symbol);
- figur_bewegen(figur, schreiber.richtung);
- }
-
-
- /**
- * @author kcf
- */
- function schreiber_exportieren
- (
- schreiber : typ_schreiber
- )
- : any
- {
- return {
- "richtung": richtung_exportieren(schreiber.richtung),
- "symbol": symbol_exportieren(schreiber.symbol),
- };
- }
-
-
- /**
- * @author kcf
- */
- function schreiber_importieren
- (
- roh : any
- )
- : typ_schreiber
- {
- return (
- schreiber_erstellen
- (
- richtung_importieren(roh["richtung"]),
- symbol_importieren(roh["symbol"])
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "schreiber", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["schreiber"] =
- {
- "beispiel": () => wrap(schreiber_beispiel()),
- "drehen": (aktor, inkrement) => schreiber_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => schreiber_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "schreiber", "angaben": schreiber_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(schreiber_importieren(roh)),
- }
- ;
}
-
diff --git a/quelldatein/aufbau/aktoren/verwerfer.ts b/quelldatein/aufbau/aktoren/verwerfer.ts
index cc364f2..e60bbbf 100644
--- a/quelldatein/aufbau/aktoren/verwerfer.ts
+++ b/quelldatein/aufbau/aktoren/verwerfer.ts
@@ -16,128 +16,141 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_verwerfer =
+ export module mod_aufbau
{
+
+ export module mod_aktor_verwerfer
+ {
+
+ /**
+ * @author kcf
+ */
+ let art : string = "verwerfer";
+
+
+ /**
+ * @author kcf
+ */
+ export type typ_verwerfer =
+ {
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ function erstellen
+ (
+ )
+ : typ_verwerfer
+ {
+ return {
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen_aktor
+ (
+ )
+ : mod_aktor.typ_aktor
+ {
+ return einpacken(art, erstellen());
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function beispiel
+ (
+ )
+ : typ_verwerfer
+ {
+ return erstellen();
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function drehen
+ (
+ verwerfer : typ_verwerfer,
+ inkrement ?: int
+ )
+ : void
+ {
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function verwenden
+ (
+ verwerfer : typ_verwerfer,
+ figur : mod_figur.typ_figur
+ )
+ : void
+ {
+ mod_figur.verwerfen(figur);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function exportieren
+ (
+ verwerfer : typ_verwerfer
+ )
+ : any
+ {
+ return {
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function importieren
+ (
+ roh : any
+ )
+ : typ_verwerfer
+ {
+ return (
+ erstellen
+ (
+ )
+ );
+ }
+
+
+ /**
+ * @author kcf
+ */
+ 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)),
+ }
+ ;
+
+ }
+
}
- ;
-
-
- /**
- * @author kcf
- */
- function verwerfer_erstellen
- (
- )
- : typ_verwerfer
- {
- return {
- };
- }
-
-
- /**
- * @author kcf
- */
- export function verwerfer_erstellen_aktor
- (
- )
- : typ_aktor
- {
- return {"art": "verwerfer", "angaben": verwerfer_erstellen()};
- }
-
-
- /**
- * @author kcf
- */
- function verwerfer_beispiel
- (
- )
- : typ_verwerfer
- {
- return verwerfer_erstellen();
- }
-
-
- /**
- * @author kcf
- */
- function verwerfer_drehen
- (
- verwerfer : typ_verwerfer,
- inkrement ?: int
- )
- : void
- {
- }
-
-
- /**
- * @author kcf
- */
- function verwerfer_verwenden
- (
- verwerfer : typ_verwerfer,
- figur : typ_figur
- )
- : void
- {
- figur_verwerfen(figur);
- }
-
-
- /**
- * @author kcf
- */
- function verwerfer_exportieren
- (
- verwerfer : typ_verwerfer
- )
- : any
- {
- return {
- };
- }
-
-
- /**
- * @author kcf
- */
- function verwerfer_importieren
- (
- roh : any
- )
- : typ_verwerfer
- {
- return (
- verwerfer_erstellen
- (
- )
- );
- }
-
-
- /**
- * @author kcf
- */
- let wrap = (angaben => ({"art": "verwerfer", "angaben": angaben}));
- let unwrap = (aktor => aktor.angaben);
- implementierung_aktor["verwerfer"] =
- {
- "beispiel": () => wrap(verwerfer_beispiel()),
- "drehen": (aktor, inkrement) => verwerfer_drehen(unwrap(aktor), inkrement),
- "verwenden": (aktor, figur) => verwerfer_verwenden(unwrap(aktor), figur),
- "exportieren": (aktor) => ({"art": "verwerfer", "angaben": verwerfer_exportieren(aktor.angaben)}),
- "importieren": (roh) => wrap(verwerfer_importieren(roh)),
- }
- ;
}
-
diff --git a/quelldatein/aufbau/aufgaben/akzeptortest.ts b/quelldatein/aufbau/aufgaben/akzeptortest.ts
index daef64f..b30205e 100644
--- a/quelldatein/aufbau/aufgaben/akzeptortest.ts
+++ b/quelldatein/aufbau/aufgaben/akzeptortest.ts
@@ -24,7 +24,7 @@ module mod_vtm_aufbau
*/
export type typ_akzeptortest =
{
- eingabe : Array;
+ eingabe : Array;
annehmen : boolean;
}
;
@@ -35,7 +35,7 @@ module mod_vtm_aufbau
*/
export function akzeptortest_erstellen
(
- eingabe : Array,
+ eingabe : Array,
annehmen : boolean
)
: typ_akzeptortest
@@ -54,7 +54,7 @@ module mod_vtm_aufbau
(
akzeptortest : typ_akzeptortest
)
- : Array
+ : Array
{
return akzeptortest.eingabe;
}
@@ -67,7 +67,7 @@ module mod_vtm_aufbau
(
akzeptortest : typ_akzeptortest,
angenommen : boolean,
- ausgabe : Array
+ ausgabe : Array
)
: boolean
{
diff --git a/quelldatein/aufbau/aufgaben/test.ts b/quelldatein/aufbau/aufgaben/test.ts
index d86953f..b034dc8 100644
--- a/quelldatein/aufbau/aufgaben/test.ts
+++ b/quelldatein/aufbau/aufgaben/test.ts
@@ -32,10 +32,10 @@ module mod_vtm_aufbau
(
test : typ_test
)
- : Array
+ : Array
{
return (
- fallunterscheidung>
+ fallunterscheidung>
(
test,
{
@@ -54,7 +54,7 @@ module mod_vtm_aufbau
(
test : typ_test,
angenommen : boolean,
- ausgabe : Array
+ ausgabe : Array
)
: boolean
{
diff --git a/quelldatein/aufbau/aufgaben/transduktortest.ts b/quelldatein/aufbau/aufgaben/transduktortest.ts
index a2701c9..04cfa1d 100644
--- a/quelldatein/aufbau/aufgaben/transduktortest.ts
+++ b/quelldatein/aufbau/aufgaben/transduktortest.ts
@@ -24,8 +24,8 @@ module mod_vtm_aufbau
*/
export type typ_transduktortest =
{
- eingabe : Array;
- ausgabe : Array;
+ eingabe : Array;
+ ausgabe : Array;
}
;
@@ -35,8 +35,8 @@ module mod_vtm_aufbau
*/
export function transduktortest_erstellen
(
- eingabe : Array,
- ausgabe : Array
+ eingabe : Array,
+ ausgabe : Array
)
: typ_transduktortest
{
@@ -54,7 +54,7 @@ module mod_vtm_aufbau
(
transduktortest : typ_transduktortest
)
- : Array
+ : Array
{
return transduktortest.eingabe;
}
@@ -67,7 +67,7 @@ module mod_vtm_aufbau
(
transduktortest : typ_transduktortest,
angenommen : boolean,
- ausgabe : Array
+ ausgabe : Array
)
: boolean
{
@@ -80,7 +80,7 @@ module mod_vtm_aufbau
let gleich : boolean = true;
for (let index : int = 0; index < transduktortest.ausgabe.length; index += 1)
{
- if (! symbol_vergleichen(transduktortest.ausgabe[index], ausgabe[index]))
+ if (! mod_vtm.mod_aufbau.mod_symbol.vergleichen(transduktortest.ausgabe[index], ausgabe[index]))
{
gleich = false;
break;
diff --git a/quelldatein/aufbau/figur.ts b/quelldatein/aufbau/figur.ts
index 92a890c..1547a8a 100644
--- a/quelldatein/aufbau/figur.ts
+++ b/quelldatein/aufbau/figur.ts
@@ -3,186 +3,196 @@
* Copyright (C) 2016 Christian Fraß
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General export function figur_License as published by
+ * 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 export function figur_License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General export function figur_License
+ * You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_figur =
+ export module mod_aufbau
{
- zustand : typ_zustand;
- band : Array;
- stelle : typ_stelle;
- }
- ;
-
-
- /**
- * @author kcf
- */
- export function figur_erstellen
- (
- band : Array = [],
- stelle : typ_stelle = stelle_null()
- )
- : typ_figur
- {
- return {
- "zustand": zustand_laufend,
- "band": band,
- "stelle": stelle,
- };
- }
-
-
- /**
- * @author kcf
- */
- export function figur_zustand_lesen
- (
- figur : typ_figur
- )
- : typ_zustand
- {
- return figur.zustand;
- }
-
-
- /**
- * @author kcf
- */
- export function figur_band_lesen
- (
- figur : typ_figur
- )
- : Array
- {
- return figur.band;
- }
-
-
- /**
- * @author kcf
- */
- export function figur_stelle_lesen
- (
- figur : typ_figur
- )
- : typ_stelle
- {
- return figur.stelle;
- }
-
-
- /**
- * @author kcf
- */
- export function figur_bewegen
- (
- figur : typ_figur,
- richtung : typ_richtung
- )
- : void
- {
- let summand : typ_stelle = stelle_von_richtung(richtung);
- figur.stelle = stelle_addieren(figur.stelle, summand);
- }
-
-
- /**
- * @author kcf
- */
- export function figur_schreiben
- (
- figur : typ_figur,
- symbol : typ_symbol
- )
- : void
- {
- figur.band.push(symbol);
- }
-
-
- /**
- * @author kcf
- */
- export function figur_lesen
- (
- figur : typ_figur
- )
- : schnittstelle_fehlermonade
- {
- if (figur.band.length <= 0)
+
+ export module mod_figur
{
- return (new klasse_nichts());
- }
- else
- {
- return (new klasse_schlicht(figur.band[0]));
+
+ /**
+ * @author kcf
+ */
+ export type typ_figur =
+ {
+ zustand : mod_zustand.typ_zustand;
+ band : Array;
+ stelle : mod_stelle.typ_stelle;
+ }
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen
+ (
+ band : Array = [],
+ stelle : mod_stelle.typ_stelle = mod_stelle.null_()
+ )
+ : typ_figur
+ {
+ return {
+ "zustand": mod_zustand.laufend,
+ "band": band,
+ "stelle": stelle,
+ };
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function zustand_lesen
+ (
+ figur : typ_figur
+ )
+ : mod_zustand.typ_zustand
+ {
+ return figur.zustand;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function band_lesen
+ (
+ figur : typ_figur
+ )
+ : Array
+ {
+ return figur.band;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function stelle_lesen
+ (
+ figur : typ_figur
+ )
+ : mod_stelle.typ_stelle
+ {
+ return figur.stelle;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function bewegen
+ (
+ figur : typ_figur,
+ richtung : mod_richtung.typ_richtung
+ )
+ : void
+ {
+ let summand : mod_stelle.typ_stelle = mod_stelle.von_richtung(richtung);
+ figur.stelle = mod_stelle.addieren(figur.stelle, summand);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function schreiben
+ (
+ figur : typ_figur,
+ symbol : mod_symbol.typ_symbol
+ )
+ : void
+ {
+ figur.band.push(symbol);
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function lesen
+ (
+ figur : typ_figur
+ )
+ : schnittstelle_fehlermonade
+ {
+ if (figur.band.length <= 0)
+ {
+ return (new klasse_nichts());
+ }
+ else
+ {
+ return (new klasse_schlicht(figur.band[0]));
+ }
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function schieben
+ (
+ figur : typ_figur
+ )
+ : void
+ {
+ if (figur.band.length <= 0)
+ {
+ let meldung : string = "Band ist leer";
+ throw (new Error(meldung));
+ }
+ else
+ {
+ figur.band.shift();
+ }
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function annehmen
+ (
+ figur : typ_figur
+ )
+ : void
+ {
+ figur.zustand = mod_zustand.angenommen;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function verwerfen
+ (
+ figur : typ_figur
+ )
+ : void
+ {
+ figur.zustand = mod_zustand.abgelehnt;
+ }
+
}
+
}
-
-
- /**
- * @author kcf
- */
- export function figur_schieben
- (
- figur : typ_figur
- )
- : void
- {
- if (figur.band.length <= 0)
- {
- let meldung : string = "Band ist leer";
- throw (new Error(meldung));
- }
- else
- {
- figur.band.shift();
- }
- }
-
-
- /**
- * @author kcf
- */
- export function figur_annehmen
- (
- figur : typ_figur
- )
- : void
- {
- figur.zustand = zustand_angenommen;
- }
-
-
- /**
- * @author kcf
- */
- export function figur_verwerfen
- (
- figur : typ_figur
- )
- : void
- {
- figur.zustand = zustand_abgelehnt;
- }
-
+
}
diff --git a/quelldatein/aufbau/modus.ts b/quelldatein/aufbau/modus.ts
index 2d3612d..8e38372 100644
--- a/quelldatein/aufbau/modus.ts
+++ b/quelldatein/aufbau/modus.ts
@@ -16,22 +16,32 @@
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_modus = int;
-
-
- /**
- * @author kcf
- */
- export const modus_initial = 0;
- export const modus_ungewiss = 1;
- export const modus_fehlerhaft = 2;
- export const modus_korrekt = 3;
+ export module mod_aufbau
+ {
+
+ export module mod_modus
+ {
+
+ /**
+ * @author kcf
+ */
+ export type typ_modus = int;
+
+
+ /**
+ * @author kcf
+ */
+ export const initial = 0;
+ export const ungewiss = 1;
+ export const fehlerhaft = 2;
+ export const korrekt = 3;
+
+ }
+
+ }
}
diff --git a/quelldatein/aufbau/partie.ts b/quelldatein/aufbau/partie.ts
index 601e7f3..391c63d 100644
--- a/quelldatein/aufbau/partie.ts
+++ b/quelldatein/aufbau/partie.ts
@@ -3,358 +3,368 @@
* Copyright (C) 2016 Christian Fraß
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General export function partie_License as published by
+ * 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 export function partie_License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General export function partie_License
+ * You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-module mod_vtm_aufbau
+module mod_vtm
{
- /**
- * @author kcf
- */
- export type typ_partie =
+ export module mod_aufbau
{
- welt : typ_welt;
- figur : schnittstelle_fehlermonade;
- aufgabe : typ_aufgabe;
- testindex : schnittstelle_fehlermonade;
- modus : typ_modus;
- lauscher : {[ereignis : string] : Array<(angaben ?: any)=>void>};
- }
- ;
-
-
- /**
- * @author kcf
- */
- export function partie_erstellen
- (
- aufgabe : typ_aufgabe
- )
- : typ_partie
- {
- let partie : typ_partie = {
- "welt": undefined,
- "figur": undefined,
- "aufgabe": aufgabe,
- "testindex": undefined,
- "modus": undefined,
- "lauscher": undefined,
- };
- partie.lauscher = {
- "aenderung_aufgabe": [],
- "aenderung_welt": [],
- "aenderung_figur": [],
- "aenderung_modus": [],
- };
- partie_welt_leeren(partie, false);
- partie_zuruecksetzen(partie, false);
- return partie;
- }
-
-
- /**
- * @author kcf
- */
- export function partie_lauschen(partie : typ_partie, ereignis : string, prozedur : (angaben ?: any)=>void) : void
- {
- if (ereignis in partie.lauscher)
+
+ export module mod_partie
{
- partie.lauscher[ereignis].push(prozedur);
- }
- else
- {
- let meldung : string = "kein Ereignis mit diesem Name";
- throw (new Error(meldung));
- }
- }
-
-
- /**
- * @author kcf
- */
- function partie_benachrichtigen(partie : typ_partie, ereignis : string, angaben : any = {}) : void
- {
- if (ereignis in partie.lauscher)
- {
- partie.lauscher[ereignis].forEach
- (
- prozedur =>
- {
- prozedur(angaben);
- }
- )
- ;
- }
- else
- {
- let meldung : string = "kein Ereignis mit diesem Name";
- throw (new Error(meldung));
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_zuruecksetzen(partie : typ_partie, bescheid_geben : boolean = true) : void
- {
- partie.figur = (new klasse_nichts());
- partie.testindex = (new klasse_nichts());
- partie.modus = modus_initial;
- if (bescheid_geben)
- {
- partie_benachrichtigen(partie, "aenderung_figur", {});
- partie_benachrichtigen(partie, "aenderung_modus", {});
- }
- else
- {
- // nichts tun
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_aufgabe_lesen(partie : typ_partie) : typ_aufgabe
- {
- return partie.aufgabe;
- }
-
-
- /**
- * @author kcf
- */
- export function partie_aufgabe_setzen(partie : typ_partie, aufgabe : typ_aufgabe) : void
- {
- partie.aufgabe = aufgabe;
- // partie.welt_leeren();
- partie_benachrichtigen(partie, "aenderung_aufgabe", {});
- partie_zuruecksetzen(partie);
- }
-
-
- /**
- * @author kcf
- */
- export function partie_welt_lesen(partie : typ_partie) : typ_welt
- {
- return partie.welt;
- }
-
-
- /**
- * @author kcf
- */
- export function partie_welt_setzen(partie : typ_partie, welt : mod_vtm_aufbau.typ_welt, bescheid_geben : boolean = true) : void
- {
- partie.welt = welt;
- if (bescheid_geben)
- {
- partie_benachrichtigen(partie, "aenderung_welt", {});
- }
- else
- {
- // nichts tun
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_welt_leeren(partie : typ_partie, bescheid_geben : boolean = true) : void
- {
- partie.welt = welt_blanko();
- if (bescheid_geben)
- {
- partie_benachrichtigen(partie, "aenderung_welt", {});
- }
- else
- {
- // nichts tun
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_figur_lesen(partie : typ_partie) : schnittstelle_fehlermonade
- {
- return partie.figur;
- }
-
-
- /**
- * @author kcf
- */
- export function partie_modus_lesen(partie : typ_partie) : typ_modus
- {
- return partie.modus;
- }
-
-
- /**
- * @author kcf
- */
- export function partie_welt_feld_wechseln(partie : typ_partie, stelle : typ_stelle, umgekehrt : boolean = false) : void
- {
- if (! (partie.modus === mod_vtm_aufbau.modus_initial))
- {
- let meldung : string = "gesperrt";
- }
- else
- {
- welt_feld_wechseln(partie.welt, stelle, umgekehrt);
- partie_benachrichtigen
- (
- partie,
- "aenderung_welt",
- {
- "art": "feld_wechseln",
- "angaben":
- {
- "stelle": stelle,
- "umgekehrt": umgekehrt,
- "feld": welt_feld_holen(partie.welt, stelle),
- }
- }
- )
- ;
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_welt_feld_drehen(partie : typ_partie, stelle : typ_stelle, inkrement : int = +1) : void
- {
- if (! (partie.modus === mod_vtm_aufbau.modus_initial))
- {
- let meldung : string = "gesperrt";
- }
- else
- {
- welt_feld_drehen(partie.welt, stelle, inkrement);
- partie_benachrichtigen(partie, "aenderung_welt", {});
- }
- }
-
-
- /**
- * @author kcf
- */
- export function partie_fortfahren(partie : typ_partie) : void
- {
- switch (partie.modus)
- {
- case modus_initial:
+
+ /**
+ * @author kcf
+ */
+ export type typ_partie =
{
- partie.modus = modus_ungewiss;
- partie.testindex = (new klasse_schlicht(0));
- partie_benachrichtigen(partie, "aenderung_modus", {});
- break;
+ welt : mod_welt.typ_welt;
+ figur : schnittstelle_fehlermonade;
+ aufgabe : mod_vtm_aufbau.typ_aufgabe;
+ testindex : schnittstelle_fehlermonade;
+ modus : mod_modus.typ_modus;
+ lauscher : {[ereignis : string] : Array<(angaben ?: any)=>void>};
}
- case modus_ungewiss:
+ ;
+
+
+ /**
+ * @author kcf
+ */
+ export function erstellen
+ (
+ aufgabe : mod_vtm_aufbau.typ_aufgabe
+ )
+ : typ_partie
{
- if (! partie.figur.ist_schlicht())
+ let partie : typ_partie = {
+ "welt": undefined,
+ "figur": undefined,
+ "aufgabe": aufgabe,
+ "testindex": undefined,
+ "modus": undefined,
+ "lauscher": undefined,
+ };
+ partie.lauscher = {
+ "aenderung_aufgabe": [],
+ "aenderung_welt": [],
+ "aenderung_figur": [],
+ "aenderung_modus": [],
+ };
+ welt_leeren(partie, false);
+ zuruecksetzen(partie, false);
+ return partie;
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function lauschen(partie : typ_partie, ereignis : string, prozedur : (angaben ?: any)=>void) : void
+ {
+ if (ereignis in partie.lauscher)
{
- let test : typ_test = aufgabe_tests(partie.aufgabe)[partie.testindex.lesen()];
- let band : Array = mod_vtm_helfer.liste_kopieren(test_eingabe(test));
- let stelle : typ_stelle = welt_erzeuger_finden(partie.welt);
- partie.figur = (
- new klasse_schlicht
- (
- figur_erstellen
- (
- band,
- stelle
- )
- )
- );
+ partie.lauscher[ereignis].push(prozedur);
}
else
{
- let figur : typ_figur = partie.figur.lesen();
- let stelle : typ_stelle = figur_stelle_lesen(figur);
- let aktor_ : schnittstelle_fehlermonade = welt_feld_holen(partie.welt, stelle);
- let aktor : typ_aktor = (aktor_.ist_schlicht() ? aktor_.lesen() : verwerfer_erstellen_aktor());
- aktor_verwenden(aktor, figur);
- let zustand : typ_zustand = figur_zustand_lesen(figur);
- if (zustand === zustand_laufend)
- {
- // nichts tun
- }
- else if ((zustand === zustand_angenommen) || (zustand === zustand_abgelehnt))
- {
- let angenommen : boolean = (zustand === zustand_angenommen);
- let ausgabe : Array = figur_band_lesen(figur);
- partie.figur = (new klasse_nichts());
- let testindex : int = partie.testindex.lesen();
- let tests : Array = aufgabe_tests(partie.aufgabe);
- let test : typ_test = tests[testindex];
- if (! test_pruefen(test, angenommen, ausgabe))
+ let meldung : string = "kein Ereignis mit diesem Name";
+ throw (new Error(meldung));
+ }
+ }
+
+
+ /**
+ * @author kcf
+ */
+ function benachrichtigen(partie : typ_partie, ereignis : string, angaben : any = {}) : void
+ {
+ if (ereignis in partie.lauscher)
+ {
+ partie.lauscher[ereignis].forEach
+ (
+ prozedur =>
{
- partie.modus = modus_fehlerhaft;
- partie_benachrichtigen(partie, "aenderung_modus", {});
+ prozedur(angaben);
+ }
+ )
+ ;
+ }
+ else
+ {
+ let meldung : string = "kein Ereignis mit diesem Name";
+ throw (new Error(meldung));
+ }
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function zuruecksetzen(partie : typ_partie, bescheid_geben : boolean = true) : void
+ {
+ partie.figur = (new klasse_nichts());
+ partie.testindex = (new klasse_nichts());
+ partie.modus = mod_modus.initial;
+ if (bescheid_geben)
+ {
+ benachrichtigen(partie, "aenderung_figur", {});
+ benachrichtigen(partie, "aenderung_modus", {});
+ }
+ else
+ {
+ // nichts tun
+ }
+ }
+
+
+ /**
+ * @author kcf
+ */
+ export function aufgabe_lesen(partie : typ_partie) : mod_vtm_aufbau.typ_aufgabe
+ {
+ return partie.aufgabe;
+ }
+
+
+ /**
+ * @author kcf