<commit_before>package com.lukzdev.grow.model.entities;

import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.utils.Array;
import com.lukzdev.grow.model.EntityManager;
import com.lukzdev.grow.model.PhysicsObject;

/**
 * @author <NAME>, @lukz_dev on 2016-01-17.
 */
public class Tree {

    private Array<Branch> branches;

    // Simply first branch
    private Branch trunk;

    private EntityManager entityManager;

    public Tree(EntityManager entityManager) {
        this.entityManager = entityManager;

        branches = new Array<Branch>();
    }

    public void addBranch(Branch branch) {
        if(branches.size == 0) {
            trunk = branch;
        }

        branches.add(branch);
    }

    /**
     * Pushes all tree branches with specified force to crash opponents into planet.
     * @param force
     */
    public void smackPlanet(float force) {
        for(int i = 0; i < branches.size; i++) {
            Body body = branches.get(i).getBody();
            body.applyLinearImpulse(force, 0, body.getPosition().x, body.getPosition().y, true);
        }
    }

    /**
     * Removes last branch from tree
     */
    public void getHit() {
        Entity branch = branches.pop();<commit_msg>Empty array fix<commit_after>package com.lukzdev.grow.model.entities;

import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.utils.Array;
import com.lukzdev.grow.model.EntityManager;
import com.lukzdev.grow.model.PhysicsObject;

/**
 * @author <NAME>, @lukz_dev on 2016-01-17.
 */
public class Tree {

    private Array<Branch> branches;

    // Simply first branch
    private Branch trunk;

    private EntityManager entityManager;

    public Tree(EntityManager entityManager) {
        this.entityManager = entityManager;

        branches = new Array<Branch>();
    }

    public void addBranch(Branch branch) {
        if(branches.size == 0) {
            trunk = branch;
        }

        branches.add(branch);
    }

    /**
     * Pushes all tree branches with specified force to crash opponents into planet.
     * @param force
     */
    public void smackPlanet(float force) {
        for(int i = 0; i < branches.size; i++) {
            Body body = branches.get(i).getBody();
            body.applyLinearImpulse(force, 0, body.getPosition().x, body.getPosition().y, true);
        }
    }

    /**
     * Removes last branch from tree
     */
    public void getHit() {
        if(branches.size == 0) return;

        Entity branch = branches.pop();
{'fraction_non_alphanumeric': 0.11624203821656051, 'fraction_numerical': 0.009952229299363057, 'mean_word_length': 2.4566712517193947, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '7243256', 'n_tokens_mistral': 788, 'n_tokens_neox': 761, 'n_words': 184}