/* * Verrückte Turing-Maschinen — A turing complete game * Copyright (C) 2016 Christian Fraß * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ module mod_vtm_aufbau { /** * @author kcf */ export type typ_annehmer = { } ; /** * @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)), } ; }