/Samples/Breakout/Brick.cs
# · C# · 51 lines · 31 code · 4 blank · 16 comment · 0 complexity · 1e1143f71c6bf896de5f220c71bcb1a9 MD5 · raw file
- using Delta.Utilities.Datatypes;
-
- namespace Breakout
- {
- /// <summary>
- /// Each brick can either be dead or alive, has a color and the bounding
- /// rectangle for rendering and collision detection.
- /// </summary>
- public class Brick
- {
- #region Public
- /// <summary>
- /// Was this brick already destroyed?
- /// </summary>
- public bool IsDead
- {
- get;
- set;
- }
-
- /// <summary>
- /// Color of the brick
- /// </summary>
- public Color Color
- {
- get;
- set;
- }
-
- /// <summary>
- /// Bounding box for the brick
- /// </summary>
- public Rectangle Bounds
- {
- get;
- set;
- }
- #endregion
-
- #region Constructor
- /// <summary>
- /// Creates a new brick without Bounds (has to be set by the caller).
- /// </summary>
- public Brick()
- {
- IsDead = false;
- Color = Color.Random;
- }
- #endregion
- }
- }