home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / g / gina15.zip / demos / sleuth / SleuthDocument < prev    next >
Text File  |  1992-02-27  |  3KB  |  99 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2.  
  3. //   Module      : SleuthDocument.h   Version 1.2
  4. //   LastSCCS    : 2/26/92  16:39:09
  5. //   LastEdit    : "Tue Feb 25 10:32:51 1992"
  6. //   Description : 
  7. //   Author      : 
  8. //   Copyright   : GMD Schloss Birlinghoven
  9.  
  10. #ifndef Sleuthdocument_h
  11. #define Sleuthdocument_h
  12.  
  13. enum FieldStatus { eNeutral = 0, eOwned = 1, eNotOwned = 2 };
  14.  
  15. class Player;
  16. class PlayerView;
  17. class CardView;
  18. class ZatDialog;
  19. class ZatParameterDialog;
  20.  
  21. DefGenericListWithIterator(CardViewList,CardView,CardViewListIterator);
  22.  
  23. class SleuthDocument : public GnDocument {
  24.   public:
  25.     SleuthDocument();
  26.     virtual void create_windows(int new_width = 0, int new_height = 0);
  27.     //virtual void wipe_out();
  28.   public:
  29.     void DisplayOwner(Card *c);
  30.     void AddCardView(CardView *card_view);
  31.     Boolean IsRegistered(CardView *card_view);
  32.     void SetGameName(char *new_game_name, Boolean copy = True);
  33.     char *GetGameName();
  34.     void SetParticipant(char *new_name, Boolean copy = True);
  35.     char *GetParticipant();
  36.     Card *GetCard(int shape, int color, int value)
  37.     { return cards[shape][color][value]; }
  38.     int LastRound();
  39.     int NextRound();
  40.     int PreviousRound();
  41.     int GetRound();
  42.     ZatParameterDialog *GetZatParameterDialog();
  43.     int GetNumberGroupValue();
  44.   protected:
  45.     // Document IO
  46.     virtual Boolean SaveHistory();
  47.     virtual Boolean write_to_stream(ostream &stream);
  48.     virtual Boolean read_from_stream(istream &stream);
  49.     virtual GnCommand *MakeNewCommand(char *p_command_class_name);
  50.   protected:
  51.     // Callbacks
  52.     void PrintTables(caddr_t);
  53.     void PrintAxioms(caddr_t);
  54.     void NewRound(caddr_t);
  55.   protected:
  56.     void AdjustListWidgets();
  57.   public:
  58.     static char *PlayerName(int i)
  59.     { return player_names[i]; }
  60.     static char *ColorName(int i)
  61.     { return color_names[i]; }
  62.     static char *ShapeName(int i)
  63.     { return shape_names[i]; }
  64.     static char *ValueName(int i)
  65.     { return value_names[i]; }
  66.     Player *GetPlayer(int nth);
  67.     int CalculateSelectionListWidth();
  68.   public:
  69.     void SelectPlayer(Player *player);
  70.     Player *SelectedPlayer()
  71.     { return selected_player; }
  72.   protected:
  73.     Player       *players[7];
  74.     Player       *selected_player;
  75.     char         *game_name;
  76.     char         *participant;
  77.     int           round_number;
  78.     Card         *cards[3][4][3];
  79.   protected:
  80.     CardViewList        observer;
  81.     GnRadioGroup        player_group;
  82.     GnRadioGroup        shape_group;
  83.     GnRadioGroup        color_group;
  84.     GnRadioGroup        value_group;
  85.     GnRadioGroup        number_group;
  86.     GnPushButton        enter_rule_button;
  87.     CardView           *card_view;
  88.     ZatDialog          *zat_dialog;
  89.     ZatParameterDialog *zat_parameter_dialog;
  90.     GnMenuEntry        *new_round_entry;
  91.   private:
  92.     static char *player_names[7];
  93.     static char *color_names[5];
  94.     static char *shape_names[4];
  95.     static char *value_names[4];
  96. };
  97.  
  98. #endif
  99.