Initial version of the new crafting table

This commit is contained in:
Andrew Miner
2015-01-08 11:03:43 -08:00
parent 9f79722378
commit 9424af9d84
26 changed files with 280 additions and 228 deletions
+26
View File
@@ -0,0 +1,26 @@
###
Crafting Guide - recipe_step.coffee
Copyright (c) 2014 by Redwood Labs
All rights reserved.
###
BaseModel = require './base_model'
########################################################################################################################
module.exports = class RecipeStep extends BaseModel
constructor: (attributes={}, options={})->
if not attributes.recipe? then throw new Error 'attributes.recipe is required'
attributes.multiple ?= 1
super attributes, options
@recipe.on 'change', =>
@trigger 'change:recipe'
@trigger 'change'
# Public Methods ###############################################################################
getItemAt: (index)->
return @recipe.getItemAt index