SonyWWS / LevelEditor

The ATF LevelEditor is a powerful tool for constructing and assembling game levels. It provides a WYSIWYG interface and allows you to place objects, edit properties, edit terrain, and build game levels.
Apache License 2.0
1.32k stars 229 forks source link

IGameObject.GetGame #34

Closed jethac closed 8 years ago

jethac commented 8 years ago

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.

abeckus commented 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

abeckus commented 8 years ago

angle brackets were escaped. I meant: return DomNode.GetRoot().As();

jethac commented 8 years ago

Cheers Alan! Sorry the issues I raise are always so small ;)