Brunot
Loading...
Searching...
No Matches
PathFilter.h
Go to the documentation of this file.
1
12// ____ __ __ __
13// /\__ _\/\ \ /\ \/\ \
14// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
15// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
16// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
17// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
18// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
19
20
21#pragma once
22#include <functional>
23
24#include "Utility/Path/Private/PathNode.h"
25
26namespace gobj
27{
28
33struct PathFilter : public PathNode
34{
35 explicit PathFilter(const std::function<bool(const GameObject&)>& filter);
36 ~PathFilter() override = default;
37
38 auto begin() -> path_iterator override;
39 auto end() -> path_iterator override;
42 auto getNext(GameObject* ptr) -> GameObject* override;
43
46
47private:
48 std::function<bool(const GameObject&)> predicate;
49};
50}
iterator type, refers to a GameObject, and holds onto a reference to a PathNode to determine its rang...
Definition PathNode.h:45
namespace for things relating to GameObject, other than GameObject itself
Definition Entity.h:229
~PathFilter() override=default
PathFilter(const std::function< bool(const GameObject &)> &filter)
Definition PathFilter.cpp:22
auto findNewBegin(path_iterator &begin, const path_iterator &end) -> path_iterator
helper function to find the beginning of our range
Definition PathFilter.cpp:38
std::function< bool(const GameObject &)> predicate
Definition PathFilter.h:48
auto end() -> path_iterator override
Definition PathFilter.cpp:33
auto begin() -> path_iterator override
Definition PathFilter.cpp:28
auto getNext(GameObject *ptr) -> GameObject *override
Used by PathNode::path_iterator to increment.
Definition PathFilter.cpp:92
internal type for computing Paths
Definition PathNode.h:37
friend GameObject
Definition PathNode.h:38