/* * Verrückte Turing-Maschinen — A turing complete game * Copyright (C) 2016-2018 kcf * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ module mod_vtm { export module mod_model { export module mod_actuator { export module mod_rejector { /** * @author kcf */ const kind : string = "rejector"; /** * @author kcf */ export type type_rejector = { } ; /** * @author kcf */ function create ( ) : type_rejector { return { }; } /** * @author kcf */ export function create_extended ( ) : mod_actuator.type_actuator { return lib_call.wrap(kind, create()); } /** * @author kcf */ function example ( ) : type_rejector { return create(); } /** * @author kcf */ function rotate ( rejector : type_rejector, increment ?: int ) : void { } /** * @author kcf */ function use ( rejector : type_rejector, token : mod_token.type_token ) : void { mod_token.reject(token); } /** * @author kcf */ function export_ ( rejector : type_rejector ) : any { return { }; } /** * @author kcf */ function import_ ( raw : any ) : type_rejector { return ( create ( ) ); } /** * @author kcf */ lib_trait.attend ( trait_actuator, kind, { "example": () => lib_call.wrap(kind, example()), "rotate": (actuator, increment) => rotate(lib_call.unwrap(actuator), increment), "use": (actuator, token) => use(lib_call.unwrap(actuator), token), "export": (actuator) => ({"kind": kind, "data": export_(actuator.data)}), "import": (raw) => lib_call.wrap(kind, import_(raw["data"])), } ) ; } } } }