Behavior.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Behavior.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. #if IPHONE
  12. using Microsoft.Xna.Framework;
  13. #else
  14. using Microsoft.Xna.Framework;
  15. #endif
  16. #endregion
  17. namespace Waypoint
  18. {
  19. /// <summary>
  20. /// Behavior is the base class for the two behaviors in this sample: linear
  21. /// and steering. It is an abstract class, leaving the implementation of
  22. /// Update up to its subclasses.
  23. /// </summary>
  24. public abstract class Behavior
  25. {
  26. #region Fields
  27. // Keeps track of the tank that this behavior will modify
  28. protected Tank tank;
  29. #endregion
  30. #region Initialization
  31. protected Behavior(Tank tank)
  32. {
  33. this.tank = tank;
  34. tank.MoveSpeed = Tank.MaxMoveSpeed;
  35. }
  36. #endregion
  37. #region Update
  38. public abstract void Update(GameTime gameTime);
  39. #endregion
  40. }
  41. }