PageRenderTime 33ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/Samples/Breakout/Brick.cs

#
C# | 51 lines | 31 code | 4 blank | 16 comment | 0 complexity | 1e1143f71c6bf896de5f220c71bcb1a9 MD5 | raw file
Possible License(s): Apache-2.0
  1. using Delta.Utilities.Datatypes;
  2. namespace Breakout
  3. {
  4. /// <summary>
  5. /// Each brick can either be dead or alive, has a color and the bounding
  6. /// rectangle for rendering and collision detection.
  7. /// </summary>
  8. public class Brick
  9. {
  10. #region Public
  11. /// <summary>
  12. /// Was this brick already destroyed?
  13. /// </summary>
  14. public bool IsDead
  15. {
  16. get;
  17. set;
  18. }
  19. /// <summary>
  20. /// Color of the brick
  21. /// </summary>
  22. public Color Color
  23. {
  24. get;
  25. set;
  26. }
  27. /// <summary>
  28. /// Bounding box for the brick
  29. /// </summary>
  30. public Rectangle Bounds
  31. {
  32. get;
  33. set;
  34. }
  35. #endregion
  36. #region Constructor
  37. /// <summary>
  38. /// Creates a new brick without Bounds (has to be set by the caller).
  39. /// </summary>
  40. public Brick()
  41. {
  42. IsDead = false;
  43. Color = Color.Random;
  44. }
  45. #endregion
  46. }
  47. }