move code from header to cpp
This commit is contained in:
@@ -17,6 +17,7 @@ static const CString LayoutTypeNames[NUM_LAYOUT_TYPES] = {
|
|||||||
XToString( LayoutType );
|
XToString( LayoutType );
|
||||||
StringToX( LayoutType );
|
StringToX( LayoutType );
|
||||||
|
|
||||||
|
|
||||||
OptionRow::OptionRow()
|
OptionRow::OptionRow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -30,6 +31,34 @@ OptionRow::~OptionRow()
|
|||||||
SAFE_DELETE( m_Underline[p][i] );
|
SAFE_DELETE( m_Underline[p][i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int OptionRow::GetOneSelection( PlayerNumber pn ) const
|
||||||
|
{
|
||||||
|
for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ )
|
||||||
|
if( m_vbSelected[pn][i] )
|
||||||
|
return i;
|
||||||
|
ASSERT(0); // shouldn't call this if not expecting one to be selected
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int OptionRow::GetOneSharedSelection() const
|
||||||
|
{
|
||||||
|
return GetOneSelection( (PlayerNumber)0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionRow::SetOneSelection( PlayerNumber pn, int iChoice )
|
||||||
|
{
|
||||||
|
for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ )
|
||||||
|
m_vbSelected[pn][i] = false;
|
||||||
|
m_vbSelected[pn][iChoice] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OptionRow::SetOneSharedSelection( int iChoice )
|
||||||
|
{
|
||||||
|
FOREACH_HumanPlayer( pn )
|
||||||
|
SetOneSelection( pn, iChoice );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford
|
* (c) 2001-2004 Chris Danford
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class OptionRow : public ActorFrame
|
|||||||
public:
|
public:
|
||||||
OptionRow();
|
OptionRow();
|
||||||
~OptionRow();
|
~OptionRow();
|
||||||
|
|
||||||
OptionRowDefinition m_RowDef;
|
OptionRowDefinition m_RowDef;
|
||||||
enum { ROW_NORMAL, ROW_EXIT } Type;
|
enum { ROW_NORMAL, ROW_EXIT } Type;
|
||||||
vector<BitmapText *> m_textItems; // size depends on m_bRowIsLong and which players are joined
|
vector<BitmapText *> m_textItems; // size depends on m_bRowIsLong and which players are joined
|
||||||
@@ -54,30 +55,12 @@ public:
|
|||||||
int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus
|
int m_iChoiceInRowWithFocus[NUM_PLAYERS]; // this choice has input focus
|
||||||
|
|
||||||
// Only one will true at a time if m_RowDef.bMultiSelect
|
// Only one will true at a time if m_RowDef.bMultiSelect
|
||||||
vector<bool> m_vbSelected[NUM_PLAYERS]; // size = m_RowDef.choices.size().
|
vector<bool> m_vbSelected[NUM_PLAYERS]; // size = m_RowDef.choices.size()
|
||||||
int GetOneSelection( PlayerNumber pn ) const
|
|
||||||
{
|
int GetOneSelection( PlayerNumber pn ) const;
|
||||||
for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ )
|
int GetOneSharedSelection() const;
|
||||||
if( m_vbSelected[pn][i] )
|
void SetOneSelection( PlayerNumber pn, int iChoice );
|
||||||
return i;
|
void SetOneSharedSelection( int iChoice );
|
||||||
ASSERT(0); // shouldn't call this if not expecting one to be selected
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
int GetOneSharedSelection() const
|
|
||||||
{
|
|
||||||
return GetOneSelection( (PlayerNumber)0 );
|
|
||||||
}
|
|
||||||
void SetOneSelection( PlayerNumber pn, int iChoice )
|
|
||||||
{
|
|
||||||
for( unsigned i=0; i<(unsigned)m_vbSelected[pn].size(); i++ )
|
|
||||||
m_vbSelected[pn][i] = false;
|
|
||||||
m_vbSelected[pn][iChoice] = true;
|
|
||||||
}
|
|
||||||
void SetOneSharedSelection( int iChoice )
|
|
||||||
{
|
|
||||||
FOREACH_HumanPlayer( pn )
|
|
||||||
SetOneSelection( pn, iChoice );
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user