vtm/quelldatein/aufbau/schreiber.ts

77 lines
1.3 KiB
TypeScript
Raw Normal View History

2017-11-08 11:30:34 +01:00
module mod_vtm_aufbau
{
/**
* @author kcf <vidofnir@folksprak.org>
*/
export class klasse_schreiber
implements schnittstelle_aktor
{
/**
* @author kcf <vidofnir@folksprak.org>
*/
2017-11-08 15:05:06 +01:00
private richtung : typ_richtung;
2017-11-08 11:30:34 +01:00
/**
* @author kcf <vidofnir@folksprak.org>
*/
2017-11-08 15:05:06 +01:00
private symbol : typ_symbol;
2017-11-08 11:30:34 +01:00
/**
* @author kcf <vidofnir@folksprak.org>
*/
2017-11-08 15:05:06 +01:00
public constructor(richtung : typ_richtung = 0, symbol : typ_symbol = 0)
2017-11-08 11:30:34 +01:00
{
this.richtung = richtung;
2017-11-08 15:05:06 +01:00
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;
2017-11-08 11:30:34 +01:00
}
2017-11-08 18:41:56 +01:00
/**
* @author kcf <vidofnir@folksprak.org>
* @implementation
*/
public drehen() : void
{
this.richtung = richtung_addieren(this.richtung, +1);
}
2017-11-08 11:30:34 +01:00
/**
* @author kcf <vidofnir@folksprak.org>
* @implementation
*/
public verwenden(figur : klasse_figur) : void
{
2017-11-08 18:41:56 +01:00
figur.schreiben(this.symbol);
2017-11-08 11:30:34 +01:00
figur.bewegen(this.richtung);
}
}
}