Last active
February 28, 2016 03:38
-
-
Save cutecycle/1c36ca2edca29478d861 to your computer and use it in GitHub Desktop.
line is a function, entity is not: line 37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var world = function () { | |
//init | |
} | |
var self=this; | |
var entity = function(id) { | |
return entities_json.find(function(value) { | |
var pass = (value.entityid === id); | |
return pass; | |
}); | |
}, | |
var line = function(id) { | |
return lines_json.find(function(value) { | |
var pass = (value.lineid === id); | |
return pass; | |
}).line_text; | |
}, | |
var localeName = function(id) { | |
var obj = locales_json.find(function(value) { | |
var pass = (value.localeid === id); | |
return pass; | |
}); | |
return this.line(obj.localename); //we good | |
}, | |
var resolveLines = function(lineid) { | |
var line_search = lineid; | |
var lines_out = []; | |
var contiguous = true; | |
var previous_line = null; | |
var self = this; | |
var look = function(lineid) { | |
var find; | |
find = (lines_json.find( function(value) { | |
return (value.lineid === lineid); | |
})); | |
find.retrievedSpeaker = this.line(this.entity(find.speakerid).entityid); | |
lines_out.push(find); | |
if(find.advance_lineid !== "") { | |
look(find.advance_lineid); | |
} | |
} | |
look(lineid); | |
debugger; | |
return lines_out; | |
}, | |
module.exports.world = world; | |
module.exports.entity = entity; | |
module.exports.line = line; | |
module.exports.resolveLines = resolveLines; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment