movemgr.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //***************************************************************************
  2. //
  3. // movemgr.h -- Class definitions for the move path manager.
  4. //
  5. // MechCommander 2
  6. //
  7. //---------------------------------------------------------------------------//
  8. // Copyright (C) Microsoft Corporation. All rights reserved. //
  9. //===========================================================================//
  10. #ifndef MOVEMGR_H
  11. #define MOVEMGR_H
  12. //---------------------------------------------------------------------------
  13. #ifndef DMOVEMGR_H
  14. #include "dmovemgr.h"
  15. #endif
  16. #ifndef DWARRIOR_H
  17. #include "dwarrior.h"
  18. #endif
  19. //***************************************************************************
  20. typedef struct _PathQueueRec* PathQueueRecPtr;
  21. typedef struct _PathQueueRec {
  22. long num;
  23. MechWarriorPtr pilot;
  24. long selectionIndex;
  25. unsigned long moveParams;
  26. bool initPath;
  27. bool faceObject;
  28. PathQueueRecPtr prev;
  29. PathQueueRecPtr next;
  30. } PathQueueRec;
  31. //---------------------------------------------------------------------------
  32. class MovePathManager {
  33. public:
  34. PathQueueRec pool[MAX_MOVERS];
  35. PathQueueRecPtr queueFront;
  36. PathQueueRecPtr queueEnd;
  37. PathQueueRecPtr freeList;
  38. static long numPaths;
  39. static long peakPaths;
  40. static long sourceTally[50];
  41. public:
  42. void* operator new (size_t ourSize);
  43. void operator delete (void* us);
  44. MovePathManager (void) {
  45. init();
  46. }
  47. ~MovePathManager (void) {
  48. destroy();
  49. }
  50. void destroy (void);
  51. long init (void);
  52. void remove (PathQueueRecPtr rec);
  53. PathQueueRecPtr remove (MechWarriorPtr pilot);
  54. void request (MechWarriorPtr pilot, long selectionIndex, unsigned long moveParams, long source);
  55. void calcPath (void);
  56. void update (void);
  57. };
  58. typedef MovePathManager* MovePathManagerPtr;
  59. #endif
  60. //***************************************************************************