~ubuntu-branches/ubuntu/natty/plee-the-bear/natty

« back to all changes in this revision

Viewing changes to bear-factory/level-editor/src/bf/layer.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge, Julien Jorge
  • Date: 2010-11-17 20:13:34 UTC
  • mfrom: (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101117201334-o4dp7uq437to7oxb
Tags: 0.5.1-1
[ Julien Jorge ]
* New upstream release (Closes: #565062, #546514).
* Add armhf architecture (Closes: #604689).
* Remove patches integrated upstream: rpath-editors.diff, rpath-game.diff,
  editors-menu-section.diff.
* Bump the Standard-Version, no changes.
* Update my email address.
* Set build dependency of libclaw to 1.6.0.
* Add the missing ${misc:Depends} in debian/control.
* List gettext translations in bear-factory.install and plee-the-bear.install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    Bear Engine - Level editor
3
3
 
4
 
    Copyright (C) 2005-2009 Julien Jorge, Sebastien Angibaud
 
4
    Copyright (C) 2005-2010 Julien Jorge, Sebastien Angibaud
5
5
 
6
6
    This program is free software; you can redistribute it and/or modify it
7
7
    under the terms of the GNU General Public License as published by the
31
31
 
32
32
#include "bf/item_instance.hpp"
33
33
 
 
34
#include "bf/item_filter/item_filter.hpp"
 
35
 
34
36
#include <claw/functional.hpp>
35
37
#include <claw/iterator.hpp>
36
38
 
61
63
      claw::dereference<item_instance>
62
64
    >::iterator_type item_iterator;
63
65
 
 
66
    typedef std::list<item_filter> filter_list;
 
67
    typedef filter_list::const_iterator const_filter_iterator;
 
68
 
64
69
  public:
65
70
    layer
66
71
    ( unsigned int width, unsigned int height, const std::string& layer_type );
79
84
    std::size_t get_items_count() const;
80
85
 
81
86
    bool empty() const;
 
87
    bool contains( const item_instance& item ) const;
82
88
 
83
 
    std::list<item_instance*> check
84
 
    ( std::string& error_msg,
85
 
      const std::map<std::string,item_instance*>& map_id);
 
89
    std::list<item_instance*>
 
90
    check( const std::map<std::string,item_instance*>& map_id);
86
91
    void compile( compiled_file& f ) const;
87
92
 
 
93
    const_filter_iterator filter_begin() const;
 
94
    const_filter_iterator filter_end() const;
 
95
 
88
96
    item_iterator item_begin();
89
97
    item_iterator item_end();
90
98
 
91
99
    const_item_iterator item_begin() const;
92
100
    const_item_iterator item_end() const;
93
101
 
 
102
    item_iterator item_begin_no_filter();
 
103
    item_iterator item_end_no_filter();
 
104
 
 
105
    const_item_iterator item_begin_no_filter() const;
 
106
    const_item_iterator item_end_no_filter() const;
 
107
 
94
108
    layer& operator=( const layer& that );
95
109
 
 
110
    void add_filter( const item_filter& filter );
 
111
    void remove_filter( const item_filter& filter );
 
112
 
96
113
  private:
97
114
    void clear();
98
115
    void assign( const layer& that );
103
120
    ( item_instance* p, std::map<std::string, item_instance*>& items,
104
121
      std::list<item_instance*>& referenced ) const;
105
122
 
 
123
    bool evaluate_filters_on_item( const item_instance& item ) const;
 
124
 
106
125
  private:
107
126
    /** \brief The width of the layer. */
108
127
    unsigned int m_width;
116
135
    /** \brief The items in this layer. */
117
136
    item_set_type m_item;
118
137
 
 
138
    /** \brief The items returned by item_begin()/item_end(). */
 
139
    item_set_type m_filtered_item;
 
140
 
 
141
    /** \brief The filters on the items returned by item_begin()/item_end(). */
 
142
    filter_list m_filters;
 
143
 
119
144
  }; // class layer
120
145
} // namespace bf
121
146