Cafu Engine
Group.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_GROUP_HPP_INCLUDED
8 #define CAFU_GROUP_HPP_INCLUDED
9 
10 #include "Templates/Array.hpp"
11 #include "wx/wx.h"
12 
13 
14 class MapDocumentT;
15 class MapElementT;
16 class TextParserT;
17 
18 
19 /// This class represents groups.
20 class GroupT
21 {
22  public:
23 
24  /// The constructor.
25  GroupT(const MapDocumentT& MapDoc, const wxString& Name_);
26 
27  /// The constructor for loading a group from a cmap file.
28  GroupT(const MapDocumentT& MapDoc, TextParserT& TP);
29 
30  void Save_cmap(std::ostream& OutFile, unsigned long GroupNr) const;
31 
32  ArrayT<MapElementT*> GetMembers() const; ///< Returns all map elements in this group.
33  bool HasMembers() const; ///< Returns whether this group has members (like `GetMembers().Size() > 0`, but more efficiently).
34 
35  wxString Name;
36  wxColour Color;
37  bool IsVisible; ///< Are the members of this group visible in the (2D and 3D) views?
38  bool CanSelect; ///< Can the members of this group be selected in the (2D and 3D) views? When false, the members are considered "locked" in order to prevent their editing.
39  bool SelectAsGroup; ///< Are the members of this group selected "as a group" (normal group behaviour) or can they be selected individually?
40 
41 
42  private:
43 
44  const MapDocumentT& m_MapDoc;
45 };
46 
47 #endif
This class represents a CaWE "map" document.
Definition: MapDocument.hpp:45
ArrayT< MapElementT * > GetMembers() const
Returns all map elements in this group.
Definition: Group.cpp:71
GroupT(const MapDocumentT &MapDoc, const wxString &Name_)
The constructor.
Definition: Group.cpp:29
This class represents groups.
Definition: Group.hpp:20
bool HasMembers() const
Returns whether this group has members (like GetMembers().Size() > 0, but more efficiently).
Definition: Group.cpp:85
bool CanSelect
Can the members of this group be selected in the (2D and 3D) views? When false, the members are consi...
Definition: Group.hpp:38
bool SelectAsGroup
Are the members of this group selected "as a group" (normal group behaviour) or can they be selected ...
Definition: Group.hpp:39
bool IsVisible
Are the members of this group visible in the (2D and 3D) views?
Definition: Group.hpp:37
This is the base class for all elements ("objects") that can exist in a map.
Definition: MapElement.hpp:57
This is a class for parsing text.
Definition: TextParser.hpp:21