⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locatablemission.java

📁 很好的windows驱动开发书记,基于WDM的,,可以很好的学习
💻 JAVA
字号:
package bb;

import java.util.*;

/*
A special subclass of missions that also has an associated location.
It also has a "range" argument which indicates how close the 
agents should get to the target position.

@author naimad
*/

public class LocatableMission extends Mission {

    Vec2 targetPos;
    double range = 15.0;	//optional range. How close should we get?

    public LocatableMission(String skillname, int number, double priority, Vec2 targetPos) {
        super(skillname, number, priority);
        this.targetPos = new Vec2(targetPos);
    }

    public LocatableMission(String skillname, int number, double priority, Vec2 targetPos, double range) {
		this(skillname, number, priority, targetPos);
		this.range = range;
    }

    public void setTargetPosition(Vec2 newpos) {
        targetPos.set(newpos);
    }

    public void getTargetPosition(Vec2 inplace) {
        inplace.set(targetPos);
    }

    public void setRange(double range) {
    	this.range = range;
    }
    
    public double getRange() {
    	return range;
    }
    
    public String toString() {
        return super.toString() + " at " + targetPos;   
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -