Beispiel #1
0
CodeNames.prototype.getName = function getName(opts) {
    opts = opts || {};
    
    // Setup some specific defaults
    if (!this.haveData) {
        Logger.info("getName called before we had code name data");
        return opts.defaultName;
    }

    setDefOpt(opts, "style", this.defaultStyle);
    
    var styleFunc = this["style_"+opts.style];
    if (typeof styleFunc !== "function") {
        Logger.errori("Invalid code name style '",opts.style,"'");
        return opts.defaultName;
    }
    
    return styleFunc.call(this, opts);
}
Beispiel #2
0
 this.reader.on("error", function onError(err) {
     Logger.info("code name word list data read error");
     Logger.logErrorObj("Reading code name word list", err);        
 });