Skip to content

Instantly share code, notes, and snippets.

@cutecycle
Last active February 28, 2016 03:38
Show Gist options
  • Save cutecycle/1c36ca2edca29478d861 to your computer and use it in GitHub Desktop.
Save cutecycle/1c36ca2edca29478d861 to your computer and use it in GitHub Desktop.
line is a function, entity is not: line 37
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