You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

63 lines
1.2 KiB

  1. using System;
  2. using System.Diagnostics;
  3. using CIGEnums;
  4. public class Balloon
  5. {
  6. public Balloon(GridTileIconType gridTileIcon, SpeechBaloonType balloonType)
  7. {
  8. this.GridTileIcon = gridTileIcon;
  9. this.BalloonType = balloonType;
  10. }
  11. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  12. public event Balloon.ExpiredEventHandler ExpiredEvent;
  13. private void FireExpiredEvent()
  14. {
  15. if (this.ExpiredEvent != null)
  16. {
  17. this.ExpiredEvent(this);
  18. }
  19. }
  20. //[DebuggerBrowsable(DebuggerBrowsableState.Never)]
  21. public event Balloon.CollectedEventHandler CollectedEvent;
  22. private void FireCollectedEvent()
  23. {
  24. if (this.CollectedEvent != null)
  25. {
  26. this.CollectedEvent(this);
  27. }
  28. }
  29. public virtual void Collect()
  30. {
  31. this.FireCollectedEvent();
  32. }
  33. public virtual void Expire()
  34. {
  35. this.FireExpiredEvent();
  36. }
  37. public float TotalDurationInSeconds
  38. {
  39. get
  40. {
  41. return 15f;
  42. }
  43. }
  44. public GridTileIconType GridTileIcon { get; private set; }
  45. public SpeechBaloonType BalloonType { get; private set; }
  46. private const float LifetimeInSeconds = 15f;
  47. public delegate void ExpiredEventHandler(Balloon balloon);
  48. public delegate void CollectedEventHandler(Balloon balloon);
  49. }