本文整理汇总了C#中IPath类的典型用法代码示例。如果您正苦于以下问题:C# IPath类的具体用法?C# IPath怎么用?C# IPath使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPath类属于命名空间,在下文中一共展示了IPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBrotherFileWithName
internal static IFilePath GetBrotherFileWithName(IPath path, string fileName)
{
Debug.Assert(path != null);
Debug.Assert(fileName != null); // Enforced by contract
Debug.Assert(fileName.Length > 0); // Enforced by contract
return path.ParentDirectoryPath.GetChildFileWithName(fileName);
}
示例2: ChangeUnitLocation
private void ChangeUnitLocation(IPath pathToTheTargetPlanet, IUnit unitToTeleport, ILocation targetLocation)
{
pathToTheTargetPlanet.TargetLocation.Planet.Units.Add(unitToTeleport);
unitToTeleport.CurrentLocation.Planet.Units.Remove(unitToTeleport);
unitToTeleport.PreviousLocation = unitToTeleport.CurrentLocation;
unitToTeleport.CurrentLocation = targetLocation;
}
示例3: GetSisterFilePath
internal static IFilePath GetSisterFilePath(IPath path, string fileName)
{
Argument.IsNotNull(nameof(path), path);
Argument.IsNotNullOrEmpty(nameof(fileName), fileName);
return path.ParentDirectoryPath.GetChildFilePath(fileName);
}
示例4: Axis
/// <summary>
/// Creates a new instance of the axis class
/// </summary>
/// <param name="path">That path to use</param>
public Axis(IPath path)
{
_valid = true;
_path = path;
SetPath(path);
}
示例5: SelectableObject
public SelectableObject(Guid owner ,string name, IPath path)
{
m_Owner = owner;
m_Bounds = new Box(20.0, 20.0);
m_Name = name;
m_Path = path;
}
示例6: SubOperation
internal SubOperation(MouseArea mc, IPath path)
{
this.currentGraph = null;
this.mouseAreaControl = null;
this.mouseAreaControl = mc;
this.CurrentGraph = path;
}
示例7: GetBrotherDirectoryWithName
internal static IDirectoryPath GetBrotherDirectoryWithName(IPath path, string directoryName)
{
Debug.Assert(path != null);
Debug.Assert(directoryName != null); // Enforced by contract
Debug.Assert(directoryName.Length > 0); // Enforced by contract
return path.ParentDirectoryPath.GetChildDirectoryWithName(directoryName);
}
示例8: GetSisterDirectoryPath
internal static IDirectoryPath GetSisterDirectoryPath(IPath path, string directoryName)
{
Argument.IsNotNull(nameof(path), path);
Argument.IsNotNullOrEmpty(nameof(directoryName), directoryName);
return path.ParentDirectoryPath.GetChildDirectoryPath(directoryName);
}
示例9: PruneOperation
/// <summary>
/// Initializes a new instance of the <see cref="SelfMediaDatabase.Core.Operations.Prune.PruneOperation"/> class.
/// </summary>
/// <param name="directory">Injection wrapper of <see cref="System.IO.Directory"/>.</param>
/// <param name="file">Injection wrapper of <see cref="System.IO.File"/>.</param>
/// <param name="path">Injection wrapper of <see cref="System.IO.Path"/>.</param>
/// <param name="imageComparer">Image comparer.</param>
/// <param name="fileSystemHelper">Helper to access to files.</param>
public PruneOperation(
IDirectory directory,
IFile file,
IPath path,
IImageComparer imageComparer,
IFileSystemHelper fileSystemHelper,
IDialog dialog,
IRenameOperation renameOperation)
{
if (directory == null)
throw new ArgumentNullException("directory");
if (file == null)
throw new ArgumentNullException("file");
if (imageComparer == null)
throw new ArgumentNullException("imageComparer");
if (fileSystemHelper == null)
throw new ArgumentNullException("fileSystemHelper");
if (path == null)
throw new ArgumentNullException("path");
if (dialog == null)
throw new ArgumentNullException("dialog");
if (renameOperation == null)
throw new ArgumentNullException("renameOperation");
_directory = directory;
_file = file;
_path = path;
_imageComparer = imageComparer;
_fileSystemHelper = fileSystemHelper;
_dialog = dialog;
_renameOperation = renameOperation;
}
示例10: Record
public Record(IPath path)
{
_time = path.Time;
_position = path.Position;
_velocity = path.Velocity;
_acceleration = path.Acceleration;
}
示例11: LinearPath
public LinearPath(IPath anotherPath, int sampleCount)
{
List<Vector3> pointList = new List<Vector3>(1000);
PathPosition pathPosition = anotherPath.getStartPoint();
float pathLength = 0f;
float remaining = 0f;
while (remaining == 0)
{
remaining = anotherPath.move(pathPosition, 0.01f, out pathPosition);
pathLength += 0.01f;
}
pathLength -= remaining;
distanceBetweenPoints = pathLength / sampleCount;
pathPosition = anotherPath.getStartPoint();
remaining = 0;
while (remaining == 0f)
{
pointList.Add(anotherPath.getLocalPosition(pathPosition));
remaining = anotherPath.move(pathPosition, distanceBetweenPoints, out pathPosition);
}
if (remaining < distanceBetweenPoints / 2f)
pointList[pointList.Count - 1] = anotherPath.getLocalPosition(anotherPath.getEndPoint());
else
pointList.Add(anotherPath.getLocalPosition(anotherPath.getEndPoint()));
points = pointList.ToArray();
}
示例12: DefaultStayInLaneBehavior
/// <summary>
/// Gets a default behavior for a path segment
/// </summary>
/// <param name="location"></param>
/// <param name="vehicleState"></param>
/// <param name="exit"></param>
/// <param name="relative"></param>
/// <param name="stopSpeed"></param>
/// <param name="aMax"></param>
/// <param name="dt">timestep in seconds</param>
/// <returns></returns>
public static PathFollowingBehavior DefaultStayInLaneBehavior(RndfLocation location, VehicleState vehicleState,
RndfWaypointID action, ActionType actionType, bool relative, double stopSpeed, double aMax, double dt,
double maxSpeed, IPath path)
{
// get lane path
//IPath path = RoadToolkit.LanePath(location.Partition.FinalWaypoint.Lane, vehicleState, relative);
// check if the action is just a goal (note that exit and stop take precedence)
if (actionType == ActionType.Goal)
{
// get maximum speed
//double maxSpeed = location.Partition.FinalWaypoint.Lane.Way.Segment.SpeedInformation.MaxSpeed;
//double maxSpeed = maxV;
// generate path following behavior
//return new PathFollowingBehavior(path, new ScalarSpeedCommand(maxSpeed));
return null;
}
else
{
// get maximum speed
//double maxSpeed = location.Partition.FinalWaypoint.Lane.Way.Segment.SpeedInformation.MaxSpeed;
// get operational required distance to hand over to operational stop
double distance = RoadToolkit.DistanceUntilOperationalStop(RoadToolkit.DistanceToWaypoint(location, action)-TahoeParams.FL);
// get desired velocity
double desiredSpeed = RoadToolkit.InferFinalSpeed(0, stopSpeed, distance, maxSpeed, aMax, dt);
// generate path following behavior
//return new PathFollowingBehavior(path, new ScalarSpeedCommand(desiredSpeed));
return null;
}
}
示例13: GenerateInstallScriptRequestProcessor
public GenerateInstallScriptRequestProcessor(
IPath path,
IHelpContentManager helpContentManager)
{
_path = path;
_helpContentManager = helpContentManager;
}
示例14: IPathToPoints
public static List<Vector2> IPathToPoints(IPath p)
{
List<Vector2> pts = new List<Vector2>();
foreach (IPathSegment lp in p)
pts.Add(lp.Start);
pts.Add(p.EndPoint.pt);
return pts;
}
示例15: Matches
public bool Matches(IRoute route, IPath path)
{
var routePath = route.Path;
if (!routePath.IsLiteral)
return false;
return routePath.LiteralPath.Equals(path.LiteralPath);
}