update type definition of naturalSpeed

This commit is contained in:
printempw 2018-02-12 10:39:20 +08:00
parent 8f9127777e
commit 5b215cdcca
1 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,10 @@
import { PlayerObject } from "./model";
export interface IAnimation {
naturalSpeed?: number;
play(player: PlayerObject, time: number): void;
}
export type AnimationFn = (player: PlayerObject, time: number) => void;
export type AnimationFn = ((player: PlayerObject, time: number) => void) & { naturalSpeed?: number };
export type Animation = AnimationFn | IAnimation;
export function invokeAnimation(
@ -28,6 +29,6 @@ export class CompositeAnimation implements IAnimation {
public play(player: PlayerObject, time: number): void;
}
export const WalkingAnimation: AnimationFn & { naturalSpeed?: number };
export const RunningAnimation: AnimationFn & { naturalSpeed?: number };
export const RotatingAnimation: AnimationFn & { naturalSpeed?: number };
export const WalkingAnimation: AnimationFn;
export const RunningAnimation: AnimationFn;
export const RotatingAnimation: AnimationFn;