I was trying to create a system so that I could have a multitude of Game Objects call a method in a singular Game Object which would serve as a game controller. The object would take in either a String or a Int value to distinct what exactly the event was, and then using that: run a specific section of code which could, or could not require arguments of different types. I was wondering if using dynamic as the argument type for any auxiliary arguments would be a good idea or not. And if not then what I should do instead to get the same effect. some example code which would in theory use my method:
public void Message(String msg, dynamic arg0, dynamic arg1,
dynamic arg2, dynamic arg3){
switch(msg){
case "point score":
// arg0 is number of points scored
scorboard.addpoint(arg0);
ResetMatch();
break;
etc...
}
}
I could also change from using dynamic arguments to using a dynamic list. I am also aware that this system is not necessary however I feel it would add a lot of freedom and if there is a similar enough system that could accomplish the same result please do tell. Thank you