GameEvent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // GameEvent.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Text;
  13. using Microsoft.Xna.Framework;
  14. #endregion
  15. namespace RobotGameData.GameEvent
  16. {
  17. /// <summary>
  18. /// This is the base class of all the events in the game.
  19. /// </summary>
  20. public abstract class GameEventBase
  21. {
  22. #region Fields
  23. protected GameSceneNode owner = null;
  24. protected float localTime = 0.0f;
  25. protected bool waitingAction = true;
  26. protected bool finishedAction = false;
  27. #endregion
  28. #region Properties
  29. public GameSceneNode Owner
  30. {
  31. get { return Owner; }
  32. }
  33. public float LocalTime
  34. {
  35. get { return localTime; }
  36. }
  37. public bool IsWatingAction
  38. {
  39. get { return waitingAction; }
  40. }
  41. public bool IsFinishedAction
  42. {
  43. get { return finishedAction; }
  44. }
  45. #endregion
  46. /// <summary>
  47. /// Update local time of this event
  48. /// </summary>
  49. public void Update(GameTime gameTime)
  50. {
  51. localTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
  52. }
  53. public virtual void ExecuteAction() { }
  54. }
  55. }