volleyballsimtypes 0.0.409 → 0.0.411

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ export declare class TeamGenerator {
10
10
  private static getFormation;
11
11
  private static comparePlayers;
12
12
  static createRoster(country: Country): Player[];
13
- static createTeams(divisionId: string, country: Country): Team[];
13
+ static createTeams(divisionId: string, country: Country, count?: number): Team[];
14
14
  static readonly BOT_SUB_BANDS: EnergyBand[];
15
15
  static createTactics(roster: Player[]): Tactics;
16
16
  private static createLineup;
@@ -39,8 +39,10 @@ class TeamGenerator {
39
39
  static createRoster(country) {
40
40
  return TeamGenerator.RARITIES.map((rarity, i) => player_1.PlayerGenerator.generatePlayer(country, rarity, this.ROLES[i % TeamGenerator.ROLES.length]));
41
41
  }
42
- static createTeams(divisionId, country) {
43
- const names = (0, utils_1.generateGenericTeamNames)(country.locales, TeamGenerator.TEAM_PER_DIVISION);
42
+ static createTeams(divisionId, country, count = TeamGenerator.TEAM_PER_DIVISION) {
43
+ if (count <= 0)
44
+ return [];
45
+ const names = (0, utils_1.generateGenericTeamNames)(country.locales, count);
44
46
  logger_1.default.info(`Creating teams for division: ${divisionId}`);
45
47
  return names.map((name) => {
46
48
  logger_1.default.info(`Creating players for team: ${name}`);
@@ -10,7 +10,7 @@ export declare class TeamGenerator {
10
10
  private static getFormation;
11
11
  private static comparePlayers;
12
12
  static createRoster(country: Country): Player[];
13
- static createTeams(divisionId: string, country: Country): Team[];
13
+ static createTeams(divisionId: string, country: Country, count?: number): Team[];
14
14
  static readonly BOT_SUB_BANDS: EnergyBand[];
15
15
  static createTactics(roster: Player[]): Tactics;
16
16
  private static createLineup;
@@ -33,8 +33,10 @@ export class TeamGenerator {
33
33
  static createRoster(country) {
34
34
  return TeamGenerator.RARITIES.map((rarity, i) => PlayerGenerator.generatePlayer(country, rarity, this.ROLES[i % TeamGenerator.ROLES.length]));
35
35
  }
36
- static createTeams(divisionId, country) {
37
- const names = generateGenericTeamNames(country.locales, TeamGenerator.TEAM_PER_DIVISION);
36
+ static createTeams(divisionId, country, count = TeamGenerator.TEAM_PER_DIVISION) {
37
+ if (count <= 0)
38
+ return [];
39
+ const names = generateGenericTeamNames(country.locales, count);
38
40
  logger.info(`Creating teams for division: ${divisionId}`);
39
41
  return names.map((name) => {
40
42
  logger.info(`Creating players for team: ${name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.409",
3
+ "version": "0.0.411",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",