private void AddAssembly(MyModContext context, MyStringId myStringId, Assembly assembly) { if (Scripts.ContainsKey(myStringId)) { MySandboxGame.Log.WriteLine(string.Format("Script already in list {0}", myStringId.ToString())); Debug.Fail(string.Format("Script already in list {0}", myStringId.ToString())); return; } HashSet <MyStringId> names; if (!ScriptsPerMod.TryGetValue(context, out names)) { names = new HashSet <MyStringId>(); ScriptsPerMod.Add(context, names); } names.Add(myStringId); Scripts.Add(myStringId, assembly); foreach (var type in assembly.GetTypes()) { MyConsole.AddCommand(new MyCommandScript(type)); } TryAddEntityScripts(context, assembly); AddStatScripts(assembly); }
private void AddAssembly(MyModContext context, MyStringId myStringId, Assembly assembly) { #if XB1 // XB1_ALLINONEASSEMBLY System.Diagnostics.Debug.Assert(false, "XB1 TODO?"); #else // !XB1 if (Scripts.ContainsKey(myStringId)) { MySandboxGame.Log.WriteLine(string.Format("Script already in list {0}", myStringId.ToString())); Debug.Fail(string.Format("Script already in list {0}", myStringId.ToString())); return; } HashSet <MyStringId> names; if (!ScriptsPerMod.TryGetValue(context, out names)) { names = new HashSet <MyStringId>(); ScriptsPerMod.Add(context, names); } names.Add(myStringId); Scripts.Add(myStringId, assembly); foreach (var type in assembly.GetTypes()) { MyConsole.AddCommand(new MyCommandScript(type)); } TryAddEntityScripts(context, assembly); AddStatScripts(assembly); #endif // !XB1 }
private void AddAssembly(MyStringId myStringId, Assembly assembly) { if (Scripts.ContainsKey(myStringId)) { MySandboxGame.Log.WriteLine(string.Format("Script already in list {0}", myStringId.ToString())); Debug.Fail(string.Format("Script already in list {0}", myStringId.ToString())); return; } Scripts.Add(myStringId, assembly); foreach (var type in assembly.GetTypes()) { MyConsole.AddCommand(new MyCommandScript(type)); } TryAddEntityScripts(assembly); }
static MyCommandEntity() { MyConsole.AddCommand(new MyCommandEntity()); }
static MyCommandCharacter() { MyConsole.AddCommand(new MyCommandCharacter()); }
static MyCommandConsole() { MyConsole.AddCommand(new MyCommandConsole()); }