Skip to content

TileChangeManager.cs : Tile change event error handling #7

@nullorvoid

Description

@nullorvoid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions