Refactor ModVersion into Mod and ModVersion
* Remove V1 of the mod version parser and shift V2 up to be V1 * Add a parser for mod.cg files, and refactor the the mod-version.cg files to push the appropriate content up to the mod.cg * Remove the concept of "silent" from BaseModel along with logging each event as they are fired (which is what really prompted the need for it in the first place) * Move use of the Storage class to be completely the province of the controllers most closely related to models affected * Convert the ModVersionController to the ModController and have it take on responsibility for choosing the mod version * Update BaseModel to support simple accessors for the current state * Update CraftingPlan to be able to remove uncraftable items * Implement the Mod model
This commit is contained in:
@@ -6,8 +6,9 @@ All rights reserved.
|
||||
###
|
||||
|
||||
CraftingPlan = require '../src/scripts/models/crafting_plan'
|
||||
ModVersion = require '../src/scripts/models/mod_version'
|
||||
Mod = require '../src/scripts/models/mod'
|
||||
ModPack = require '../src/scripts/models/mod_pack'
|
||||
ModVersion = require '../src/scripts/models/mod_version'
|
||||
|
||||
########################################################################################################################
|
||||
|
||||
@@ -18,9 +19,10 @@ modPack = plan = null
|
||||
describe 'CraftingPlan', ->
|
||||
|
||||
beforeEach ->
|
||||
modVersion = new ModVersion name:'Minecraft', version:'1.7.10'
|
||||
modVersion.parse """
|
||||
schema:2; name:Minecraft; version:1.7.10
|
||||
mod = new Mod name:'Minecraft'
|
||||
mod.addModVersion new ModVersion modSlug:mod.slug, version:'1.7.10'
|
||||
mod.activeModVersion.parse """
|
||||
schema:1
|
||||
|
||||
item:Oak Plank; recipe:; input:Oak Log; pattern:... .0. ...; quantity:4
|
||||
item:Stick; recipe:; input:Oak Plank; pattern:... .0. .0.; quantity:4
|
||||
@@ -30,7 +32,7 @@ describe 'CraftingPlan', ->
|
||||
item:Iron Sword; recipe:; input:Iron Ingot, Stick; pattern:.0. .0. .1.; tools:Crafting Table
|
||||
"""
|
||||
modPack = new ModPack
|
||||
modPack.addModVersion modVersion
|
||||
modPack.addMod mod
|
||||
|
||||
plan = new CraftingPlan modPack:modPack, includingTools:false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user