goostengine / goost

A general-purpose, extensible and customizable C++ extension for Godot Engine.
https://goostengine.github.io/
MIT License
481 stars 18 forks source link

Add a way to enumerate edges connected to `GraphVertex` #177

Closed Xrayez closed 2 years ago

Xrayez commented 2 years ago

This allows to traverse edges over of vertices:

for edge in v.get_edges():
    print(edge.a, " ", edge.b)

for edge in v.get_incoming_edges():
    # `b` is predecessor of `a`
    print(edge.a, " ", edge.b)

for edge in v.get_outgoing_edges():
    # `b` is successor of `a`
    print(edge.a, " ", edge.b)

@sairam4123 https://github.com/goostengine/goost/pull/172#issuecomment-1044409628

sairam4123 commented 2 years ago

Thanks! That's helpful!