3 * Daniel Nelson - 8/24/0
5 * Copyright (C) 2000 Daniel Nelson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 * Daniel Nelson - aluminumangel.org
26 #ifndef COMBOMANAGER_H
27 #define COMBOMANAGER_H
33 #include "ComboTabulator.h"
34 #include "BlockManager.h"
39 /* static */ class ComboManager
{
41 static void gameStart ( );
42 static void timeStep ( );
44 static inline ComboTabulator
&newComboTabulator ( )
46 int id
= findFreeId();
48 ComboTabulator
&combo
= tabulatorStore
[id
];
54 static inline void deleteComboTabulator ( ComboTabulator
&combo
)
59 static inline void specialBlockTally ( ComboTabulator
&combo
, Block
&block
)
61 if (BlockManager::isBaseFlavor(block
.flavor
)) return;
62 combo
.special
[BlockManager::mapSpecialFlavorToCode(block
.flavor
)]++;
67 static inline int findFreeId ( )
70 for (n
= 0; storeMap
[n
]; n
++);
74 static inline void allocateId ( int id
)
76 assert(!storeMap
[id
]);
81 static inline void freeId ( int id
)
88 static ComboTabulator tabulatorStore
[GC_COMBO_TABULATOR_STORE_SIZE
];
89 static bool storeMap
[GC_COMBO_TABULATOR_STORE_SIZE
];
90 static int combo_count
;