コード例 #1
0
        static void Main()
        {
            //Initialize the script engine
            var result1 = CSharpScriptEngine.Execute("string s = Global.ToString();", "Success!");

            System.Console.WriteLine("Script Engine Status: " + result1.Variables["s"].Value.ToString());

            /* System.Console.WriteLine("Script Complex Object Test: " + ScriptEngineHelper.GetCreatureFromScript("Scripts/Creatures/prefab").AtHitPoints.ToString()); */

            System.Console.WriteLine("Registering game data.");
            ScriptEngineHelper.RunFile("Scripts/Creatures/register", RegistryDatabase.Instance);

            System.Console.WriteLine(RegistryDatabase.Instance.ToString());


            using (var game = new RagnaRogueGame())
                game.Run();
        }
コード例 #2
0
 public void RegisterCreature(string scriptLocation)
 {
     CreatureRegistry reg = new CreatureRegistry();
     reg.Cloneable = ScriptEngineHelper.GetCreatureFromScript(scriptLocation);
     CreatureData.Add(scriptLocation, reg);
 }