String- Function dictionary c# where functions have different arguments

后端 未结 9 2812
温柔的废话
温柔的废话 2021-02-19 09:13

Basically I\'m trying to make a string to function dictionary in c#, I\'ve seen it done like this:

Dictionary>
<         


        
9条回答
  •  独厮守ぢ
    2021-02-19 09:31

    Considering your use case of text based rpg with commands with a set of arguements, perhaps you should make all of your commands methods that all have a signature of

    MethodName(string[] args)
    

    With the Dictionary of

    new Dictionary>>
    

    That would make it easier to work with your dictionary and actually call the methods.

提交回复
热议问题