• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Simulator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: UpdateMiniMap

        private void UpdateMiniMap(Simulator sim)
        {
            if (this.InvokeRequired) this.BeginInvoke((MethodInvoker)delegate { UpdateMiniMap(sim); });
            else
            {
                Bitmap bmp = new Bitmap(256, 256);
                Graphics g = Graphics.FromImage(bmp);
                //SolidBrush brush = new SolidBrush(Color.FromArgb(90, 32, 32, 32));

                g.Clear(this.BackColor);

                g.FillRectangle(Brushes.White, 0f, 0f, 256f, 256f);

                if (sim.PositionIndexYou == -1 || sim.PositionIndexYou >= sim.AvatarPositions.Count) return;

                int i = 0;

                Vector3 myPos = sim.AvatarPositions[sim.PositionIndexYou];

                _Client.Network.CurrentSim.AvatarPositions.ForEach(delegate(Vector3 pos)
                {
                    int x = (int)pos.X;
                    int y = 255 - (int)pos.Y;
                    if (i == _Client.Network.CurrentSim.PositionIndexYou)
                    {
                        g.FillEllipse(Brushes.PaleGreen, x - 5, y - 5, 10, 10);
                        g.DrawEllipse(Pens.Green, x - 5, y - 5, 10, 10);
                    }
                    else
                    {
                        if (myPos.Z - (pos.Z * 4) > 5)
                        {
                            Point[] points = new Point[3] { new Point(x - 6, y - 6), new Point(x + 6, y - 6), new Point(x, y + 6) };
                            g.FillPolygon(Brushes.Red, points);
                            g.DrawPolygon(Pens.DarkRed, points);
                        }

                        else if (myPos.Z - (pos.Z * 4) < -5)
                        {
                            Point[] points = new Point[3] { new Point(x - 6, y + 6), new Point(x + 6, y + 6), new Point(x, y - 6) };
                            g.FillPolygon(Brushes.Red, points);
                            g.DrawPolygon(Pens.DarkRed, points);
                        }

                        else
                        {
                            g.FillEllipse(Brushes.Red, x - 5, y - 5, 10, 10);
                            g.DrawEllipse(Pens.DarkRed, x - 5, y - 5, 10, 10);
                        }
                    }
                    i++;
                });

                g.DrawImage(bmp, 0, 0);
                this.Image = bmp;
            }
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:57,代码来源:MiniMap.cs


示例17: StimuliForm

        public StimuliForm()
        {
            InitializeComponent();
            this.FormClosed += StimuliForm_FormClosed;

            this.simulator = SimulatorAccessor.simulator;

            Refresh();
        }
开发者ID:CODEJIN,项目名称:HJ-Net,代码行数:9,代码来源:StimuliForm.cs


示例18: Network_OnCurrentSimChanged

 void Network_OnCurrentSimChanged(Simulator PreviousSimulator)
 {
     GridRegion region;
     if (Client.Grid.GetGridRegion(Client.Network.CurrentSim.Name, GridLayerType.Objects, out region))
     {
         _MapImageID = region.MapImageID;
         Client.Assets.RequestImage(_MapImageID, ImageType.Baked);
     }
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:9,代码来源:MiniMap.cs


示例19: AutoAttack

 public AutoAttack (Simulator sim, Func<TimeSpan> swingTimer)
 {
     Contract.Requires(sim != null);
     Contract.Requires(swingTimer != null);
     
     Sim = sim;
     _swingTimer = swingTimer;
     
     NextSwing = TimeSpan.Zero;
 }
开发者ID:chippydip,项目名称:RetRotationSim,代码行数:10,代码来源:AutoAttack.cs


示例20: Ability

 public Ability(Simulator sim, string name, 
                 Func<TimeSpan> cooldown = null,
                 Func<TimeSpan> gcd = null,
                 Func<bool> isUsable = null)
     : base(sim, name)
 {
     _cooldown = cooldown ?? (() => TimeSpan.Zero);
     _gcd = gcd ?? (() => TimeSpan.FromSeconds(1.5));
     _isUsable = isUsable ?? (() => true);
 }
开发者ID:chippydip,项目名称:RetRotationSim,代码行数:10,代码来源:Ability.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Single类代码示例发布时间:2022-05-24
下一篇:
C# SimpleType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap