home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / games / gemamigo / src / gamewin.h < prev    next >
C/C++ Source or Header  |  1994-04-28  |  2KB  |  76 lines

  1. #ifndef gamewin_h
  2. #define gamewin_h
  3.  
  4. #include "viewwin.h"
  5. #include "go.h"
  6.  
  7. #include <gemfw.h>
  8. #include <gemuo.h>
  9. #include <gemhf.h>
  10. #include <vdi.h>
  11. #include <img.h>
  12.  
  13. class GEMactivity;
  14. class GEMrsc;
  15.  
  16. class GameWindow : public GEMformwindow, VDI, GEMuserobject {
  17. public:
  18.     GameWindow(GEMactivity& act, GEMrsc& rsc);
  19.  
  20.     void PlaceStone(bVal color, int x, int y);
  21.     void RemoveStone(int x, int y);
  22.     void PrisonerReport(int black, int white);
  23.  
  24.     void Message(const char* text);
  25.  
  26.     void ViewChanged();
  27.  
  28. protected:
  29.     virtual GEMfeedback DoItem(int item, const GEMevent& e);
  30.     virtual void Draw(const PARMBLK*);
  31.  
  32. private:
  33.     void NewGame();
  34.     void ClearBoard();
  35.     void Pass();
  36.     void Resign();
  37.     void ChooseColour();
  38.     void ChooseHandicap();
  39.     void AmigoMove();
  40.     void CheckBothPassed();
  41.     void InputStone(const GEMevent&);
  42.     bool PixelToPosition(int& x, int& y);
  43.     void ShowAndHide();
  44.     void RedrawPosition(int x, int y);
  45.  
  46.     int current_handicap, new_handicap;
  47.     int ingame,counting;
  48.     short humanColor, amigoColor;
  49.     short new_color;
  50.     short human_passed,amigo_passed;
  51.     short amigo_last_x,amigo_last_y;
  52.     short human_last_x,human_last_y;
  53.  
  54.     virtual void SetWorkRect(const GRect& r);
  55.  
  56. private:
  57.     enum { NUMLINES=19, NUMSTONESIZES=3 };
  58.     bVal grid[NUMLINES][NUMLINES];
  59.     IMG screen;
  60.     IMG* black_stone[NUMSTONESIZES];
  61.     IMG* white_stone[NUMSTONESIZES];
  62.     IMG* stone_mask[NUMSTONESIZES];
  63.     GEMhotform colour_choice;
  64.     GEMhotform handicap_choice;
  65.     char* game_not_in_progress;
  66.     char* game_over;
  67.     char* i_am_thinking;
  68.     char* cpu_passed;
  69.     char* click_on_dead_groups;
  70.  
  71.     ViewWindow viewwin;
  72.     GEMform about;
  73. };
  74.  
  75. #endif
  76.