/*--------------------------------------------------------------------------
  Project:  Manual 2D Library - m2d
  File:     gamePad.h

  Copyright (C)2007-2009 Nintendo  All Rights Reserved.

  These coded instructions, statements, and computer programs contain
  proprietary information of Nintendo of America Inc. and/or Nintendo
  Company Ltd., and are protected by Federal copyright law.  They may
  not be disclosed to third parties or copied or duplicated in any form,
  in whole or in part, without the prior written consent of Nintendo.

  $Revision: 1758 $
 *-------------------------------------------------------------------------*/

#ifndef NTMV_M2D_GAMEPAD_H_
#define NTMV_M2D_GAMEPAD_H_

#if defined(__CWCC__)
#pragma once
#endif

#include <nitro.h>

namespace ntmv
{
namespace m2d
{

class GamePad
{
public:
                        GamePad()
                        :   mTrigger(0),
                            mRelease(0),
                            mPress(0)
                        {}

    void                Read();

    bool                IsTrigger(u16 key)  { return 0 != (mTrigger & key); }
    bool                IsRelease(u16 key)  { return 0 != (mRelease & key); }
    bool                IsPress(u16 key)    { return 0 != (mPress   & key); }

private:
    u16                 mTrigger;
    u16		            mRelease;
    u16                 mPress;
};


}   // namespace m2d
}   // namespace ntmv

/* NTMV_M2D_GAMEPAD_H_ */
#endif
