コード例 #1
0
ファイル: Field.cs プロジェクト: rbxiu8/RBX_Project
 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);
 }
コード例 #2
0
ファイル: Robot.cs プロジェクト: rbxiu8/RBX_Project
 void GoTo(Vector pos)
 {
     location = pos;
 }
コード例 #3
0
ファイル: Robot.cs プロジェクト: rbxiu8/RBX_Project
 void FireTo(Vector pos)
 {
     Bullet bullet = new Bullet(location, pos, firepower);
 }
コード例 #4
0
ファイル: Robot.cs プロジェクト: rbxiu8/RBX_Project
 public Robot(String sdll, Vector slocation)
 {
     dll = sdll;
     location = slocation;
 }
コード例 #5
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public Vector(Vector a)
 {
     x = a.x;
     y = a.y;
 }
コード例 #6
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public Vector GetNormalize()
 {
     Vector vec = new Vector(this);
     vec.Normalize();
     return vec;
 }
コード例 #7
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 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;
 }
コード例 #8
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public float Dot(Vector v)
 {
     return x * v.x + y * v.y;
 }
コード例 #9
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public Vector Cross(Vector v)
 {
     return new Vector((y * v.x) - (x * v.y), (x * v.y) - (y * v.x));
 }
コード例 #10
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
        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;
        }
コード例 #11
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public static Vector Normalize(Vector v)
 {
     return v.GetNormalize();
 }
コード例 #12
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public static float Dot(Vector a, Vector b)
 {
     return a.Dot(b);
 }
コード例 #13
0
ファイル: Vector.cs プロジェクト: reged/RBXSolution
 public static Vector Cross(Vector a, Vector b)
 {
     return a.Cross(b);
 }