<commit_before>package org.jtrfp.trcl.beh;

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.jtrfp.trcl.beh.phy.MovesByVelocity;
import org.jtrfp.trcl.obj.Player;
import org.jtrfp.trcl.obj.WorldObject;

public class AdjustAltitudeToPlayerBehavior extends Behavior {
    private final Player player;
    private Vector3D DOWN=new Vector3D(0,-40000,0),UP=new Vector3D(0,40000,0);;
    public AdjustAltitudeToPlayerBehavior(Player player){
	this.player=player;
    }//end AdjustAltitudeToPlayerBehavior
    
    @Override
    public void _tick(long tickTimeInMillis){
	final WorldObject thisObject = getParent();
	final boolean up=player.getPosition()[1]>thisObject.getPosition()[1];
	    thisObject.getBehavior().probeForBehavior(MovesByVelocity.class).accellerate(up?UP:DOWN);
    }//end _tick(...)

    public AdjustAltitudeToPlayerBehavior setAccelleration(int accelleration) {
	UP=new Vector3D(0,accelleration,0);
	DOWN=new Vector3D(0,-accelleration,0);
	return this;
    }//end setAccelleration
}//end AdjustAltitudeToPlayerBehavior<commit_msg>Added reversal mode to AdjustAltitudeToPlayerBehavior.<commit_after>package org.jtrfp.trcl.beh;

import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.jtrfp.trcl.beh.phy.MovesByVelocity;
import org.jtrfp.trcl.obj.Player;
import org.jtrfp.trcl.obj.WorldObject;

public class AdjustAltitudeToPlayerBehavior extends Behavior {
    private final Player player;
    private Vector3D DOWN=new Vector3D(0,-80000,0),UP=new Vector3D(0,80000,0);
    private boolean reverse=false;
    public AdjustAltitudeToPlayerBehavior(Player player){
	this.player=player;
    }//end AdjustAltitudeToPlayerBehavior
    
    @Override
    public void _tick(long tickTimeInMillis){
	final WorldObject thisObject = getParent();
	final boolean up=(player.getPosition()[1]>thisObject.getPosition()[1])!=reverse;
	    thisObject.getBehavior().probeForBehavior(MovesByVelocity.class).accellerate(up?UP:DOWN);
    }//end _tick(...)

    public AdjustAltitudeToPlayerBehavior setAccelleration(int accelleration) {
	UP=new Vector3D(0,accelleration,0);
	DOWN=new Vector3D(0,-accelleration,0);
	return this;
    }//end setAccelleration

    public void setReverse(boolean reverse) {
	this.reverse=reverse;
    }
}//end AdjustAltitudeToPlayerBehavior
{'fraction_non_alphanumeric': 0.11010362694300518, 'fraction_numerical': 0.023316062176165803, 'mean_word_length': 5.638968481375358, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5277909', 'n_tokens_mistral': 789, 'n_tokens_neox': 746, 'n_words': 129}