Advertisement
Guest User

RButton

a guest
Jul 2nd, 2016
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.55 KB | None | 0 0
  1. #include "fe7.h"
  2.  
  3. namespace dir{
  4.     enum dirs{right = 0x10, left = 0x20, up = 0x40, down = 0x80};
  5. }
  6.  
  7. namespace pointerdir{
  8.     enum dirs{up, down, left, right};
  9. }
  10.  
  11. struct RButton;
  12.  
  13. class RButtonData{
  14. private:    
  15.     int buf[11];
  16.     RButton* rbutton;
  17.     int buf2[7];
  18.     u16 text;
  19.     u16 buf3;
  20.     u16 direction;
  21. public:
  22.     RButton* getR(){
  23.         return this->rbutton;
  24.     }
  25.     u16 getText(){
  26.         return this->text;
  27.     }
  28.     u16 getDir(){
  29.         return this->direction;
  30.     }
  31.     void setText(u16 arg){
  32.         this->text = arg;
  33.     }
  34.     void setDir(u16 arg){
  35.         this->direction = arg;
  36.     }
  37. };
  38.  
  39. class RButton{
  40. private:    
  41.     RButton* otherdata[4];
  42.     //0
  43.     u8 xcoord;
  44.     //+10
  45.     u8 ycoord;
  46.     //+11
  47.     u16 text;
  48.     //+12
  49.     bool (*condition)(RButtonData*);
  50.     //+14
  51.     void (*setTextID)(RButtonData*);
  52.     //+18
  53. public:
  54.     RButton* getDirectionPointer(pointerdir::dirs arg){
  55.         return (arg < pointerdir::up || arg > pointerdir::right) ? NULL : this->otherdata[arg];
  56.     }
  57.     u8 getX(){
  58.         return this->xcoord;
  59.     }
  60.     u8 getY(){
  61.         return this->ycoord;
  62.     }
  63.     u16 getText(){
  64.         return this->text;
  65.     }
  66.     bool (*getCondition())(RButtonData* arg){
  67.         return this->condition;
  68.     }
  69.     bool getCondition(RButtonData* arg){
  70.         return (this->getCondition())(arg);
  71.     }
  72.     void (*setTextFunc())(RButtonData* arg){
  73.         return this->setTextID;
  74.     }
  75.     void setText(RButtonData* arg){
  76.         (this->setTextFunc())(arg);
  77.     }
  78.    
  79. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement