コード例 #1
0
ファイル: MiniSimulator.cs プロジェクト: beyonddiana/osmp-cs
        public MiniSimulator CreateSimulator()
        {
            MiniSimulator sim = new MiniSimulator();

            Controller.Metaverse.AttachSimulator(sim);
            return(sim);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
ファイル: MiniSimulator.cs プロジェクト: hughperkins/osmp-cs
 public MiniSimulator CreateSimulator()
 {
     MiniSimulator sim = new MiniSimulator();
     Controller.Metaverse.AttachSimulator( sim );
     return sim;
 }