public static ThreeD operator +(ThreeD op1, int op2) { ThreeD result = new ThreeD(); result.x = op1.x + op2; result.y = op1.y + op2; result.z = op1.z + op2; return(result); }
static void Main(string[] args) { ThreeD ob1 = ThreeD.Fabrica(1, 2, 5); ThreeD ob2 = ThreeD.Fabrica(5, -5, 10); ThreeD ob3 = ob1 + ob2; ob3.Show(); ThreeD ob4 = ob1 + 5; ob4.Show(); Console.ReadKey(); }
static public ThreeD Fabrica() { ThreeD t = new ThreeD(); return(t); }
static public ThreeD Fabrica(int i, int j, int k) { ThreeD t = new ThreeD(i, j, k); return(t); }