I am new in the game development and now I am at the stage when you need to fill the game content. I want to create the events that occur with the player (like in FTL). Now I make these events with the help of hardcoding, but I understand that this is a very bad style. I know there is another way, use data in XML files. Here is an example:
<event name="SIMPLE_EVENT"> <text>Event text</text> <battle name="MONSTERS_WEAK"/> </event>
This event show a dialog window and start battle with a random weak monster. I understand how to make this XML files, but I not so experienced with C# to write code that will convert data from XML to my C# classes. How to convert this xml to C# methods invocation? Something like: ShowDialogWindow("Event text"); StartBattle("MONSTERS_WEAK"); Another example is:
<event name="ADD_FUEL"> <text>Adding fuel</text> <item_modify> <item type="fuel" min="2" max="2"/> </item_modify> </event>
This event show dialog too and add some fuel to the player.
I think its a some deserialization task? Anyway similar as FTL I need one class to represent all events in the game, using different XML data. I ask some advice with this, maybe tutorials, pattens or examples? Or maybe another solution of my task?