Tries to find the tree node for the specified actor. The actor. Tree node or null if cannot find it.
(Actor actor)
| 111 | /// <param name="actor">The actor.</param> |
| 112 | /// <returns>Tree node or null if cannot find it.</returns> |
| 113 | public ActorNode Find(Actor actor) |
| 114 | { |
| 115 | // Check itself |
| 116 | if (_actor == actor) |
| 117 | return this; |
| 118 | |
| 119 | // Check deeper |
| 120 | for (int i = 0; i < ChildNodes.Count; i++) |
| 121 | { |
| 122 | if (ChildNodes[i] is ActorNode node) |
| 123 | { |
| 124 | var result = node.Find(actor); |
| 125 | if (result != null) |
| 126 | return result; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | return null; |
| 131 | } |
| 132 | |
| 133 | /// <summary> |
| 134 | /// Adds the child node. |
no outgoing calls
no test coverage detected