-
Notifications
You must be signed in to change notification settings - Fork 2
/
Team.d.ts
32 lines (32 loc) · 1.17 KB
/
Team.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import type Player from './Player';
import { FieldArea } from "./enums/FieldArea";
import type { GameInfo } from "./types/GameInfo";
import { Action } from "./enums/Action";
import type Field from "./Field";
export interface TeamInterface {
players: Player[];
}
export default class Team implements TeamInterface {
players: Player[];
home: boolean;
name: string;
field: Field | null;
constructor(home: boolean, name: string, players: Player[]);
setField(field: Field): void;
rating(): {
goalkeeping: number;
defense: number;
attack: number;
};
getGoalkeepers(): Player[];
getFieldPlayers(exclude?: Player[]): Player[];
averageRating(map: (player: Player) => number, players?: Player[] | null): number;
goalkeeperRating(): number;
defenceRating(): number;
possessionRating(): number;
attackRating(): number;
simulateMove(ballPosition: FieldArea, gameInfo: GameInfo): Action;
getProbablePlayer(fieldPosition: FieldArea, attacker: boolean, exclude?: Player[]): Player;
attacker(fieldPosition: FieldArea, exclude?: Player[]): Player;
defender(fieldPosition: FieldArea, exclude?: Player[]): Player;
}