~widelands-dev/widelands/trunk

« back to all changes in this revision

Viewing changes to src/event_conquer_area.h

  • Committer: sigra
  • Date: 2007-01-26 16:12:13 UTC
  • Revision ID: git-v1:f983e08603f59bc6a6e99cb732d9102bfbfb3db8
* Try to optimize the set terrain tool by adding Map::set_height for areas. That means first set the height of every node in the area, then adjust the surrounding nodes ([http://sourceforge.net/tracker/index.php?func=detail&aid=1640305&group_id=40163&atid=427221], "Editor set height tool set to max produces funny mountain" is still present though).
* Use Area and Player_Area.
* Put most of the code from Event_Conquer_Area and Event_Unhide_Area into a common base.
* Initialize the names of events and triggers in their initializer lists.

git-svn-id: https://widelands.svn.sourceforge.net/svnroot/widelands/trunk@1965 37b2a8de-5219-0410-9f54-a31bc463ab9c

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2002-2004, 2006 by the Widelands Development Team
 
2
 * Copyright (C) 2002-2004, 2006-2007 by the Widelands Development Team
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public License
20
20
#ifndef __S__EVENT_CONQUER_AREA_H
21
21
#define __S__EVENT_CONQUER_AREA_H
22
22
 
23
 
#include "event.h"
24
 
#include "geometry.h"
25
 
 
26
 
class Editor_Game_Base;
27
 
 
28
 
/*
29
 
 * This event shows a message box
30
 
 */
31
 
class Event_Conquer_Area : public Event {
32
 
   public:
33
 
     Event_Conquer_Area();
34
 
      ~Event_Conquer_Area();
35
 
 
36
 
      // one liner functions
 
23
#include "event_player_area.h"
 
24
#include "i18n.h"
 
25
 
 
26
/// Shows a message box.
 
27
struct Event_Conquer_Area : public Event_Player_Area {
 
28
        friend struct Event_Conquer_Area_Option_Menu;
 
29
        Event_Conquer_Area()
 
30
                :
 
31
                Event_Player_Area
 
32
                (_("Conquer Area"), Player_Area(0, Area(Coords(0, 0), 5)))
 
33
        {}
 
34
 
 
35
 
 
36
 
37
37
        const char * get_id() const {return "conquer_area";}
38
38
 
39
39
      State run(Game*);
40
 
      virtual void reinitialize(Game*);
41
 
 
42
 
      // File Functions
43
 
        void Write(Section &, const Editor_Game_Base &) const;
44
 
      void Read(Section*, Editor_Game_Base*);
45
 
 
46
 
      inline void set_coords(Coords pt) { m_pt=pt; }
47
 
        Coords get_coords() const {return m_pt;}
48
 
        int get_player() const {return m_player;}
49
 
      inline void set_player(int i) { m_player=i; }
50
 
        int get_area() const {return m_area;}
51
 
      inline void set_area(int i) { m_area=i; }
52
 
 
53
 
   private:
54
 
      Coords m_pt;
55
 
      int m_area;
56
 
      int m_player;
57
40
};
58
41
 
59
 
 
60
 
 
61
42
#endif