I have a little game written in C#. It uses a database as back-end. It's a Trading Card Game, and I wanted to implement the function of the cards as Script.
What I mean is that I essentially have an Interface ICard
which the Card implements (public class Card056 : ICard
) and which contains function that are called by the game.
Now, to make the thing maintainable/moddable, I would like to have the Class for each card as source code in the database and essentially compile it on first use. So when I have to add/change a card, I'll just add it to the database and tell my application to refresh, without needing any Assembly-Deployment (especially since we would be talking about 1 assembly per card which means hundreds of assemblies).
Does anyone know if that is possible? Register a class from a source file and then instantiate it etc.
ICard Cards[current] = new MyGame.CardLibrary.Card056();
Cards[current].OnEnterPlay(ref currentGameState);
The language is C#, but extra Bonus if it's possible to write the script in any .NET language.