mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-04 01:43:40 -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: ->
|
isRepeatable: ->
|
||||||
@get('proportionalTo')?
|
@get('proportionalTo')?
|
||||||
|
|
||||||
# TODO logic is duplicated in Mongoose Achievement schema
|
|
||||||
getExpFunction: ->
|
getExpFunction: ->
|
||||||
# TODO DEFAULTS
|
func = @get('function', true)
|
||||||
kind = @get('function')?.kind or jsonschema.properties.function.default.kind
|
return utils.functionCreators[func.kind](func.parameters) if func.kind of utils.functionCreators
|
||||||
parameters = @get('function')?.parameters or jsonschema.properties.function.default.parameters
|
|
||||||
return utils.functionCreators[kind](parameters) if kind of utils.functionCreators
|
|
||||||
|
|
||||||
@styleMapping:
|
@styleMapping:
|
||||||
1: 'achievement-wood'
|
1: 'achievement-wood'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue