visu2d/Field.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 GAMEFIELD_HH_
00018 # define GAMEFIELD_HH_
00019 
00020 # include "VirtualScrollableSurface.hh"
00021 # include "Sprite.hh"
00022 
00023 BEGIN_NS(sdlvisu);
00024 
00025 class Game;
00026 
00031 class VisuField : public VirtualScrollableSurface
00032 {
00033 public:
00034   VisuField(Game& g);
00035   virtual ~VisuField();
00036 
00039   bool mouseInsideStadium() const;
00042   bool mouseInsideField() const;
00045   Point mouseToSquare() const;
00049   Point squareToField(const Point& pt, const Point& adjust = Point(0, 0)) const;
00050 
00051   void setMarker(const Point& square, int type);
00052   void removeMarker();
00053   
00054   void setBallPos(const Point& pos);
00055   void removeBall();
00056 
00057   bool getDrawTicks() const;
00058   void setDrawTicks(bool enable);
00059   
00060   virtual void update();
00061 
00062 private:
00063 
00065   void drawTicks();
00066   
00067   Game&         g_;
00068   
00069   Surface       bg_;
00070   Sprite        ball_;
00071   Sprite        cross_black_;
00072   Sprite        cross_red_;
00073 
00074   bool          draw_ticks_;
00075 
00076   Surface       red_highlight_;
00077   Surface       blue_highlight_;
00078 };
00079 
00080 END_NS(sdlvisu);
00081 
00082 #endif /* !GAMEFIELD_HH_ */

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