<commit_before>Lux.conditional_batch = function(batch, condition)
{
    return {
        draw: function() {
            if (condition()) batch.draw();
        }
    };
};

Lux.conditional_actor = function(opts)
{
    var appearance = opts.appearance;
    var model = opts.model;
    var condition = opts.condition;
    var actor = Lux.actor(opts);
    actor.dress = function(scene) {
        var xform = scene.get_transform();
        var this_appearance = xform(appearance);
        var batch = Lux.bake(model, this_appearance);
        return Lux.conditional_batch(batch, condition);
    };
    return actor;
};<commit_msg>conditional_actor now written as simple lux.actor variant<commit_after>Lux.conditional_batch = function(batch, condition)
{
    return {
        draw: function() {
            if (condition()) batch.draw();
        }
    };
};

Lux.conditional_actor = function(opts)
{
    opts = _.clone(opts);
    opts.bake = function(model, changed_appearance) {
        return Lux.conditional_batch(Lux.bake(model, changed_appearance), opts.condition);
    };
    return Lux.actor(opts);
};
{'fraction_non_alphanumeric': 0.12522686025408347, 'fraction_numerical': 0.0, 'mean_word_length': 2.9392857142857145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7031454', 'n_tokens_mistral': 335, 'n_tokens_neox': 327, 'n_words': 68}