public Field(Int32 field_width, Int32 field_height) { center = new Vector(width / 2, height / 2); corner_left_top = new Vector(0,0); corner_right_top = new Vector(width, 0); corner_left_bottom = new Vector(0, height); corner_rigth_bottom = new Vector(width, height); side_left_center = new Vector(0, height / 2); side_rigth_center = new Vector(width, height / 2); side_bottom_center = new Vector(width / 2, height); side_top_center = new Vector(width / 2, 0); }
void GoTo(Vector pos) { location = pos; }
void FireTo(Vector pos) { Bullet bullet = new Bullet(location, pos, firepower); }
public Robot(String sdll, Vector slocation) { dll = sdll; location = slocation; }
public Vector(Vector a) { x = a.x; y = a.y; }
public Vector GetNormalize() { Vector vec = new Vector(this); vec.Normalize(); return vec; }
public bool Equals(Vector a, float epsilon) { if (Math.Abs(x - a.x) > epsilon) return false; if (Math.Abs(y - a.y) > epsilon) return false; return true; }
public float Dot(Vector v) { return x * v.x + y * v.y; }
public Vector Cross(Vector v) { return new Vector((y * v.x) - (x * v.y), (x * v.y) - (y * v.x)); }
public void Clamp(Vector min, Vector max) { if (x < min.x) x = min.x; else if (x > max.x) x = max.x; if (y < min.y) y = min.y; else if (y > max.y) y = max.y; }
public static Vector Normalize(Vector v) { return v.GetNormalize(); }
public static float Dot(Vector a, Vector b) { return a.Dot(b); }
public static Vector Cross(Vector a, Vector b) { return a.Cross(b); }