<commit_before>package Engine;

import java.io.Serializable;

/**
 * Encapsulation for the Tank class so that we can restrict
 * the player's access to it. However, the drawback is that
 * the tank objects have to be separately created in the entityList
 * from the GameEntity interface. Instances of this class will select
 * a Tank object from the entityList in order.
 * 
 */
public class TankCapsule implements Serializable {
    private Tank tank;
    private transient int index;
    
    public TankCapsule(){
        synchronized(GameEntity.entityList) {
            if(GameEntity.entityList.size()>0){
                if(GameEntity.currentIndex < GameEntity.entityList.size()){
                    index = GameEntity.currentIndex;
                    tank = (Tank)GameEntity.entityList.get(GameEntity.currentIndex++);
                    tank.setTankCapsule(this);
                }
            }
        }
    }
    
    public void gotHitByBullet() {} 
    public void hitArenaWall() {} 
    public void hitEnemyTank() {} 
    public void detectedEnemyTank(double enemyAngle) {} 
    
    public final void moveFront(){
        tank.moveFront();
    }
    
    public final void rotate(double degrees){
        tank.rotate(degrees);
    }
    
    public final void rotateCannon(double degrees){
        tank.rotateCannon(degrees);
    }
    public final double getLife(){
        return tank.getLife();
    };
    public final double getEnergy(){
        return tank.getEnergy();
    }
    public final void fire(){
            Bullet b = tank.fire();
            
            if (b != null) {
            synchronized (GameEntity.entityList) {
                GameEntity.entityList.add(b);
            }
        }
    }
}
<commit_msg>New functions for inteligence template<commit_after>package Engine;

import java.io.Serializable;

/**
 * Encapsulation for the Tank class so that we can restrict
 * the player's access to it. However, the drawback is that
 * the tank objects have to be separately created in the entityList
 * from the GameEntity interface. Instances of this class will select
 * a Tank object from the entityList in order.
 * 
 */
public class TankCapsule implements Serializable {
    private Tank tank;
    private transient int index;
    
    public TankCapsule(){
        synchronized(GameEntity.entityList) {
            if(GameEntity.entityList.size()>0){
                if(GameEntity.currentIndex < GameEntity.entityList.size()){
                    index = GameEntity.currentIndex;
                    tank = (Tank)GameEntity.entityList.get(GameEntity.currentIndex++);
                    tank.setTankCapsule(this);
                }
            }
        }
    }
    
    public void gotHitByBullet() {} 
    public void hitArenaWall() {} 
    public void hitEnemyTank() {} 
    public void detectedEnemyTank(double enemyAngle) {} 
    
    public final void moveFront(){
        tank.moveFront();
    }
    
    public final void rotate(double degrees){
        tank.rotate(degrees);
    }
    
    public final void rotateCannon(double degrees){
        tank.rotateCannon(degrees);
    }
    public final double getLife(){
        return tank.getLife();
    };
    public final double getEnergy(){
        return tank.getEnergy();
    }
    public final double getAngle(){
      return tank.getAngle();
    };
    public final void fire(){
            Bullet b = tank.fire();
            
            if (b != null) {
            synchronized (GameEntity.entityList) {
                GameEntity.entityList.add(b);
            }
        }
    }
}

{'fraction_non_alphanumeric': 0.08880846325167038, 'fraction_numerical': 0.0005567928730512249, 'mean_word_length': 2.0894239036973343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5557624', 'n_tokens_mistral': 986, 'n_tokens_neox': 957, 'n_words': 272}