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

C# Leg类代码示例

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

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



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

示例1: goToDirectionPair

    IEnumerator goToDirectionPair(Leg l1, Leg l2)
    {
        float movementTime = 0.5f;

        l1.goToIdle(movementTime);
        yield return new WaitForSeconds(movementTime);
        while(true)
        {
            l1.goToStart(movementTime);
            yield return new WaitForSeconds(movementTime);

            l2.goToIdle(movementTime);
            l1.goToEnd(movementTime);
            yield return new WaitForSeconds(movementTime);

            l2.goToStart(movementTime);
            yield return new WaitForSeconds(movementTime);

            l1.goToIdle(movementTime);
            l2.goToEnd(movementTime);
            yield return new WaitForSeconds(movementTime);
            if (waitForTransition)
                executeGaitTransition();
        }
    }
开发者ID:Hindi,项目名称:Hexapode-Unity,代码行数:25,代码来源:Hexapode.cs


示例2: ToLegDTO

 protected static LegDTO ToLegDTO(Leg leg)
 {
     VoyageNumber voyageNumber = leg.Voyage.VoyageNumber;
     UnLocode from = leg.LoadLocation.UnLocode;
     UnLocode to = leg.UnloadLocation.UnLocode;
     return new LegDTO(voyageNumber.IdString, from.IdString, to.IdString, leg.LoadTime, leg.UnloadTime);
 }
开发者ID:colourblendcreative,项目名称:ndddsample,代码行数:7,代码来源:ItineraryCandidateDTOAssembler.cs


示例3: toLegDTO

 internal static LegDTO toLegDTO(Leg leg)
 {
     var voyageNumber = leg.Voyage.VoyageNumber;
     var from = leg.LoadLocation.UnLocode;
     var to = leg.UnloadLocation.UnLocode;
     return new LegDTO(voyageNumber.Value, from.Value, to.Value, leg.LoadTime, leg.UnloadTime);
 }
开发者ID:awhatley,项目名称:dddsample.net,代码行数:7,代码来源:DTOAssembler.cs


示例4: AnErrorIsThrownIfAPlayerHasAVisitWhoIsNotInTheLeg

        public void AnErrorIsThrownIfAPlayerHasAVisitWhoIsNotInTheLeg()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            var visit = new Visit(player, 100);

            var newScore = leg.Visit(visit);
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:8,代码来源:LegTests.cs


示例5: FetchRoutesForSpecification

        public static Itinerary FetchRoutesForSpecification(RouteSpecification routeSpecification)
        {
            // TODO Remove hard-coding here
            var leg = new Leg(Location.Location.HongKong, Location.Location.Dallas, new DateTime(2012, 11, 9), new DateTime(2012, 11, 12));
            var legs = new List<Leg> { leg };

            return new Itinerary(legs);
        }
开发者ID:paulrayner,项目名称:dddsample,代码行数:8,代码来源:RoutingService.cs


示例6: CountTotalGoalsPerLeg

 public void CountTotalGoalsPerLeg()
 {
     Leg leg = new Leg();
     leg.AddMatch(new Match("avantul", "gloria", 1, 1));
     leg.AddMatch(new Match("sageata", "concordia", 7, 1));
     leg.AddMatch(new Match("astra", "ceahlaul", 3, 1));
     Assert.AreEqual(14, leg.CountTotalGoals());
 }
开发者ID:luchianalexandru,项目名称:JuniorMind,代码行数:8,代码来源:FootballOOP.cs


示例7: APlayerCanHaveAVisitAndSeeTheirScoreChange

        public void APlayerCanHaveAVisitAndSeeTheirScoreChange()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            leg.AddPlayer(player);
            var visit = new Visit(player, 100);

            var newScore = leg.Visit(visit);

            Assert.AreEqual(401, newScore);
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:11,代码来源:LegTests.cs


示例8: TwoLegsStub

 private static List<Leg> TwoLegsStub()
 {
     var leg1 = new Leg(Location.Location.HongKong,
                        Location.Location.LongBeach,
                        new DateTime(2012, 11, 9),
                        new DateTime(2012, 11, 12));
     var leg2 = new Leg(Location.Location.LongBeach,
                        Location.Location.Dallas,
                        new DateTime(2012, 11, 13),
                        new DateTime(2012, 11, 15));
     return new List<Leg> { leg1, leg2 };
 }
开发者ID:paulrayner,项目名称:dddsample,代码行数:12,代码来源:ItineraryTests.cs


示例9: LegWithSamePropertiesShouldBeSame

        public void LegWithSamePropertiesShouldBeSame()
        {
            var leg = new Leg(Location.Location.HongKong,
                              Location.Location.LongBeach,
                              new DateTime(2012, 11, 9),
                              new DateTime(2012, 11, 12));
            var expectedLeg = new Leg(Location.Location.HongKong,
                              Location.Location.LongBeach,
                              new DateTime(2012, 11, 9),
                              new DateTime(2012, 11, 12));

            Assert.AreEqual(expectedLeg, leg);
        }
开发者ID:paulrayner,项目名称:dddsample,代码行数:13,代码来源:LegTests.cs


示例10: AnErrorIsThronWhenAPlayerReaches0WithAnImpossibleCheckout

        public void AnErrorIsThronWhenAPlayerReaches0WithAnImpossibleCheckout()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            leg.AddPlayer(player);
            var visit = new Visit(player, 100);
            var checkoutVisit = new Visit(player, 101);

            leg.Visit(new Visit(player, 100));//401
            leg.Visit(new Visit(player, 100));//301
            leg.Visit(new Visit(player, 100));//201
            leg.Visit(new Visit(player, 39));//162
            leg.Visit(new Visit(player, 162));
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:14,代码来源:LegTests.cs


示例11: ItineraryWithDifferentSequenceOfLegsShouldNotBeEqual

        public void ItineraryWithDifferentSequenceOfLegsShouldNotBeEqual()
        {
            var leg1 = new Leg(Location.Location.HongKong,
                               Location.Location.LongBeach,
                               new DateTime(2012, 11, 9),
                               new DateTime(2012, 11, 12));
            var leg2 = new Leg(Location.Location.LongBeach,
                               Location.Location.Dallas,
                               new DateTime(2012, 11, 13),
                               new DateTime(2012, 11, 15));
            var legs = new List<Leg> { leg1, leg2 };
            var legsWithDifferentSequence = new List<Leg> { leg2, leg1 };

            Assert.AreNotEqual(new Itinerary(legsWithDifferentSequence), new Itinerary(legs));
        }
开发者ID:paulrayner,项目名称:dddsample,代码行数:15,代码来源:ItineraryTests.cs


示例12: APlayersScoreCanReachExacly0

        public void APlayersScoreCanReachExacly0()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            leg.AddPlayer(player);
            var visit = new Visit(player, 100);
            var checkoutVisit = new Visit(player, 101);

            leg.Visit(visit);//401
            leg.Visit(visit);//301
            leg.Visit(visit);//201
            leg.Visit(visit);//101
            var score = leg.Visit(checkoutVisit);//1 = bust, therefore 101

            Assert.AreEqual(0, leg.Players[0].Score);
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:16,代码来源:LegTests.cs


示例13: createLeg

        protected internal static Leg createLeg(Side side, Position position, double legOffset, short coxaId, short femurId, short tibiaId, double distanceToX, double distanceToZ, LegPosition legPosition)
        {
            Leg leg = new Leg(distanceToX, distanceToZ)
                          {
                              Side = side,
                              Position = position,
                              Offset = legOffset,
                              X = legPosition.X,
                              Y = legPosition.Y,
                              Z = legPosition.Z,
                              Coxa = new Coxa(3.8, legOffset, coxaId, 0, 0, side),
                              Femur = new Femur(7.6, -90, femurId, 0, 0, side),
                              Tibia = new Tibia(10.4, 120, tibiaId, 0, 0, side)
                          };

            return leg;
        }
开发者ID:evilmachina,项目名称:theMachine,代码行数:17,代码来源:RobotFactory.cs


示例14: LegsWithDifferentDatesShouldNotBeEqual

        public void LegsWithDifferentDatesShouldNotBeEqual()
        {
            var leg = new Leg(Location.Location.HongKong,
                              Location.Location.LongBeach,
                              new DateTime(2012, 11, 9),
                              new DateTime(2012, 11, 12));
            var legWithDifferentLoadDate = new Leg(Location.Location.HongKong,
                              Location.Location.LongBeach,
                              new DateTime(2012, 11, 10),
                              new DateTime(2012, 11, 12));
            var legWithDifferentUnloadDate = new Leg(Location.Location.HongKong,
                              Location.Location.LongBeach,
                              new DateTime(2012, 11, 9),
                              new DateTime(2012, 11, 13));

            Assert.AreNotEqual(legWithDifferentLoadDate, leg);
            Assert.AreNotEqual(legWithDifferentUnloadDate, leg);
        }
开发者ID:paulrayner,项目名称:dddsample,代码行数:18,代码来源:LegTests.cs


示例15: Human

    public Human(Gender g, string n)
    {
        entName = n;
        gender = g;
        increaseIDMain ();
        ID = IDMain;

         LeftArm = new Arm(MIDLEFT,g); //left and right arms with gender weighting
         RightArm = new Arm(MIDRIGHT,g);

         LeftLeg = new Leg (MIDMID, g);
         RightLeg = new Leg (MIDMID, g);

        Skeleton.Add (LeftArm);
        Skeleton.Add (LeftLeg);
        Skeleton.Add (RightArm);
        Skeleton.Add (RightLeg);
    }
开发者ID:Battlespud,项目名称:ducking-octo-shame,代码行数:18,代码来源:Human.cs


示例16: AddNewMatch

 public void AddNewMatch()
 {
     Leg leg = new Leg();
     leg.AddMatch(new Match("avantul", "gloria", 1, 1));
     Assert.AreEqual(1, leg.CountMatches());
 }
开发者ID:luchianalexandru,项目名称:JuniorMind,代码行数:6,代码来源:FootballOOP.cs


示例17: ICanCheckIfTheLegHasBeenWonWhenPlayerHasWon

        public void ICanCheckIfTheLegHasBeenWonWhenPlayerHasWon()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            leg.AddPlayer(player);

            leg.Visit(new Visit(player, 100));//401
            leg.Visit(new Visit(player, 100));//301
            leg.Visit(new Visit(player, 100));//201
            leg.Visit(new Visit(player, 100));//101
            leg.Visit(new Visit(player, 101));//0

            var hasWon = leg.HasPlayerWon(player);

            Assert.IsTrue(hasWon);
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:16,代码来源:LegTests.cs


示例18: PrepareLegs

        /// <summary>
        /// Prepares the legs on this path by allocating a unique ID to each primary face (and
        /// ensure that the primary face is cross-referenced to it's associated leg).
        /// </summary>
        /// <param name="opSequence">The sequence of the edit that created the legs.</param>
        /// <param name="legs">The legs involved (with only primary faces attached).</param>
        /// <returns>The last internal ID that was reserved.</returns>
        static uint PrepareLegs(uint opSequence, Leg[] legs)
        {
            // Allocate sequence numbers for each leg + primary face
            uint nextId = opSequence;

            foreach (Leg leg in legs)
            {
                // Reserve an ID for the leg itself (used for center point if the leg
                // is a circular arc).
                nextId++;

                // We should only be dealing with the primary face (alternate face comes via update,
                // or via deserialization of data that originated from the CEdit application).
                Debug.Assert(leg.AlternateFace == null);

                // Allocate a sequence number for the face
                LegFace face = leg.PrimaryFace;
                nextId++;
                face.Sequence = new InternalIdValue(nextId);

                // Reserve two IDs for every span (regardless of whether any feature will be created for it).
                nextId += ((uint)face.NumSpan * 2);

                // Ensure the face has been cross-referenced to the associated leg
                face.Leg = leg;
            }

            return nextId;
        }
开发者ID:steve-stanton,项目名称:backsight,代码行数:36,代码来源:PathOperation.cs


示例19: APlayersScoreRemainsTheSameWhenTheirOverallScoreGoBelow2

        public void APlayersScoreRemainsTheSameWhenTheirOverallScoreGoBelow2()
        {
            var leg = new Leg(501);
            var player = new Player("Andy");
            leg.AddPlayer(player);
            var visit = new Visit(player, 100);

            leg.Visit(visit);//401
            leg.Visit(visit);//301
            leg.Visit(visit);//201
            leg.Visit(visit);//101
            var score = leg.Visit(visit);//1 = bust, therefore 101

            Assert.AreEqual(101, leg.Players[0].Score);
        }
开发者ID:andycornforth,项目名称:Darts_Scorer,代码行数:15,代码来源:LegTests.cs


示例20: InitLegs2

 // float-float: currency swap, basis swap
 void InitLegs2(Leg leg1, Leg leg2, TradeInfo tinfo)
 {
     var sinfo = tinfo.Otc as SwapInfo;
     if (sinfo == null) return;
     leg1.NotionalCurrency = tinfo.Currency1;
     leg2.NotionalCurrency = tinfo.Currency2;
     leg1.StartDate = sinfo.SwapStartDate1;
     leg2.StartDate = sinfo.SwapStartDate2;
     leg1.EndDate = sinfo.SwapMaturity1;
     leg2.EndDate = sinfo.SwapMaturity2;
     leg1.Notional = Math.Abs(tinfo.Nominal1);
     leg2.Notional = Math.Abs(tinfo.Nominal2);
     leg1.Spread = sinfo.Spread1 / 100;
     leg2.Spread = sinfo.Spread2 / 100;
     // ...
 }
开发者ID:heimanhon,项目名称:researchwork,代码行数:17,代码来源:SwapImporter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Length类代码示例发布时间:2022-05-24
下一篇:
C# LeaveReason类代码示例发布时间: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