ELEC2645 (2018/19) / Mbed 2 deprecated el17ajf

Dependencies:   mbed

Fork of el17ajf by Angus Findlay

Input/Input.h

Committer:
el17ajf
Date:
2019-04-29
Revision:
39:e128071a95b0
Parent:
31:69fedaa9b171

File content as of revision 39:e128071a95b0:

#ifndef INPUT_H
#define INPUT_H

/**
 * Input Namespace
 * @brief Namespace providing functions to
 * interface with SampledIn objects for each button used.
 */
namespace Input {
    /**
     * @brief Button Enum represeting each button used for controling the game
     * The directional button are labeled as follows on the pcb
     * LEFT -> A 
     * RIGHT -> Y
     * UP -> X
     * DOWN -> B
     */
    enum Button {LEFT, RIGHT, UP, DOWN, START};
    
    /**
     * @input A button from the Button enum
     * @see Button
     * @returns True if the button was hit this frame, else false
     */
    bool buttonHit(Button button);
    
    /**
     * @returns A random seed for the random generator, 
     * based on the Analogue Input from the joystick.
     */
    int getSeed();
};
#endif