Adding scripting functionality to .NET applications

前端 未结 9 1519
不思量自难忘°
不思量自难忘° 2020-11-29 21:55

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 a script.

What

9条回答
  •  没有蜡笔的小新
    2020-11-29 22:20

    Oleg Shilo's C# Script solution (at The Code Project) really is a great introduction to providing script abilities in your application.

    A different approach would be to consider a language that is specifically built for scripting, such as IronRuby, IronPython, or Lua.

    IronPython and IronRuby are both available today.

    For a guide to embedding IronPython read How to embed IronPython script support in your existing app in 10 easy steps.

    Lua is a scripting language commonly used in games. There is a Lua compiler for .NET, available from CodePlex -- http://www.codeplex.com/Nua

    That codebase is a great read if you want to learn about building a compiler in .NET.

    A different angle altogether is to try PowerShell. There are numerous examples of embedding PowerShell into an application -- here's a thorough project on the topic: Powershell Tunnel

提交回复
热议问题