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