_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

statusline.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2012 by Joris Dauphin
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __STATUS_LINE_H__
31 #define __STATUS_LINE_H__
32 
34 
35 #include <string>
36 
37 #include "upgrade_structs.h"
38 
39 class CFont;
40 
42 {
43 public:
44  CStatusLine() : Width(0), TextX(0), TextY(0), Font(0) {
45  memset(Costs, 0, (ManaResCost + 1) * sizeof(int));
46  }
47 
48  void Draw();
49  void DrawCosts();
50  void Set(const std::string &status);
51  void SetCosts(int mana, int food, const int *costs);
52  const std::string &Get() const { return this->StatusLine; }
53  void Clear();
54  void ClearCosts();
55 
56 public:
57  int Width;
58  int TextX;
59  int TextY;
61  int Costs[ManaResCost + 1];
62 
63 private:
64  std::string StatusLine;
65 };
66 
68 
69 #endif // __STATUS_LINE_H__
ManaResCost
#define ManaResCost
Definition: upgrade_structs.h:75
CStatusLine::Set
void Set(const std::string &status)
Definition: statusline.cpp:64
CStatusLine::Costs
int Costs[ManaResCost+1]
Definition: statusline.h:61
CStatusLine::DrawCosts
void DrawCosts()
Definition: statusline.cpp:105
CStatusLine::SetCosts
void SetCosts(int mana, int food, const int *costs)
Definition: statusline.cpp:78
CStatusLine::CStatusLine
CStatusLine()
Definition: statusline.h:44
CStatusLine
Definition: statusline.h:41
CStatusLine::TextY
int TextY
Definition: statusline.h:59
CStatusLine::Draw
void Draw()
Definition: statusline.cpp:48
CStatusLine::Font
CFont * Font
Definition: statusline.h:60
CStatusLine::TextX
int TextX
Definition: statusline.h:58
CStatusLine::ClearCosts
void ClearCosts()
Definition: statusline.cpp:92
upgrade_structs.h
CStatusLine::Get
const std::string & Get() const
Definition: statusline.h:52
CStatusLine::Width
int Width
Definition: statusline.h:57
CStatusLine::Clear
void Clear()
Definition: statusline.cpp:135
CFont
Font definition.
Definition: font.h:73
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.