Sign in to follow this  

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

This topic is 3875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites

This topic is 3875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this