Add unused Signal. private textStyle for labels

This commit is contained in:
Tyler Hallada 2018-04-21 01:45:00 -04:00
parent 065a69a475
commit ad9167528a
3 changed files with 29 additions and 4 deletions

11
src/Signal.ts Normal file
View File

@ -0,0 +1,11 @@
import * as PIXI from 'pixi.js';
export default class Signal {
public location: PIXI.Point;
constructor(
location: PIXI.Point,
) {
this.location = location;
}
}

View File

@ -71,6 +71,8 @@ export default class Station {
public label: PIXI.Text;
public color: tinycolorInstance;
private textStyle: object;
constructor(
location: PIXI.Point,
population: number,
@ -85,10 +87,15 @@ export default class Station {
// for debugging
stationCount += 1;
this.id = stationCount;
this.label = new PIXI.Text(`${this.id}`, {
this.textStyle = {
fill: '#FFA500',
fontFamily: 'monospace',
fontSize: '12px',
});
};
this.renderLabel();
}
public renderLabel() {
this.label = new PIXI.Text(`${this.id}`, this.textStyle);
}
}

View File

@ -15,6 +15,8 @@ export default class Train {
public color: tinycolorInstance;
public sprite: PIXI.Sprite;
private textStyle: object;
constructor(
location: PIXI.Point,
speed: number,
@ -35,15 +37,20 @@ export default class Train {
// for debugging
trainCount += 1;
this.id = trainCount;
this.label = new PIXI.Text(`${this.id}`, {
this.textStyle = {
fill: '#AEAEAE',
fontFamily: 'monospace',
fontSize: '12px',
});
};
this.renderLabel();
}
public boardPassengers() {
if (this.location === this.origin.location) { // about to leave a station
}
}
public renderLabel() {
this.label = new PIXI.Text(`${this.id}`, this.textStyle);
}
}