cleanup: Remove Style and use StyleDef everywhere. This gets rid of a lot of Style->StyleDef lookups and discourages code that's specific to a Style. All game logic should be data-driven.

This commit is contained in:
Chris Danford
2004-06-27 06:52:49 +00:00
parent 94f61972c8
commit 3809715db0
44 changed files with 308 additions and 383 deletions
+3 -4
View File
@@ -10,7 +10,6 @@
#include "GameManager.h"
#include "IniFile.h"
#include "Game.h"
#include "Style.h"
#include "GameDef.h"
/* Copies of the current mode. Update this by calling Load. */
@@ -98,8 +97,8 @@ void NoteFieldMode::Load(IniFile &ini, CString id, int pn)
const Game game = GAMEMAN->StringToGameType( bits[0] );
ASSERT(game != GAME_INVALID);
const Style style = GAMEMAN->GameAndStringToStyle( game, bits[1] );
ASSERT(style != STYLE_INVALID);
const StyleDef *style = GAMEMAN->GameAndStringToStyle( game, bits[1] );
ASSERT(style != NULL);
Styles.insert(style);
}
}
@@ -162,7 +161,7 @@ bool NoteFieldMode::MatchesCurrentGame() const
if(Styles.empty())
return true;
if(Styles.find(GAMESTATE->m_CurStyle) == Styles.end())
if(Styles.find(GAMESTATE->m_pCurStyleDef) == Styles.end())
return false;
return true;