Behavior.cs 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //-----------------------------------------------------------------------------
  2. // Behavior.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using System;
  8. #if IPHONE
  9. using Microsoft.Xna.Framework;
  10. #else
  11. using Microsoft.Xna.Framework;
  12. #endif
  13. namespace Waypoint
  14. {
  15. /// <summary>
  16. /// Behavior is the base class for the two behaviors in this sample: linear
  17. /// and steering. It is an abstract class, leaving the implementation of
  18. /// Update up to its subclasses.
  19. /// </summary>
  20. public abstract class Behavior
  21. {
  22. // Keeps track of the tank that this behavior will modify
  23. protected Tank tank;
  24. protected Behavior(Tank tank)
  25. {
  26. this.tank = tank;
  27. tank.MoveSpeed = Tank.MaxMoveSpeed;
  28. }
  29. public abstract void Update(GameTime gameTime);
  30. }
  31. }