package com.torn.enemy;

/* 制御情報を持つAtom */
public class MovableAtom {

	private Atom atom;
	private double r; /* 誤差をなくすために固定値を保持 */
	private double alpha;
	public int t;

	public MovableAtom(Atom atom) {
		this.atom = atom;
		r = Math.sqrt(atom.x * atom.x + atom.y * atom.y);
		t = 1;
		
		if (atom.y >= 0) {
			alpha = Math.acos(atom.x / r);
		} else {
			alpha = - Math.acos(atom.x / r);
		}
	}
	public Atom getAtom() {
		return atom;
	}
	public double getX() {
		return atom.x;
	}
	public double getY() {
		return atom.y;
	}
	public double getR() {
		return r;
	}
	public void setAtom(double x, double y, boolean update) {
		if (update) {
			updateParam();
		}
		atom.x = x;
		atom.y = y;
	}
	
	private void updateParam() {
	}
	public double getAlpha() {
		return alpha;
	}
}
