PageRenderTime 37ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/WorldView/Structures/Rect.cs

#
C# | 45 lines | 39 code | 6 blank | 0 comment | 0 complexity | c878d89ef7446a7b239bae5455bcd95f MD5 | raw file
  1. using System;
  2. using System.Drawing;
  3. namespace MoreTerra.Structures
  4. {
  5. public class Rect
  6. {
  7. private Point topLeft;
  8. private Point bottomRight;
  9. #region Constructors
  10. public Rect(int left, int right, int top, int bottom)
  11. {
  12. this.topLeft = new Point(left, top);
  13. this.bottomRight = new Point(right, bottom);
  14. }
  15. #endregion
  16. #region GetSet Functions
  17. public Point TopLeft
  18. {
  19. get
  20. {
  21. return this.topLeft;
  22. }
  23. }
  24. public Point BottomRight
  25. {
  26. get
  27. {
  28. return this.bottomRight;
  29. }
  30. }
  31. #endregion
  32. #region Overrides
  33. public override string ToString()
  34. {
  35. return string.Format("{0},{1}", this.topLeft, this.bottomRight);
  36. }
  37. #endregion
  38. }
  39. }