Skip to content

Commit

Permalink
Support loading modules from other directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
gimite committed Aug 17, 2015
1 parent 242b5f1 commit a6ce6c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion coffee/archive.coffee
Expand Up @@ -30,7 +30,7 @@ class Archive extends Game
@playLight(onLightAction)

getLightActions: ->
actins = []
actions = []
@playLight (action) ->
actions.push(action)
return actions
Expand Down
4 changes: 2 additions & 2 deletions coffee/danger_estimator.coffee
Expand Up @@ -257,8 +257,8 @@ class Scene

class DangerEstimator

constructor: ->
@_root = JSON.parse(fs.readFileSync("../share/danger_tree.all.json").toString("utf-8"))
constructor: (baseDir) ->
@_root = JSON.parse(fs.readFileSync("#{baseDir}/share/danger_tree.all.json").toString("utf-8"))

getScene: (game, me, target) ->
return new Scene(game, me, target)
Expand Down
8 changes: 4 additions & 4 deletions coffee/manue_ai.coffee
Expand Up @@ -17,11 +17,11 @@ Util = require("./util")

class ManueAI extends AI

constructor: ->
@_stats = JSON.parse(fs.readFileSync("../share/game_stats.json").toString("utf-8"))
constructor: (baseDir = "..") ->
@_stats = JSON.parse(fs.readFileSync("#{baseDir}/share/game_stats.json").toString("utf-8"))
@_stats = Util.mergeObjects(
@_stats, JSON.parse(fs.readFileSync("../share/light_game_stats.json").toString("utf-8")))
@_dangerEstimator = new DangerEstimator()
@_stats, JSON.parse(fs.readFileSync("#{baseDir}/share/light_game_stats.json").toString("utf-8")))
@_dangerEstimator = new DangerEstimator(baseDir)
@_tenpaiProbEstimator = new TenpaiProbEstimator(@_stats)
@_noChanges = (0 for _ in [0...4])

Expand Down

0 comments on commit a6ce6c3

Please sign in to comment.