Skip to content

Commit

Permalink
update(ExternalScriptComponent):has-funtion
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuLivebardon committed Jun 16, 2023
1 parent 4f23755 commit 84cc347
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/shared/src/Game/Component/ExternalScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ const Script = require('./Script');
*
* @see module:ExternalScript
*/
const ExternalScriptComponent = class extends Component {};
const ExternalScriptComponent = class extends Component {
/**
* This function checks if an external script ID is included in the model's list of script IDs.
*
* @param {string} externalIDScript - string contains externalscrip.ID_SCRIPT
* @returns {boolean } - Return a boolean indicating whether an external script exists in id_scripts of component
*/
has(externalIDScript) {
return this.getModel().getIdScripts().includes(externalIDScript);
}
};

ExternalScriptComponent.TYPE = 'ExternalScript';

Expand Down

0 comments on commit 84cc347

Please sign in to comment.