Tíquete #31228

Gameクラスのコンストラクタ引数

: 2013-04-26 21:30 Última Atualização: 2013-09-01 12:18

Relator:
Dono:
Estado:
Aberto [Owner assigned]
Componente:
(Nenhum)
Marcos:
Prioridade:
2
Gravidade:
5 - Medium
Resolução:
Nenhum
Arquivo:
Nenhum

Details

現状はこうなっている。

constructor(width:number, height:number, ...args:any[]) {
これは、継承先でargsを上手く渡すことが出来ずに困る。おそらくTypeScriptの仕様上不可能。

以下どちらかの方がいいかも。既存コードの改変が不要なので後者のがいいかもだが。

interface GameOption {
  width?: number;
  height?: number;
  container?: HTMLElement;
  renderOption?: RenderTransferMode;
  renderer?: Function;
}
class Game {
  constructor(option: GameOption) {

constructor(...args:any[]) {

Ticket History (3/3 Histories)

2013-04-26 21:30 Updated by: tsugehara
  • New Ticket "Gameクラスのコンストラクタ引数" created
2013-04-26 21:40 Updated by: tsugehara
  • Prioridade Update from 5 - Medium to 2
  • Dono Update from (Nenhum) to tsugehara
2013-09-01 12:18 Updated by: tsugehara
  • Marco Update from (Nenhum) to 3.0

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login