getNextSpriteInPool method

RenderableSprite getNextSpriteInPool()

Implementation

RenderableSprite getNextSpriteInPool() {
  if (_spriteCount == _spritePoolLength) {
    RenderableSprite sprite = RenderableSprite();
    _spritePool.add(sprite);
    _spritePoolLength++;
    _spriteCount++;
    return sprite;
  }
  return _spritePool[_spriteCount++];
}