当前位置: 首页>>代码示例>>C#>>正文


C# Simulator类代码示例

本文整理汇总了C#中Simulator的典型用法代码示例。如果您正苦于以下问题:C# Simulator类的具体用法?C# Simulator怎么用?C# Simulator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Simulator类属于命名空间,在下文中一共展示了Simulator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateBookWrittenCallback

        public static ObjectGuid CreateBookWrittenCallback(object customData, ref Simulator.ObjectInitParameters initData, Quality quality)
        {
            BookWrittenData data = customData as BookWrittenData;
            if (data == null) return ObjectGuid.InvalidObjectGuid;

            try
            {
                Notify(data.Title);

                BookWritten book = GlobalFunctions.CreateObjectOutOfWorld("BookWritten") as BookWritten;
                if (book == null)
                {
                    return ObjectGuid.InvalidObjectGuid;
                }

                book.InitBookCommon(data);

                return book.ObjectId;
            }
            catch(Exception e)
            {
                Common.Exception(data.ID, e);
                return ObjectGuid.InvalidObjectGuid;
            }
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:25,代码来源:WrittenWord.cs

示例2: Objects_OnObjectUpdated

 private void Objects_OnObjectUpdated(Simulator simulator, ObjectUpdate update, ulong regionHandle, ushort timeDilation)
 {
     if (startTime == 0) return;
     if (update.LocalID == Client.Self.LocalID)
     {
         XYMovement();
         ZMovement();
         if (Client.Self.Movement.AtPos || Client.Self.Movement.AtNeg)
         {
             Client.Self.Movement.TurnToward(target);
             Debug("Flyxy ");
         }
         else if (Client.Self.Movement.UpPos || Client.Self.Movement.UpNeg)
         {
             Client.Self.Movement.TurnToward(target);
             //Client.Self.Movement.SendUpdate(false);
             Debug("Fly z ");
         }
         else if (Vector3.Distance(target, Client.Self.SimPosition) <= 2.0)
         {
             EndFlyto();
             Debug("At Target");
         }
     }
     if (Environment.TickCount - startTime > duration)
     {
         EndFlyto();
         Debug("End Flyto");
     }
 }
开发者ID:3di,项目名称:3di-viewer-rei-libs,代码行数:30,代码来源:FlyToCommand.cs

示例3: RingTest

    /// <summary>First half builds the ring, second half tests the connection handler...</summary>
    public void RingTest() {
      Parameters p = new Parameters("Test", "Test");
      string[] args = "-b=.2 -c --secure_senders -s=50".Split(' ');
      Assert.AreNotEqual(-1, p.Parse(args), "Unable to parse" + p.ErrorMessage);
      Simulator sim = new Simulator(p);
      _sim = sim;
      Assert.IsTrue(sim.Complete(true), "Simulation failed to complete the ring");

      SimpleTimer.RunSteps(fifteen_mins, false);
      var nm0 = sim.TakenIDs.Values[0];
      int idx = 1;
      NodeMapping nm1 = null;
      do {
        nm1 = sim.TakenIDs.Values[idx++];
      } while(Simulator.AreConnected(nm0.Node, nm1.Node) && idx < sim.TakenIDs.Count);

      Assert.IsFalse(Simulator.AreConnected(nm0.Node, nm1.Node), "Sanity check");
      var ptype = new PType("chtest");
      var ch0 = new ConnectionHandler(ptype, (StructuredNode) nm0.Node);
      var ch1 = new ConnectionHandler(ptype, (StructuredNode) nm1.Node);
      ConnectionHandlerTest(nm0.Node, nm1.Node, ch0, ch1);

      SimpleTimer.RunSteps(fifteen_mins * 2, false);

      Assert.IsFalse(Simulator.AreConnected(nm0.Node, nm1.Node), "Sanity check0");
      ptype = new PType("chtest1");
      ch0 = new SecureConnectionHandler(ptype, (StructuredNode) nm0.Node, nm0.Sso);
      ch1 = new SecureConnectionHandler(ptype, (StructuredNode) nm1.Node, nm1.Sso);
      ConnectionHandlerTest(nm0.Node, nm1.Node, ch0, ch1);
    }
开发者ID:pstjuste,项目名称:brunet,代码行数:31,代码来源:SimulatorUnit.cs

示例4: LoadUtilityFuncLib

        public static UtilityFuncLib LoadUtilityFuncLib(string file, Simulator sim)
        {
            Assembly utilFile;
            UtilityFuncLib lib;

            try
            {
                utilFile = Assembly.LoadFrom(file);
                Type mainType;

                foreach (Type t in utilFile.GetTypes())
                {
                    if (t.Name == "UtilityFuncMain")
                    {
                        mainType = t;

                        lib = (UtilityFuncLib)Activator.CreateInstance(mainType, sim);

                        return lib;
                    }
                }
            }
            catch (ApplicationException ex)
            {
                // Error loading utility func library
            }

            return null;
        }
开发者ID:rheech,项目名称:system-of-systems-testing-framework,代码行数:29,代码来源:UtilityFuncLib.cs

示例5: InfiniteWave

 public InfiniteWave(Simulator simulator, DescriptorInfiniteWaves descriptor)
 {
     Simulator = simulator;
     Descriptor = descriptor;
     NbWavesAsked = 0;
     ActualDifficulty = Descriptor.StartingDifficulty - Descriptor.DifficultyIncrement;
 }
开发者ID:jodigiordano,项目名称:commander,代码行数:7,代码来源:InfiniteWave.cs

示例6: CreateObjectWithOverrides

 private static IGameObject CreateObjectWithOverrides(ulong instance, ProductVersion version, Vector3 initPos, int level, Vector3 initFwd, Hashtable overrides, Simulator.ObjectInitParameters initData)
 {
     GlobalFunctions.FillInInitData(initPos, level, initFwd, ref initData);
     IGameObject createdObject = CreateObjectInternal(instance, version, overrides, initData);
     GlobalFunctions.CheckForFailure(createdObject, "Missing object resource instance " + instance + Common.NewLine);
     return createdObject;
 }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:7,代码来源:ObjectCreation.cs

示例7: Ai

        public Ai(Simulator simulator)
        {
            this.simulator = simulator;
            this.ticks = simulator.Ticks;
            kruispunten = new List<IKruispuntType>();

            // maak een initial state aan
            foreach (IKruispunt kruispunt in this.simulator.Kruispunten)
            {
                if (kruispunt is Type1)
                {
                    kruispunten.Add(new KruispuntType1(kruispunt, simulator));
                }

                else if (kruispunt is Type2)
                {
                    kruispunten.Add(new KruispuntType2(kruispunt, simulator));
                }

                else if (kruispunt is Type3)
                {
                    kruispunten.Add(new KruispuntType3(kruispunt, simulator));
                }

                else if (kruispunt is Type4)
                {
                    kruispunten.Add(new KruispuntType4(kruispunt, simulator));
                }
            }

            // register event handlers
            this.simulator.postSimulate += new EventHandler(simulator_postSimulate);
            this.simulator.preSimulate += new EventHandler(simulator_preSimulate);
        }
开发者ID:rens,项目名称:fhict-proftaak3,代码行数:34,代码来源:Ai.cs

示例8: StandardInteractionProvider

 public StandardInteractionProvider(Simulator simulator, AbstractWindowsEnvironment environmentInterface,
     out Action cancelCallback)
 {
     this.simulator = simulator;
     this.environmentInterface = environmentInterface;
     cancelCallback = HandleCancelCallback;
 }
开发者ID:kpreisser,项目名称:MouseClickSimulator,代码行数:7,代码来源:StandardInteractionProvider.cs

示例9: SimulatorSpell

 public SimulatorSpell (Simulator sim, string name)
     : base(name)
 {
     Contract.Requires(sim != null);
     Contract.Requires(!string.IsNullOrEmpty(name));
     
     Sim = sim;
 }
开发者ID:chippydip,项目名称:RetRotationSim,代码行数:8,代码来源:Spell.cs

示例10: ShouldFinishWithConclusiveMatch

        public void ShouldFinishWithConclusiveMatch()
        {
            var match = A.Match.Build();
            var simulator = new Simulator(randomizer);
            simulator.Play(match);

            Assert.That(match.IsConclusive, Is.True);
        }
开发者ID:MilenPavlov,项目名称:EuroManager,代码行数:8,代码来源:SimulatorTests.cs

示例11: ShouldFinishWithInactiveMatch

        public void ShouldFinishWithInactiveMatch()
        {
            var match = A.Match.Build();
            var simulator = new Simulator(randomizer);
            simulator.Play(match);

            Assert.That(match.IsActive, Is.False);
        }
开发者ID:MilenPavlov,项目名称:EuroManager,代码行数:8,代码来源:SimulatorTests.cs

示例12: ShouldGenerateMatchResult

        public void ShouldGenerateMatchResult()
        {
            var match = A.Match.Build();
            var simulator = new Simulator(randomizer);
            var result = simulator.Play(match);

            Assert.That(result, Is.Not.Null);
        }
开发者ID:MilenPavlov,项目名称:EuroManager,代码行数:8,代码来源:SimulatorTests.cs

示例13: Main

        static void Main(string[] args)
        {
            var limitOrderBook = new StandardLimitOrderBook();
            var commsModule = SignalRCommunicationsHandler.Instance;
            var simulator = new Simulator(limitOrderBook, commsModule, commsModule);

            System.Console.ReadKey();
        }
开发者ID:preyen,项目名称:MarketSimulator,代码行数:8,代码来源:Program.cs

示例14: SimulatorInputInterface

 public SimulatorInputInterface(Simulator.OurSimulator os)
     : base()
 {
     //For conversion into controller units
     worldWidth = (os.Algo.dim[0] * 100) / this.scale;
     worldHeight = (os.Algo.dim[1] * 100) / this.scale;
     this.os = os;
 }
开发者ID:SamirBanna,项目名称:cs266-simcon,代码行数:8,代码来源:SimulatorInputInterface.cs

示例15: CompleteTheDtlsRing

//    [Test]
    public void CompleteTheDtlsRing() {
      Parameters p = new Parameters("Test", "Test");
      string[] args = "-b=.2 --dtls -c --secure_edges -s=25".Split(' ');
      Assert.AreNotEqual(-1, p.Parse(args), "Unable to parse" + p.ErrorMessage);;
      Simulator sim = new Simulator(p);
      Assert.IsTrue(sim.Complete(true), "Simulation failed to complete the ring");
      sim.Disconnect();
    }
开发者ID:hseom,项目名称:brunet-1,代码行数:9,代码来源:SimulatorUnit.cs


注:本文中的Simulator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。