]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/entity/filters.h
reformat code! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / plugins / entity / filters.h
index 219d6de93c2cdc8b79cd680f340320e3886789c7..e77f3298853043d08c8d19c89b61ad053f891980 100644 (file)
 
 class Entity;
 
-class EntityFilter
-{
+class EntityFilter {
 public:
-virtual bool filter( const Entity& entity ) const = 0;
+    virtual bool filter(const Entity &entity) const = 0;
 };
 
-bool entity_filtered( Entity& entity );
-void add_entity_filter( EntityFilter& filter, int mask, bool invert = false );
+bool entity_filtered(Entity &entity);
 
-class ClassnameFilter : public Filterable
-{
-scene::Node& m_node;
+void add_entity_filter(EntityFilter &filter, int mask, bool invert = false);
+
+class ClassnameFilter : public Filterable {
+    scene::Node &m_node;
 public:
-Entity& m_entity;
-
-ClassnameFilter( Entity& entity, scene::Node& node ) : m_node( node ), m_entity( entity ){
-}
-~ClassnameFilter(){
-}
-
-void instanceAttach(){
-       GlobalFilterSystem().registerFilterable( *this );
-}
-void instanceDetach(){
-       GlobalFilterSystem().unregisterFilterable( *this );
-}
-
-void updateFiltered(){
-       if ( entity_filtered( m_entity ) ) {
-               m_node.enable( scene::Node::eFiltered );
-       }
-       else
-       {
-               m_node.disable( scene::Node::eFiltered );
-       }
-}
-
-void classnameChanged( const char* value ){
-       updateFiltered();
-}
-typedef MemberCaller<ClassnameFilter, void(const char*), &ClassnameFilter::classnameChanged> ClassnameChangedCaller;
+    Entity &m_entity;
+
+    ClassnameFilter(Entity &entity, scene::Node &node) : m_node(node), m_entity(entity)
+    {
+    }
+
+    ~ClassnameFilter()
+    {
+    }
+
+    void instanceAttach()
+    {
+        GlobalFilterSystem().registerFilterable(*this);
+    }
+
+    void instanceDetach()
+    {
+        GlobalFilterSystem().unregisterFilterable(*this);
+    }
+
+    void updateFiltered()
+    {
+        if (entity_filtered(m_entity)) {
+            m_node.enable(scene::Node::eFiltered);
+        } else {
+            m_node.disable(scene::Node::eFiltered);
+        }
+    }
+
+    void classnameChanged(const char *value)
+    {
+        updateFiltered();
+    }
+
+    typedef MemberCaller<ClassnameFilter, void(
+            const char *), &ClassnameFilter::classnameChanged> ClassnameChangedCaller;
 };
 
 #endif