Files
itgmania212121/stepmania/src/GameInput.cpp
T

39 lines
710 B
C++
Raw Normal View History

2002-07-27 19:29:51 +00:00
#include "stdafx.h"
/*
-----------------------------------------------------------------------------
Class: GameInput
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "GameInput.h"
#include "RageLog.h"
#include "RageUtil.h"
CString GameInput::toString()
{
return ssprintf("%d-%d", controller, button );
}
bool GameInput::fromString( CString s )
{
CStringArray a;
split( s, "-", a);
if( a.GetSize() != 2 ) {
MakeInvalid();
2002-07-27 19:29:51 +00:00
return false;
}
controller = (GameController)atoi( a[0] );
button = (GameButton)atoi( a[1] );
return true;
};