multiplayer pong game for LPC 1768

Dependencies:   mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt

gamestate.h

Committer:
vsoltan
Date:
2020-11-15
Revision:
18:32fce82690a1
Parent:
17:32ae1f106002
Child:
19:58cc5465f647

File content as of revision 18:32fce82690a1:


#ifndef GAME_STATE_H
#define GAME_STATE_H

#include "mbed.h"
#include "stdint.h"
#include "MbedJSONValue.h"
#include "graphics.h" 
#include <string>  

struct Coord {
    int8_t x; 
    int8_t y;
};

class Graphics; 

class GameState {
    private: 
        Coord p1_loc; 
        Coord p2_loc; 
        Coord ball_loc; 
        char is_done; 
        char localPlayerNum; 
        string lobbyHash; 
    public:
        GameState();  
        Coord getPlayerOneLocation(); 
        Coord getPlayerTwoLocation(); 
        Coord getBallLocation();
        void update(MbedJSONValue *serverResponse, Graphics *gfx);
        bool done();   
};

#endif // GAME_STATE_H