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


C# Leg类代码示例

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


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


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