pruttned / owl-bt

owl-bt is editor for Behavior trees. It has been inspired by Unreal engine behavior trees in a way, that it supports special node items like decorators and services. This makes trees smaller and much more readable.
174 stars 28 forks source link

Enhancement: Multiple inheritance #8

Closed dauryg closed 5 years ago

dauryg commented 5 years ago

Allow derived nodes to be created from multiple defined base nodes.

for example with these base nodes:

{
    "name": "BaseNodeA",
    "isAbstract" : true,
    "properties": [
      {
        "name": "prop-from-baseA-1",
        "type": "string"
      },
      {
        "name": "prop-from-baseA-2",
        "type": "number"
      }
    ]
},
{
    "name": "BaseNodeB",
    "isAbstract" : true,
    "properties": [
      {
        "name": "prop-from-baseB-1",
        "type": "string"
      },
      {
        "name": "prop-from-baseB-2",
        "type": "number"
      }
    ]
}

and derived node:

{
    "name": "DerivedNode",
    "base": ["BaseNodeA", "BaseNodeB"]
}

would produce node:

{
    "name": "DerivedNode",
    "properties": [
      {
        "name": "prop-from-baseA-1",
        "type": "string"
      },
      {
        "name": "prop-from-baseA-2",
        "type": "number"
      },
      {
        "name": "prop-from-baseB-1",
        "type": "string"
      },
      {
        "name": "prop-from-baseB-2",
        "type": "number"
      }
    ]
}
dauryg commented 5 years ago

I'll submit a pull request

pruttned commented 5 years ago

Thanks for your contribution. Its merged in 1.2.0