Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Style.h

Go to the documentation of this file.
00001 /* Style - A data structure that holds the definition for one of a Game's styles. */ 00002 00003 #ifndef STYLE_H 00004 #define STYLE_H 00005 00006 #include "StyleInput.h" 00007 #include "GameInput.h" 00008 #include "NoteTypes.h" 00009 #include "PlayerNumber.h" 00010 #include "GameConstantsAndTypes.h" 00011 00012 00013 const int MAX_COLS_PER_PLAYER = MAX_NOTE_TRACKS; 00014 00015 class NoteData; 00016 class Game; 00017 00018 class Style 00019 { 00020 public: 00021 const Game* m_pGame; // Which Game is this Style used with? 00022 bool m_bUsedForGameplay; // Can be used only for gameplay? 00023 bool m_bUsedForEdit; // Can be used for editing? 00024 bool m_bUsedForDemonstration; // Can be used for demonstration? 00025 bool m_bUsedForHowToPlay; // Can be used for HowToPlay? 00026 00027 /* The name of the style. (This is currently unused.) */ 00028 const char *m_szName; 00029 00030 /* Steps format used for each player. For example, "dance versus" reads 00031 * the Steps with the tag "dance-single". */ 00032 StepsType m_StepsType; 00033 00034 StyleType m_StyleType; 00035 00036 int m_iColsPerPlayer; // number of total tracks this style expects (e.g. 4 for versus, but 8 for double) 00037 struct ColumnInfo 00038 { 00039 int track; // take note data from this track 00040 float fXOffset; // x position of the column relative to player center 00041 const char *pzName; // name of this column, or NULL to use the name of a button mapped to it 00042 }; 00043 00044 ColumnInfo m_ColumnInfo[NUM_PLAYERS][MAX_COLS_PER_PLAYER]; // maps each players' column to a track in the NoteData 00045 00046 /* This maps from game inputs to columns. More than one button may map to a 00047 * single column. */ 00048 enum { NO_MAPPING = -1, END_MAPPING = -2 }; 00049 int m_iInputColumn[MAX_GAME_CONTROLLERS][MAX_GAME_BUTTONS]; // maps each input to a column, or GAME_BUTTON_INVALID 00050 int m_iColumnDrawOrder[MAX_COLS_PER_PLAYER]; 00051 bool m_bNeedsZoomOutWith2Players; 00052 bool m_bCanUseBeginnerHelper; 00053 00054 GameInput StyleInputToGameInput( const StyleInput& StyleI ) const; 00055 StyleInput GameInputToStyleInput( const GameInput &GameI ) const; 00056 00057 PlayerNumber ControllerToPlayerNumber( GameController controller ) const; 00058 00059 void GetTransformedNoteDataForStyle( PlayerNumber pn, const NoteData& original, NoteData& noteDataOut ) const; 00060 00061 bool MatchesStepsType( StepsType type ) const; 00062 00063 void GetMinAndMaxColX( PlayerNumber pn, float& fMixXOut, float& fMaxXOut ) const; 00064 }; 00065 00066 00067 #endif 00068 00069 /* 00070 * (c) 2001-2002 Chris Danford 00071 * All rights reserved. 00072 * 00073 * Permission is hereby granted, free of charge, to any person obtaining a 00074 * copy of this software and associated documentation files (the 00075 * "Software"), to deal in the Software without restriction, including 00076 * without limitation the rights to use, copy, modify, merge, publish, 00077 * distribute, and/or sell copies of the Software, and to permit persons to 00078 * whom the Software is furnished to do so, provided that the above 00079 * copyright notice(s) and this permission notice appear in all copies of 00080 * the Software and that both the above copyright notice(s) and this 00081 * permission notice appear in supporting documentation. 00082 * 00083 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00084 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00085 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00086 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00087 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00088 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00089 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00090 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00091 * PERFORMANCE OF THIS SOFTWARE. 00092 */

Generated on Thu Jan 27 20:57:34 2005 for StepMania by doxygen 1.3.7