mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Migrated Achievement model's getExpFunction to use the new defaults system.
This commit is contained in:
parent
f93ef2005e
commit
2dfe39aafd
1 changed files with 2 additions and 5 deletions
|
@ -9,12 +9,9 @@ module.exports = class Achievement extends CocoModel
|
|||
isRepeatable: ->
|
||||
@get('proportionalTo')?
|
||||
|
||||
# TODO logic is duplicated in Mongoose Achievement schema
|
||||
getExpFunction: ->
|
||||
# TODO DEFAULTS
|
||||
kind = @get('function')?.kind or jsonschema.properties.function.default.kind
|
||||
parameters = @get('function')?.parameters or jsonschema.properties.function.default.parameters
|
||||
return utils.functionCreators[kind](parameters) if kind of utils.functionCreators
|
||||
func = @get('function', true)
|
||||
return utils.functionCreators[func.kind](func.parameters) if func.kind of utils.functionCreators
|
||||
|
||||
@styleMapping:
|
||||
1: 'achievement-wood'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue