public MiniSimulator CreateSimulator() { MiniSimulator sim = new MiniSimulator(); Controller.Metaverse.AttachSimulator(sim); return(sim); }
public void Simulation0() { // server side SingleSimServer server = new SingleSimServer(); //register this server and attach a sim to it server.Initialize(); MiniSimulator simulator = server.CreateSimulator(); //client side Controller.Client.FileInsertNewSingleFileScript("/Simulation0.cs", @" using System; public class Simulation0Script : AGenericScript { public bool Active { get { return true; } } public void Run( float delta ) { Sim.Trace( ""Incremending world data"" ); void IncrementSimWorldData(); } } "); //server side again to run the newly added script Assert.AreEqual(1, server.Model.Data); simulator.ScriptExecutor.Run(); Assert.AreEqual(2, server.Model.Data); simulator.ScriptExecutor.Run(); Assert.AreEqual(3, server.Model.Data); simulator.ScriptExecutor.Run(); Assert.AreEqual(4, server.Model.Data); return; }
public MiniSimulator CreateSimulator() { MiniSimulator sim = new MiniSimulator(); Controller.Metaverse.AttachSimulator( sim ); return sim; }