[.net] C# Tool for creating game framework (bunch of code files)

Started by
0 comments, last by jpetrie 16 years, 11 months ago
Hello all, I'm working on a small C# tool for me and my co-workers in my company which should allow us to create new games more easily than just copy/paste the previous game-framework. (Focus on C++) What i want is basically just a bunch of source code files in a given directory structure. In my C# tool i just have an edit-box where the user might enter the game name and all generated files will have use this name. Now my question is...what would be the best way to create such files from text-based templates? Basically these "templates" just have placeholders where later the real game-name for example is being inserted. Anyone has an idea? I thought reading every single template file, parsing and do a standard string replace and create a new file with the modified strings? Thanks for help, best regards
Advertisement
Quote:
Now my question is...what would be the best way to create such files from text-based templates?

Either don't do it, or use an existing tool.

If you have this common set of functionality you continually reuse between projects/games, you should look into moving that common functionality into a library. Copy-pasting the source code around between projects is an excellent way to end up in maintenance hell, nevermind the fact that it's inefficient.

If you just want to generate template source files, so that all new files have the same (for example) copyright at the top, et cetera, then you can use Visual Studio's built-in Code Snippets features (check MSDN) or you can use the template mechanisms provided by an external tool such as Visual Assist or Resharper.

The last two are non-free, but will pay for themselves easily unless it would take you less than about nine hours of work (on average) to rewrite the appropriate functionality yourself (and it would, most likely, take you longer than that to achieve the same robustness and stability those tools offer you).

This topic is closed to new replies.

Advertisement