{"size": 3821, "ext": "js", "max_stars_repo_path": "gameSystems/starfinder1e/service/index.js", "max_stars_repo_name": "thzero/societySidekick-server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "gameSystems/starfinder1e/service/index.js", "max_issues_repo_name": "thzero/societySidekick-server", "max_issues_repo_issues_event_min_datetime": "2020-09-05T14:23:47.000Z", "max_issues_repo_issues_event_max_datetime": "2020-10-03T13:22:35.000Z", "max_forks_repo_path": "gameSystems/starfinder1e/service/index.js", "max_forks_repo_name": "thzero/societySidekick-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 43.4204545455, "max_line_length": 144, "alphanum_fraction": 0.8317194452}
import Constants from '../../../constants';

import BaseGameSystemGameSystemsService from '../../service/base';

class Starfinder1eGameSystemGameSystemsService extends BaseGameSystemGameSystemsService {
	constructor() {
		super();

		this._serviceCharacters = null;
		this._serviceCharactersValidation = null;
		this._serviceScenarios = null;
		this._serviceScenariosValidation = null;
		this._serviceValidation = null;
	}

	async init(injector) {
		await super.init(injector);

		this._serviceCharacters = this._injector.getService(Constants.InjectorKeys.SERVICE_GAMESYSTEMS_CHARACTERS_STARFINDER_1E);
		this._serviceCharactersValidation = this._injector.getService(Constants.InjectorKeys.SERVICE_GAMESYSTEMS_CHARACTERS_VALIDATION_STARFINDER_1E);
		this._serviceScenarios = this._injector.getService(Constants.InjectorKeys.SERVICE_GAMESYSTEMS_SCENARIOS_STARFINDER_1E);
		this._serviceScenariosValidation = this._injector.getService(Constants.InjectorKeys.SERVICE_GAMESYSTEMS_SCENARIOS_VALIDATION_STARFINDER_1E);
		this._serviceValidation = this._injector.getService(Constants.InjectorKeys.SERVICE_GAMESYSTEMS_VALIDATION_STARFINDER_1E);
	}

	determineCharactersService(correlationId) {
		return this._successResponse(this._serviceCharacters, correlationId);
	}

	determineScenariosService(correlationId) {
		return this._successResponse(this._serviceScenarios, correlationId);
	}

	determineCharactersValidation(correlationId, type) {
		switch (type) {
			case Constants.ValidationSchemaTypes.CharacterDetailsUpdate:
				return this._serviceCharactersValidation.characterDetailUpdateSchema();
			case Constants.ValidationSchemaTypes.CharacterInventoryCreate:
				return this._serviceCharactersValidation.characterInventoryCreateSchema();
			case Constants.ValidationSchemaTypes.CharacterInventoryUpdate:
				return this._serviceCharactersValidation.characterInventoryUpdateSchema();
			case Constants.ValidationSchemaTypes.CharacterScenarioCreate:
				return this._serviceCharactersValidation.characterScenarioCreateSchema();
			case Constants.ValidationSchemaTypes.CharacterScenarioUpdate:
				return this._serviceCharactersValidation.characterScenarioUpdateSchema();
		}
		return null;
	}

	determineScenariosValidation(correlationId, type) {
		switch (type) {
			case Constants.ValidationSchemaTypes.ScenarioCreate:
				return this._serviceScenariosValidation.scenarioCreateSchema();
			case Constants.ValidationSchemaTypes.ScenarioSearch:
				return this._serviceScenariosValidation.scenarioSearchSchema();
			case Constants.ValidationSchemaTypes.ScenarioUpdate:
				return this._serviceScenariosValidation.scenarioUpdateSchema();
		}
		return null;
	}

	determineValidation(correlationId, type) {
		switch (type) {
			case Constants.ValidationSchemaTypes.BoonCreate:
				return this._serviceValidation.boonCreatechema();
			case Constants.ValidationSchemaTypes.BoonUpdate:
				return this._serviceValidation.boonUpdateSchema();
			case Constants.ValidationSchemaTypes.ClassCreate:
				return this._serviceValidation.classCreatechema();
			case Constants.ValidationSchemaTypes.ClassUpdate:
				return this._serviceValidation.classUpdateSchema();
			case Constants.ValidationSchemaTypes.EquipmentCreate:
				return this._serviceValidation.equipmentCreatechema();
			case Constants.ValidationSchemaTypes.EquipmentUpdate:
				return this._serviceValidation.equipmentUpdateSchema();
			case Constants.ValidationSchemaTypes.FactionCreate:
				return this._serviceValidation.factionCreatechema();
			case Constants.ValidationSchemaTypes.FactionUpdate:
				return this._serviceValidation.factionUpdateSchema();
			case Constants.ValidationSchemaTypes.UserSettingsSchema:
				return this._serviceValidation.settingScenariosAdditionalSchema();
		}
		return null;
	}
}

export default Starfinder1eGameSystemGameSystemsService;
