public Chapter3() { PointLogic a = new PointLogic(5, 6, 7); PointLogic b = new PointLogic(10, 10, 10); PointLogic c = new PointLogic(0, 0, 0); Console.Write("Here is a: "); a.Show(); Console.Write("Here is b: "); b.Show(); Console.Write("Here is c: "); c.Show(); Console.WriteLine(); if (a) Console.WriteLine("a is true."); else Console.WriteLine("a is false."); if (b) Console.WriteLine("b is true."); else Console.WriteLine("b is false."); if (c) Console.WriteLine("c is true."); else Console.WriteLine("c is false."); Console.WriteLine(); Console.WriteLine("Control a loop using a ThreeD object."); do { b.Show(); b--; } while (b); }
// Overload unary --. public static PointLogic operator --(PointLogic op) { PointLogic result = new PointLogic(); // Return the decremented result. result.x = op.x - 1; result.y = op.y - 1; result.z = op.z - 1; return result; }
public HomeController() { _pointLogic = new PointLogic(); _gameLogic = new GameLogic(); }
public override bool IsNearby(PointLogic <MyLogicPresenter> other) { return(Math.Abs(_x - other.Presenter._x) <= 10); }