Initial Prey Game integration support.

This commit is contained in:
Justin Marshall
2026-05-05 15:01:01 -07:00
parent a6c6f1ed26
commit 8d5f678b25
552 changed files with 265551 additions and 209 deletions
+64
View File
@@ -0,0 +1,64 @@
#ifndef _HH_STACK_
#define _HH_STACK_
/*
================================================================================
hhStack:
List based stack
================================================================================
*/
template< class type >
class hhStack : public idList<type> {
public:
hhStack(int newgranularity = 16);
~hhStack<type>();
type Top(void);
type Pop(void);
void Push(type& object);
bool Empty(void);
void Clear(void);
};
template< class type >
hhStack<type>::hhStack(int newgranularity) {
SetGranularity(newgranularity);
}
template< class type >
hhStack<type>::~hhStack(void) {
}
template< class type >
ID_INLINE type hhStack<type>::Top(void) {
assert(Num() > 0);
return list[Num() - 1];
}
template< class type >
ID_INLINE type hhStack<type>::Pop(void) {
assert(Num() > 0);
type obj = Top();
SetNum(Num() - 1, false);
return obj;
}
template< class type >
ID_INLINE void hhStack<type>::Push(type& object) {
Append(object);
}
template< class type >
ID_INLINE bool hhStack<type>::Empty(void) {
return Num() == 0;
}
template< class type >
ID_INLINE void hhStack<type>::Clear(void) {
idList<type>::Clear();
}
#endif