ActionDlg.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 **
00004 ** Copyright (C) 2006 The TBT Team.
00005 **
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 **
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 **
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
00015 */
00016 
00017 #ifndef ACTIONDLG_HH_
00018 # define ACTIONDLG_HH_
00019 
00020 # include "tools.hh"
00021 # include "DlgBox.hh"
00022 
00023 BEGIN_NS(sdlvisu);
00024 
00025 class Game;
00026 
00029 enum eDlgAction {
00030   eDlgActInfo,
00031   eDlgActReroll,
00032   eDlgActFollow,
00033   eDlgActTouchback,
00034   eDlgActBlockDice,
00035   eDlgActKickOrReceive
00036 };
00037 
00042 class ActionDlg
00043 {
00044 public:
00045   ActionDlg(Game& g);
00046   ~ActionDlg();
00047 
00048   void push(enum eDlgAction id);
00049   void pop();
00050   DialogBox* front();
00051 
00053   void setText(const std::string& txt);
00054 
00055   // Special for block
00056   void addRerollLabel();
00057   void setBlockChoice();
00058   
00059 private:
00060   Game& g_;
00061 
00062   DialogBox* create(enum eDlgAction style);
00063   
00064   class Callback : public DialogBoxCb
00065   {
00066   public:
00067     Callback(ActionDlg *p, Game* g, enum eDlgAction id)
00068       : parent_(p), g_(g), id_(id) {}
00069   private:
00070     virtual void clicked(int btn_index);
00071     ActionDlg* parent_;
00072     Game* g_;
00073     enum eDlgAction id_;
00074   };
00075 
00076   std::deque<DialogBox*> list_;
00077 
00078   int reroll_index_;
00079   bool block_choice_;
00080 };
00081 
00082 END_NS(sdlvisu);
00083 
00084 #endif /* !ACTIONDLG_HH_ */

Generated on Sat Jun 23 16:07:22 2007 for Stechec/TBT by  doxygen 1.4.7