vtm/quelldatein/aufbau/aktoren/annehmer.ts

157 lines
3.2 KiB
TypeScript
Raw Normal View History

2017-11-09 14:06:35 +01:00
/*
* 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
2018-03-26 00:41:10 +02:00
* it under the terms of the GNU General Public License as published by
2017-11-09 14:06:35 +01:00
* 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
2018-03-26 00:41:10 +02:00
* GNU General Public License for more details.
2017-11-09 14:06:35 +01:00
*
2018-03-26 00:41:10 +02:00
* You should have received a copy of the GNU General Public License
2017-11-09 14:06:35 +01:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2017-11-08 15:05:06 +01:00
2018-03-26 10:42:58 +02:00
module mod_vtm
2017-11-08 15:05:06 +01:00
{
2018-03-26 10:42:58 +02:00
export module mod_aufbau
2017-11-08 15:05:06 +01:00
{
2018-03-26 10:42:58 +02:00
export module mod_aktor_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 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)}),
2018-03-26 22:32:10 +02:00
"importieren": (roh) => einpacken(art, importieren(roh["angaben"])),
2018-03-26 10:42:58 +02:00
}
;
}
}
2018-03-26 00:41:10 +02:00
2017-11-08 15:05:06 +01:00
}