Initial commit
This commit is contained in:
38
resources/js/SubmissionsClass/GameSelector.js
Normal file
38
resources/js/SubmissionsClass/GameSelector.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Handle new game already selected.
|
||||
*
|
||||
* @param {Object} initialContent With gameName, gamePlatformId and gameGenreId field.
|
||||
* @returns {Object}
|
||||
*/
|
||||
export function GameSelector(){
|
||||
return {
|
||||
|
||||
/**
|
||||
* Game Name
|
||||
* @type {string|null}
|
||||
*/
|
||||
name: null,
|
||||
|
||||
/**
|
||||
* Game Platform Id.
|
||||
* @type {number|null}
|
||||
*/
|
||||
platformId: null,
|
||||
|
||||
/**
|
||||
* Game genre Id.
|
||||
* @type {number|null}
|
||||
*/
|
||||
genreId: null,
|
||||
|
||||
/**
|
||||
* Initialize game selector.
|
||||
* @param initialContent
|
||||
*/
|
||||
init( initialContent = {} ){
|
||||
this.name = initialContent.name ?? null;
|
||||
this.platformId = Number(initialContent.platformId) ?? null;
|
||||
this.genreId = Number(initialContent.genreId) ?? null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user