2036 mbed lab4
Dependencies: 4DGL-uLCD-SE PinDetect
Diff: Die.h
- Revision:
- 0:bbda88bee65a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Die.h Mon Mar 28 18:44:30 2022 +0000 @@ -0,0 +1,38 @@ +#define WHITE 0xFFFFFF +#include "mbed.h" + +enum DieState{ROLL,REMOVED};//dice class, members are positions, colors, value of dice, and a state +class Die{ + public: + Die(int x11=0, int y11=0, int x12=0, int y12=0, int col=WHITE, int val=0){ + x1=x11; + x2=x12; + y1=y11; + y2=y12; + Color=col; + value=val; + currDieState=ROLL; + }; + void rollDie(); + void drawDie();//functions for rolling, drawing, and setting and getting data members + void setCurrDieState(DieState v); + DieState getCurrDieState(); + int getx1(); + int getx2(); + int gety1(); + int gety2(); + int getColor(); + int getValue(); + + + private: + int x1; + int x2; + int y1; + int y2; + int Color; + int value; + DieState currDieState; + + +};