The only other issue I can think of is if the input string already contains '\0' characters to start with, but since the use case here is primarily text, that shouldn't crop up very often, if at all. We're not parsing binary data after all.
So you're saying that I shouldn't casually slip null characters into strings I'm planning on processing? Now how am I supposed to hide morse code encoded in null characters!
var spadeDeck = Link(cardPack) .filterBy('suit', 'spade') .shuffle();
var targets = Link(this.aic.battle.enemiesOf(this.aic.unit)).shuffle();var combos = Link(Link(this.combos) .where(function(combo) { return this.phase >= combo.phase; }.bind(this)) .random(targets.length)) .sort(function(a, b) { return b.rating - a.rating; });this.tactics = [];for (var i = 0; i < party.length; ++i) { this.tactics.push({ moves: combos[i].moves, moveIndex: 0, unit: targets[i] });}
I'm sure without Link, this would've been a bit harder for you to realize in code what you had in your head. This all sounds great! This is exactly what I made the original Query library for, before it turned into this.
this.combos = [ { phase: 1, moves: [ 'electrocute', 'heal' ], rating: 1 }, { phase: 1, moves: [ 'hellfire', 'windchill' ], rating: 2 }, { phase: 1, moves: [ 'windchill', 'hellfire' ], rating: 2 }, { phase: 2, weaponID: 'powerBow', moves: [ 'flareShot', 'chillShot' ], rating: 2 }, // ...and so on];