30 lines
420 B
JavaScript
30 lines
420 B
JavaScript
import { Segment } from "./Segment.js";
|
|
|
|
class Wall
|
|
{
|
|
/**
|
|
* @param {Segment} start
|
|
*/
|
|
constructor (rail)
|
|
{
|
|
/**
|
|
* @type {Segment}
|
|
*/
|
|
this.rail = rail === undefined ? new Segment() : rail;
|
|
}
|
|
|
|
draw(ctx)
|
|
{
|
|
this.rail.draw(ctx);
|
|
}
|
|
|
|
from_json(data)
|
|
{
|
|
this.rail = this.rail.from_json(data.rail)
|
|
|
|
return this
|
|
}
|
|
}
|
|
|
|
export { Wall }
|