find(ident) { const searchFor = util.identWithoutPosition(ident); const matches = this.allmon.filter( (mon) => { return searchFor === mon.ident; }); if (matches.length > 1) { Log.error('Found multiple mons with the same ident! o f**k'); Log.error(matches); } return matches[0]; }
useIdent(ident) { this.ident = util.identWithoutPosition(ident); // for convenience this.owner = util.identToOwner(ident); this.position = util.identToPos(ident); this.nickname = ident.substr(ident.indexOf(' ') + 1); }