The Battle for Wesnoth  1.17.6+dev
Public Member Functions | Private Attributes | List of all members
game_events::filter_unit Struct Reference
Inheritance diagram for game_events::filter_unit:

Public Member Functions

 filter_unit (const vconfig &cfg, bool first)
 
bool operator() (const queued_event &event_info) const override
 Runs the filter and returns whether it passes on the given event. More...
 
void serialize (config &cfg) const override
 Serializes the filter into a config, if possible. More...
 
bool can_serialize () const override
 Returns true if it is possible to serialize the filter into a config. More...
 
- Public Member Functions inherited from game_events::event_filter
virtual ~event_filter ()=default
 
 event_filter ()=default
 

Private Attributes

unit_filter suf_
 
bool first_
 

Detailed Description

Definition at line 217 of file handlers.cpp.

Constructor & Destructor Documentation

◆ filter_unit()

game_events::filter_unit::filter_unit ( const vconfig cfg,
bool  first 
)
inline

Definition at line 218 of file handlers.cpp.

Member Function Documentation

◆ can_serialize()

bool game_events::filter_unit::can_serialize ( ) const
inlineoverridevirtual

Returns true if it is possible to serialize the filter into a config.

Reimplemented from game_events::event_filter.

Definition at line 229 of file handlers.cpp.

◆ operator()()

bool game_events::filter_unit::operator() ( const queued_event event_info) const
inlineoverridevirtual

Runs the filter and returns whether it passes on the given event.

Implements game_events::event_filter.

Definition at line 219 of file handlers.cpp.

References unit_map::find(), resources::gameboard, game_events::queued_event::loc1, game_events::queued_event::loc2, and game_board::units().

◆ serialize()

void game_events::filter_unit::serialize ( config cfg) const
inlineoverridevirtual

Serializes the filter into a config, if possible.

Reimplemented from game_events::event_filter.

Definition at line 225 of file handlers.cpp.

References config::add_child().

Member Data Documentation

◆ first_

bool game_events::filter_unit::first_
private

Definition at line 235 of file handlers.cpp.

◆ suf_

unit_filter game_events::filter_unit::suf_
private

Definition at line 234 of file handlers.cpp.


The documentation for this struct was generated from the following file: