Beispiel #1
0
 bool test(entity const & e) const
 {
     // variadic logical OR
     return concept_or(
         (e.id() == IDList)...
       );
 }
Beispiel #2
0
            bool test(entity const & e) const
            {
                if (!e || !e.has<position>()) return false;

                return e.get<position>() == m_pos
                    && m_ent.id() != e.id()
                    && (!DoColl || (e.has(collides_) && e(collides_, m_ent)));
            }
Beispiel #3
0
 EntityAtPosImpl(entity const & e)
 {
     if (Times != -1) {
         REQUIRE_CONCEPT(e, EntityHas<position, direction>);
         m_pos = move(
             e.get<position>()
         , turn_left(e.get<direction>(), static_cast<unsigned>(Times))
         , 1
         );
     } else {
         REQUIRE_CONCEPT(e, EntityHas<position>);
         m_pos = e.get<position>();
     }
     
     m_ent = entity(e.id(), m_pos);
 }
Beispiel #4
0
    bool draw_entity_at(sf::RenderWindow & to, entity const & e, position at)
    {
        // Don't draw if the entity is dead
        if (!e) return false;
        
        tile_id tid;
        if (e.has<tile_id>()) {
            tid = e.get<tile_id>();
        }
        else {
            tid = static_cast<tile_id>(e.id());
        }
            
        if (e.has<direction>()){
            tid = directional_tile_id(tid, e.get<direction>());
        }

        draw_tile_at(to, tid, at);
        return true;
    }
Beispiel #5
0
 bool test(entity const & e) const
 {
     return concept_and(
         Querys(e.id())...
     );
 }
Beispiel #6
0
 bool test(entity const & e) const
 {
     return concept_and(
         (e.id() != Ids)...
     );
 }
Beispiel #7
0
 bool test(entity const & e) const
 {
     return concept_or(
         (e.id() == Ids)...
     );
 }
Beispiel #8
0
 bool test(entity const & e) const
 {
     return same_position(e, m_ent) && e.id() == ID;
 }
Beispiel #9
0
 OnEntity(entity const & e)
 {
     m_ent = entity(e.id(), e.get<position>());
 }
Beispiel #10
0
 bool test(entity const & e) const
 {
     return e.id() == m_id;
 }
Beispiel #11
0
 bool test(entity const & e) const
 {
     return !concept_or(
         Querys(e.id())...
     );
 }
Beispiel #12
0
 bool at_location(entity_locator loc, entity const & e)
 {
     return e 
       && e.id() == loc.id
       && e.get<position>() == loc.pos;
 }