本文整理汇总了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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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 };
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}