Closed jethac closed 8 years ago
Thanks for making the pull request.
Yes, I think it is safe to assume IGame is root or null.
So the implementation should as simple as this:
public IGame GetGame()
{
return DomNode.GetRoot().As
}
Already made the changes locally.
Thanks
angle brackets were escaped.
I meant:
return DomNode.GetRoot().As
Cheers Alan! Sorry the issues I raise are always so small ;)
I noticed a commented-out todo in Interfaces/IGameObject.cs and decided to implement it. As the todo described it - the new method should return the IGame that "owns" this object, or null if there is no such game.
The code could be made faster if it's safe to assume that the IGame is the root of the IGameObject's lineage, but I didn't want to make that assumption.