Triggering methods that change instance state on other objects using a Dictionary I've been reading up on Actions and delegates for the last couple of days, and I think I'm finally starting to understand, but I wanted to check that I was using them correctly, or at least using them in a way that isn't totally insane. 

I'm using a text-based game (as such) as a platform for learning about what I suspect is called event-oriented programming. For a really terrible example, imagine the player has a torch that can set things on fire. I don't want the torch to do target.ChangeState(States.OnFire), that's giving the torch way too much power over other objects - nothing is preventing an action like nonFlammableRock.ChangeState(States.OnFire) I COULD have the torch tell the game manager entity that it wants to set something on fire, and then let the game manager decide if it's allowed to do so... but instead, I came up with this:

TestObject

internal class TestObject
{
    private string instanceVar;
    private Dictionary&lt;string, Action&gt; eventHandlers;

    public TestObject(string newInstanceVar)
    {
        this.instanceVar = newInstanceVar;
        eventHandlers = new Dictionary&lt;string, Action&gt;();
        eventHandlers.Add("event0", PrintInstanceVar);
        eventHandlers.Add("event1", InstanceVarToUpper);
        eventHandlers.Add("event2", ChangeOwnInstanceVar);
    }

    public void PrintInstanceVar()
    {
        Console.WriteLine(instanceVar);
    }

    public void InstanceVarToUpper()
    {
        instanceVar = instanceVar.ToUpper();
    }

    public void Event(string eventName)
    {
        eventHandlers[eventName].Invoke();
    }

    public void ChangeOwnInstanceVar()
    {
        instanceVar = "Object has changed its instance variable";
    }
}


Program

private static void Main(string[] args)
    {
        var test1 = new TestObject("First test obejct");

        test1.Event("event2");
        test1.Event("event0");
        test1.Event("event1");
        test1.Event("event0");

        Console.ReadKey();
    }


In short, I want to tell an object what has happened to it, and then let the object itself decide what to do. In this way, a torch can send a message "ignite" to any object, and the target object itself looks up "ignite" in its dictionary of behaviours, and reacts accordingly. So for a Rock, eventHandlers["ignite"] = () =&gt; Console.WriteLine("The rock isn't flammable, the torch had no effect"), whereas for HayBale, eventHandlers["ignite"] = () =&gt; Console.WriteLine("The bale of hay catches alight"). 

Is this a sane approach? Are there any traps I've missed that will come back to haunt me later? Is there a better way of doing this? I know that C# Events exist, but I don't fully understand them yet, and I don't know how to use them to achieve what I'm trying to do here - but if using Events would be better, how would I change this?

Note:

I know individual entities shouldn't be responsible for printing to console - if I made this whole thing, they'd be sending updates as to their state, strings containing action text etc to the game manager, which would be responsible for displaying messages for the player.
This looks ok to me on first glance.

I can only suggest the use of an Enum to strongly type the events that you are registering.

This allows you to search the code base quickly and avoids any typo's you may make:

    private string instanceVar;
    private Dictionary&lt;string, Action&gt; eventHandlers;

    public TestObject(string newInstanceVar)
    {
        this.instanceVar = newInstanceVar;
        eventHandlers = new Dictionary&lt;Events, Action&gt;();
        eventHandlers.Add(Events.event0, PrintInstanceVar);
        eventHandlers.Add(Events.event1, InstanceVarToUpper);
        eventHandlers.Add(Events.event2, ChangeOwnInstanceVar);
    }

    public enum Events
    {
        event0,
        event1,
        event2
    }