Как разбить класс на несколько файлов как в C#?
Как можно разбить класс на несколько файлов? Чтобы часть методов класса была в одном файле и часть в другом?
Файл entity.ts
/// <reference path="settings.ts" />
namespace Game{
export class Entity{
private _size: Object;
private _pos: Object;
public name: string;
constructor(name: string, x: number, y: number){
this._size = {width: 15, height: 15};
this._pos = {x: x, y: y};
this.name = name;
}
public get pos(){
return this._pos;
}
}
}
Файл settings.ts
/// <reference path="entity.ts" />
namespace Game{
export class Entity{
settings(){
return 'Settings for ' + this.name;
}
}
}
Источник: Stack Overflow на русском