reldens
Version:
Reldens - MMORPG Platform
77 lines (69 loc) • 2.25 kB
JavaScript
/**
*
* Reldens - ClanLevelsModifiersEntity
*
*/
const { EntityProperties } = require('../../../game/server/entity-properties');
const { sc } = require('@reldens/utils');
class ClanLevelsModifiersEntity extends EntityProperties
{
static propertiesConfig(extraProps)
{
let titleProperty = 'key';
let properties = {
id: {},
level_id: {
type: 'reference',
reference: 'clan_levels',
isRequired: true
},
[titleProperty]: {
isRequired: true
},
property_key: {
isRequired: true
},
operation: {
availableValues: [
{value: 1, label: 'Increment'},
{value: 2, label: 'Decrease'},
{value: 3, label: 'Divide'},
{value: 4, label: 'Multiply'},
{value: 5, label: 'Increment Percentage'},
{value: 6, label: 'Decrease Percentage'},
{value: 7, label: 'Set'},
{value: 8, label: 'Method'},
{value: 9, label: 'Set Number'}
],
isRequired: true
},
value: {
isRequired: true
},
minValue: {},
maxValue: {},
minProperty: {},
maxProperty: {},
};
let showProperties = Object.keys(properties);
let listProperties = [...showProperties];
let editProperties = [...showProperties];
listProperties = sc.removeFromArray(listProperties, [
'minValue',
'maxValue',
'minProperty',
'maxProperty'
]);
editProperties.splice(editProperties.indexOf('id'), 1);
return {
showProperties,
editProperties,
listProperties,
filterProperties: listProperties,
properties,
titleProperty,
...extraProps
};
}
}
module.exports.ClanLevelsModifiersEntity = ClanLevelsModifiersEntity;