vtm/quelldatein/aufbau/schreiber.ts
Christian Fraß 8dd4d54f94 sicherung
2017-11-08 18:41:56 +01:00

77 lines
1.3 KiB
TypeScript

module mod_vtm_aufbau
{
/**
* @author kcf <vidofnir@folksprak.org>
*/
export class klasse_schreiber
implements schnittstelle_aktor
{
/**
* @author kcf <vidofnir@folksprak.org>
*/
private richtung : typ_richtung;
/**
* @author kcf <vidofnir@folksprak.org>
*/
private symbol : typ_symbol;
/**
* @author kcf <vidofnir@folksprak.org>
*/
public constructor(richtung : typ_richtung = 0, symbol : typ_symbol = 0)
{
this.richtung = richtung;
this.symbol = symbol;
}
/**
* @author kcf <vidofnir@folksprak.org>
*/
public richtung_lesen() : typ_richtung
{
return this.richtung;
}
/**
* @author kcf <vidofnir@folksprak.org>
*/
public symbol_lesen() : typ_symbol
{
return this.symbol;
}
/**
* @author kcf <vidofnir@folksprak.org>
* @implementation
*/
public drehen() : void
{
this.richtung = richtung_addieren(this.richtung, +1);
}
/**
* @author kcf <vidofnir@folksprak.org>
* @implementation
*/
public verwenden(figur : klasse_figur) : void
{
figur.schreiben(this.symbol);
figur.bewegen(this.richtung);
}
}
}