Files
itgmania212121/stepmania/src/GameDef.h
T

86 lines
2.2 KiB
C++
Raw Normal View History

2002-04-16 17:31:00 +00:00
#pragma once
/*
-----------------------------------------------------------------------------
Class: GameDef
Desc: Holds information about a particular style of a game (e.g. "single", "double").
Copyright (c) 2001-2002 by the persons listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "NoteMetadata.h"
#include "NoteData.h"
#include "GameInput.h"
2002-05-01 19:14:55 +00:00
#include "GameConstantsAndTypes.h"
2002-04-16 17:31:00 +00:00
#include "MenuInput.h"
const int MAX_STYLES_PER_GAME = 10;
2002-04-28 20:42:32 +00:00
const int MAX_SKIN_PATHS = 16;
2002-04-16 17:31:00 +00:00
2002-04-28 20:42:32 +00:00
class StyleDef;
2002-04-16 17:31:00 +00:00
2002-04-28 20:42:32 +00:00
class GameDef
2002-04-16 17:31:00 +00:00
{
public:
2002-04-28 20:42:32 +00:00
GameDef( CString sGameDir );
~GameDef();
2002-04-16 17:31:00 +00:00
2002-04-28 20:42:32 +00:00
CString m_sGameDir;
CString m_sName;
CString m_sDescription;
2002-04-16 17:31:00 +00:00
// instrument stuff
int m_iNumInstruments;
2002-04-28 20:42:32 +00:00
int m_iButtonsPerInstrument;
CString m_sButtonNames[MAX_INSTRUMENT_BUTTONS]; // e.g. "left", "right", "middle C", "snare"
int ButtonNameToIndex( const CString &sButtonName )
{
for( int i=0; i<m_iButtonsPerInstrument; i++ )
if( m_sButtonNames[i] == sButtonName )
return i;
return -1;
}
int m_iMenuButtons[NUM_MENU_BUTTONS]; // map from MenuButton to m_sButtonNames
2002-04-16 17:31:00 +00:00
int m_iNumStyleDefs;
2002-04-28 20:42:32 +00:00
StyleDef* m_pStyleDefs[MAX_STYLES_PER_GAME];
StyleDef* GetStyleDef( CString sStyle );
2002-04-16 17:31:00 +00:00
// graphic stuff
2002-04-28 20:42:32 +00:00
int m_iNumSkinFolders;
CString m_sSkinFolders[MAX_SKIN_PATHS]; // path to skin folders relative to m_sGameDir
bool HasASkinNamed( CString sSkin )
{
for( int i=0; i<m_iNumSkinFolders; i++ )
if( m_sSkinFolders[i] == sSkin )
return true;
return false;
}
CString GetPathToGraphic( const CString sSkinName, const int iInstrumentButton, const GameButtonGraphic gbg );
2002-04-16 17:31:00 +00:00
CString ElementToGraphicSuffix( const GameButtonGraphic gbg );
inline MenuInput GameInputToMenuInput( const GameInput GameI )
{
PlayerNumber p = (PlayerNumber)GameI.number;
for( int b=0; b<NUM_MENU_BUTTONS; b++ )
{
if( m_iMenuButtons[b] == GameI.button )
return MenuInput( p, (MenuButton)b );
}
return MenuInput( PLAYER_NONE, MENU_BUTTON_NONE );
};
inline GameInput MenuInputToGameInput( const MenuInput MenuI )
{
return GameInput( (InstrumentNumber)MenuI.player, (InstrumentButton)m_iMenuButtons[MenuI.button] );
};
};