using System; using System.Diagnostics; using CIGEnums; public class Balloon { public Balloon(GridTileIconType gridTileIcon, SpeechBaloonType balloonType) { this.GridTileIcon = gridTileIcon; this.BalloonType = balloonType; } //[DebuggerBrowsable(DebuggerBrowsableState.Never)] public event Balloon.ExpiredEventHandler ExpiredEvent; private void FireExpiredEvent() { if (this.ExpiredEvent != null) { this.ExpiredEvent(this); } } //[DebuggerBrowsable(DebuggerBrowsableState.Never)] public event Balloon.CollectedEventHandler CollectedEvent; private void FireCollectedEvent() { if (this.CollectedEvent != null) { this.CollectedEvent(this); } } public virtual void Collect() { this.FireCollectedEvent(); } public virtual void Expire() { this.FireExpiredEvent(); } public float TotalDurationInSeconds { get { return 15f; } } public GridTileIconType GridTileIcon { get; private set; } public SpeechBaloonType BalloonType { get; private set; } private const float LifetimeInSeconds = 15f; public delegate void ExpiredEventHandler(Balloon balloon); public delegate void CollectedEventHandler(Balloon balloon); }