Skip to content

Commit

Permalink
fix: 型を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
teramotodaiki committed Dec 31, 2018
1 parent 47a0d94 commit fe68e68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/hackforplay/deprecated-skin.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import Hack from './hack';

const Skin = {};

// あとで mod 関数から名前を取得するための対応表
Object.defineProperty(Skin, '__name', {
enumerable: false,
value: new WeakMap()
});
const Skin = {
__name: new WeakMap() // あとで mod 関数から名前を取得するための対応表
};

/**
* 新しいスキンを追加する
Expand Down
4 changes: 2 additions & 2 deletions src/hackforplay/object/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class RPGObject extends enchant.Sprite implements N.INumbers {
private _image?: typeof enchant.Surface;
private _noFilterImage?: typeof enchant.Surface; // filter がかかっていないオリジナルの画像

constructor(mod?: DeprecatedSkin) {
constructor(mod?: (this: RPGObject) => void) {
super(0, 0);

this.moveTo(game.width, game.height);
Expand Down Expand Up @@ -962,7 +962,7 @@ export default class RPGObject extends enchant.Sprite implements N.INumbers {
this._family = family;
}

summon(skin: DeprecatedSkin, _class = RPGObject) {
summon(skin: (this: RPGObject) => void, _class = RPGObject) {
// 自分と同じ Family を持つ従者とする
const appended = new _class(skin);
registerServant(this, appended);
Expand Down

0 comments on commit fe68e68

Please sign in to comment.