Extend child API

This commit is contained in:
Christian Treffs 2019-09-30 22:05:56 +02:00
parent dbf82389e0
commit f312f9335e
2 changed files with 20 additions and 3 deletions

View File

@ -102,10 +102,27 @@ public struct Entity {
nexus.destroy(entity: self)
}
public func addChild(_ entity: Entity) {
/// Add an entity as child.
/// - Parameter entity: The child entity.
@discardableResult
public func addChild(_ entity: Entity) -> Bool {
return false
}
public func removeChild(_ entity: Entity) {
/// Remove entity as child.
/// - Parameter entity: The child entity.
@discardableResult
public func removeChild(_ entity: Entity) -> Bool {
return false
}
/// Removes all children from this entity.
public func removeAllChildren() {
}
/// Returns the number of children for this entity.
public var numChildren: Int {
return 0
}
}

View File

@ -152,7 +152,7 @@ extension Family {
return nil
}
fatalError("implement")
return nil
}
}
}