13 lines
230 B
TypeScript
13 lines
230 B
TypeScript
|
export interface ITank {
|
||
|
name: string;
|
||
|
health: number;
|
||
|
|
||
|
attackDelay: number;
|
||
|
}
|
||
|
type BuildTank = (name: string) => ITank;
|
||
|
export const buildTank: BuildTank = (name) => ({
|
||
|
name,
|
||
|
health: 100,
|
||
|
attackDelay: 0,
|
||
|
} as ITank);
|