Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileChangeManager.cs : Tile change event error handling #7

Open
nullorvoid opened this issue Aug 15, 2016 · 0 comments
Open

TileChangeManager.cs : Tile change event error handling #7

nullorvoid opened this issue Aug 15, 2016 · 0 comments
Labels

Comments

@nullorvoid
Copy link
Contributor

nullorvoid commented Aug 15, 2016

I feel like it should throw here because if this is called with an entity that doesn't implement the tile change interface something is seriously wrong with the calling code, however doing so is really hard for the calling code to manage and will stop all the event handlers in the chain from being called even if it's handled correctly above. source

private void EntityTileChanged(object sender, TileChangedArgs e)
{
    IEntity entity = sender as IEntity;
    if (entity == null)
    {
        // This situation should never happen!
        return;
    }

    ExecuteSolvers(entity, e);
}

Ideas welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant