From f080f1e4bc9475500c0b5ef3c559c0e105290137 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Thu, 5 Jun 2025 12:12:39 -0300 Subject: reduce clutter with struct dividing comments --- src/containers.hh | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'src/containers.hh') diff --git a/src/containers.hh b/src/containers.hh index 9cab94e..2533445 100644 --- a/src/containers.hh +++ b/src/containers.hh @@ -8,8 +8,6 @@ // index is valid, even for negative indices. template struct vector{ - // REGULAR FUNCTIONS - // ========================================================================= vector(int min, int max, int block){ int space = (max - min) + 1; if(space < 1){ @@ -111,7 +109,7 @@ struct vector{ } // DATA - // ========================================================================= + // ================= int min; int max; int start; @@ -130,8 +128,6 @@ struct priority_queue_entry{ template struct priority_queue{ - // REGULAR FUNCTIONS - // ========================================================================= priority_queue(int capacity, int increment){ Entry = new vector>(1, capacity, increment); Entries = 0; @@ -202,19 +198,13 @@ struct priority_queue{ } // DATA - // ========================================================================= + // ================= vector> *Entry; int Entries; }; -// TODO(fusion): We only use this structure two global queues: -// priority_queue ToDoQueue(5000, 1000); -// priority_queue AttackWaveQueue(100, 100); - template struct matrix{ - // REGULAR FUNCTIONS - // ========================================================================= matrix(int xmin, int xmax, int ymin, int ymax){ int dx = (xmax - xmin) + 1; int dy = (ymax - ymin) + 1; @@ -262,7 +252,7 @@ struct matrix{ } // DATA - // ========================================================================= + // ================= int xmin; int ymin; int dx; @@ -272,8 +262,6 @@ struct matrix{ template struct matrix3d{ - // REGULAR FUNCTIONS - // ========================================================================= matrix3d(int xmin, int xmax, int ymin, int ymax, int zmin, int zmax){ int dx = (xmax - xmin) + 1; int dy = (ymax - ymin) + 1; @@ -333,7 +321,7 @@ struct matrix3d{ } // DATA - // ========================================================================= + // ================= int xmin; int ymin; int zmin; @@ -352,8 +340,6 @@ struct listnode{ template struct list{ - // REGULAR FUNCTIONS - // ========================================================================= list(void){ firstNode = NULL; lastNode = NULL; @@ -405,15 +391,13 @@ struct list{ } // DATA - // ========================================================================= + // ================= listnode *firstNode; listnode *lastNode; }; template struct fifo{ - // REGULAR FUNCTIONS - // ========================================================================= fifo(int InitialSize){ ASSERT(InitialSize > 0); this->Entry = new T[InitialSize]; @@ -468,7 +452,7 @@ struct fifo{ // functions were inlined so I'm not sure it is needed. // DATA - // ========================================================================= + // ================= T *Entry; int Size; int Head; @@ -495,8 +479,6 @@ struct storeunit{ // It is also known as a slab allocator. template struct store{ - // REGULAR FUNCTIONS - // ========================================================================= store(void){ this->Units = new list>; this->firstFreeItem = NULL; @@ -529,7 +511,7 @@ struct store{ } // DATA - // ========================================================================= + // ================= list> *Units; storeitem *firstFreeItem; }; -- cgit v1.2.3