<commit_before>package com.whoshuu.artbox.system;

import android.graphics.Bitmap;
import android.graphics.Rect;

import com.whoshuu.artbox.artemis.ComponentMapper;
import com.whoshuu.artbox.artemis.Entity;
import com.whoshuu.artbox.component.SpriteComponent;
import com.whoshuu.artbox.component.PositionComponent;
import com.whoshuu.artbox.component.RenderComponent;
import com.whoshuu.artbox.util.SizeUtil;

public class SpriteRenderSystem extends RenderSystem {

    @SuppressWarnings("unchecked")
    public SpriteRenderSystem() {
        super(PositionComponent.class, SpriteComponent.class, RenderComponent.class);
    }

    @Override
    protected void initialize() {
        dest = new Rect();
        this.positions = new ComponentMapper<PositionComponent>(PositionComponent.class,
        this.world);
        this.bitmaps = new ComponentMapper<SpriteComponent>(SpriteComponent.class, this.world);
        super.initialize();
    }

    @Override
    protected void processEntity(Entity entity) {
        PositionComponent position = positions.get(entity);
        SpriteComponent bitmapComponent = bitmaps.get(entity);
        Bitmap bitmap = bitmapComponent.getBitmap();
        Rect source = bitmapComponent.getSource();

        float x = SizeUtil.getRenderX(position.getX());
        float y = SizeUtil.getRenderY(position.getY());

        dest.set((int) x - (source.width() / 2),
                (int) y - (source.height() / 2),
                (int) x + (source.width() / 2),
                (int) y + (source.height() / 2));

        canvas.rotate((float) - Math.toDegrees(position.getAngle()), x, y);
        canvas.drawBitmap(bitmap, source, dest, null); 
        canvas.rotate((float) Math.toDegrees(position.getAngle()), x, y);
    }

    private Rect dest;
    private ComponentMapper<PositionComponent> positions;
    private ComponentMapper<SpriteComponent> bitmaps;
}<commit_msg>Change style<commit_after>package com.whoshuu.artbox.system;

import android.graphics.Bitmap;
import android.graphics.Rect;

import com.whoshuu.artbox.artemis.ComponentMapper;
import com.whoshuu.artbox.artemis.Entity;
import com.whoshuu.artbox.component.SpriteComponent;
import com.whoshuu.artbox.component.PositionComponent;
import com.whoshuu.artbox.component.RenderComponent;
import com.whoshuu.artbox.util.SizeUtil;

public class SpriteRenderSystem extends RenderSystem {

    @SuppressWarnings("unchecked")
    public SpriteRenderSystem() {
        super(PositionComponent.class, SpriteComponent.class, RenderComponent.class);
    }

    @Override
    protected void initialize() {
        dest = new Rect();
        this.positions = new ComponentMapper<PositionComponent>(PositionComponent.class,
        this.world);
        this.bitmaps = new ComponentMapper<SpriteComponent>(SpriteComponent.class, this.world);
        super.initialize();
    }

    @Override
    protected void processEntity(Entity entity) {
        PositionComponent position = positions.get(entity);
        SpriteComponent bitmapComponent = bitmaps.get(entity);
        Bitmap bitmap = bitmapComponent.getBitmap();
        Rect source = bitmapComponent.getSource();

        float x = SizeUtil.getRenderX(position.getX());
        float y = SizeUtil.getRenderY(position.getY());

        dest.set((int) x - (source.width() / 2),
                 (int) y - (source.height() / 2),
                 (int) x + (source.width() / 2),
                 (int) y + (source.height() / 2));

        canvas.rotate((float) - Math.toDegrees(position.getAngle()), x, y);
        canvas.drawBitmap(bitmap, source, dest, null); 
        canvas.rotate((float) Math.toDegrees(position.getAngle()), x, y);
    }

    private Rect dest;
    private ComponentMapper<PositionComponent> positions;
    private ComponentMapper<SpriteComponent> bitmaps;
}
{'fraction_non_alphanumeric': 0.11635220125786164, 'fraction_numerical': 0.0020964360587002098, 'mean_word_length': 3.3823191733639493, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '411649', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1056, 'n_words': 211}