本文整理汇总了C#中DirectionType类的典型用法代码示例。如果您正苦于以下问题:C# DirectionType类的具体用法?C# DirectionType怎么用?C# DirectionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectionType类属于命名空间,在下文中一共展示了DirectionType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Convert
static public string Convert(double bytes, double reference, DirectionType direction, string format)
{
ConversionType conversionType;
conversionType = GetConversionType(reference);
conversionType = MoveDirection(conversionType, direction);
return Convert(bytes, conversionType, format);
}
开发者ID:jltrem,项目名称:DDay.Update,代码行数:7,代码来源:DownloadedBytesStringConverter.cs
示例2: PacketLogEntry
public PacketLogEntry(DateTime time, DirectionType direction, string address, byte[] data)
{
Time = time;
Direction = direction;
Address = address;
Data = data;
}
开发者ID:swax,项目名称:CodePerspective,代码行数:7,代码来源:G2Header.cs
示例3: changeDirectionRandom
// ------------------------------------------------------------------------------------ //
private void changeDirectionRandom()
{
float angle = 0;
if (currentDirectionType == DirectionType.Forward)
{
if (Probability.getProbability(50)) {
currentDirectionType = DirectionType.Left;
angle = rotateAngle;
}
else {
currentDirectionType = DirectionType.Right;
angle = -rotateAngle;
}
}
else if (currentDirectionType == DirectionType.Left)
{
currentDirectionType = DirectionType.Forward;
angle = -rotateAngle;
}
else if (currentDirectionType == DirectionType.Right)
{
currentDirectionType = DirectionType.Forward;
angle = rotateAngle;
}
rotateUnit(angle);
}
开发者ID:YuriyKokosha,项目名称:ZombieSmash,代码行数:29,代码来源:UnitStateRunDrunk.cs
示例4: SortNode
public SortNode(XmlNode xmlNode, InternalScriptSettings settings)
: base(xmlNode, settings)
{
// Load attributes
foreach (XmlAttribute attr in xmlNode.Attributes) {
switch (attr.Name) {
case "direction":
string dirStr = attr.Value.ToLower().Trim();
if (dirStr == "desc" || dirStr == "descending")
direction = DirectionType.DESCENDING;
else if (dirStr == "asc" || dirStr == "ascending")
direction = DirectionType.ASCENDING;
else {
logger.Error("Invalid sort direction on: " + xmlNode.OuterXml);
}
break;
case "by":
sortBy = attr.Value;
break;
}
}
// Validate BY attribute
if (sortBy == null) {
logger.Error("Missing BY attribute on: " + xmlNode.OuterXml);
loadSuccess = false;
return;
}
}
开发者ID:MichelZ,项目名称:moving-pictures-michelz,代码行数:30,代码来源:SortNode.cs
示例5: Thermometer
UnitsType m_Units = UnitsType.Celsius; // this defines the units of the new input temperatures, but our calculations will be in Celcius
#endregion Fields
#region Constructors
// constructor
public Thermometer(UnitsType units, DirectionType direction, double threshold, double hysterisis)
{
Units = units;
Direction = direction;
Threshold = threshold;
HysterisisThreshold = hysterisis;
}
开发者ID:dennex,项目名称:TemperatureDetector,代码行数:14,代码来源:Thermometer.cs
示例6: PacketLogEntry
public PacketLogEntry(DateTime time, TransportProtocol protocol, DirectionType direction, DhtAddress address, byte[] data)
{
Time = time;
Protocol = protocol;
Direction = direction;
Address = address;
Data = data;
}
开发者ID:RoelofSol,项目名称:DeOps,代码行数:8,代码来源:G2Header.cs
示例7: Tree
public Tree(int x, int y)
{
base.Initialize(x, y, 1, 1, Texture);
direction = DirectionType.South;
Name = "Tree";
}
开发者ID:johnfn,项目名称:Illumination,代码行数:8,代码来源:Tree.cs
示例8: HttpNetworkStream
public HttpNetworkStream(DirectionType direction, Socket socket,
System.IO.FileAccess fileAccess, bool ownsSocket)
{
Direction = direction;
_socket = socket;
_stream = new PrependableNetworkStream(socket, fileAccess, ownsSocket);
_unknownContentLength = true;
}
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:8,代码来源:HttpNetworkStream.cs
示例9: ResetCounter
public void ResetCounter(StateType state, DirectionType direction)
{
if (direction != Direction) {
_counter = 1000;
_animationIndex = 0;
}
State = state;
Direction = direction;
}
开发者ID:wmccullough,项目名称:Windfish,代码行数:10,代码来源:Animation.cs
示例10: TransitDescription
public TransitDescription(Route route, DirectionType transitType)
{
if (route == null)
{
throw new ArgumentNullException("route");
}
this.TransitType = transitType;
this.StartLocation = route.RouteLegs[0].ActualStart.AsGeoCoordinate();
this.EndLocation = route.RouteLegs[0].ActualEnd.AsGeoCoordinate();
this.TravelDuration = route.TravelDuration;
this.ArrivalTime = route.RouteLegs[0].EndTime.ToShortTimeString();
this.DepartureTime = route.RouteLegs[0].StartTime.ToShortTimeString();
// TODO: need to add endpoint to the step list?
this.ItinerarySteps = new ObservableCollection<ItineraryStep>();
var stepNumber = 0;
foreach (var topLeg in route.RouteLegs[0].ItineraryItems)
{
this.ItinerarySteps.Add(new ItineraryStep(topLeg, ++stepNumber));
// calculate the walking start and end times
if (this.ItinerarySteps[stepNumber - 1].IconType == "Walk")
{
if (stepNumber == 1)
{
// WalkOnly directions needs to be set a default time. Using current time
this.ItinerarySteps[stepNumber - 1].StartTime = this.TransitType == DirectionType.WalkOnly ? DateTime.Now : route.RouteLegs[0].StartTime;
}
else
{
this.ItinerarySteps[stepNumber - 1].StartTime = this.ItinerarySteps[stepNumber - 2].EndTime;
}
this.ItinerarySteps[stepNumber - 1].EndTime = this.ItinerarySteps[stepNumber - 1].StartTime + TimeSpan.FromSeconds(topLeg.TravelDuration);
}
}
this.ItinerarySteps[0].StepType = ItineraryStep.ItineraryStepType.FirstStep;
this.ItinerarySteps[this.ItinerarySteps.Count - 1].StepType = ItineraryStep.ItineraryStepType.LastStep;
// check the first and last step for generic strings to replace
// TODO: need a better place to put this
this.ItinerarySteps[0].Instruction = this.ItinerarySteps[0].Instruction.Replace(SR.SourceLocation, ViewModelLocator.MainMapViewModelStatic.StartLocationText);
this.ItinerarySteps[this.ItinerarySteps.Count - 1].Instruction = this.ItinerarySteps[this.ItinerarySteps.Count - 1].Instruction.Replace(SR.DestinationLocation, ViewModelLocator.MainMapViewModelStatic.EndLocationText);
this.PathPoints = route.RoutePaths[0].Line;
this.MapView = route.BoundingBox.AsLocationRect();
}
开发者ID:kyvok,项目名称:TransitWP7,代码行数:50,代码来源:TransitDescription.cs
示例11: getRight
public static DirectionType getRight(DirectionType d)
{
switch (d) {
case DirectionType.NORTH: return DirectionType.NORTHEAST;
case DirectionType.NORTHEAST: return DirectionType.EAST;
case DirectionType.EAST : return DirectionType.SOUTHEAST;
case DirectionType.SOUTHEAST : return DirectionType.SOUTH;
case DirectionType.SOUTH : return DirectionType.SOUTHWEST;
case DirectionType.SOUTHWEST : return DirectionType.WEST;
case DirectionType.WEST : return DirectionType.NORTHWEST;
case DirectionType.NORTHWEST : return DirectionType.NORTH;
default : return DirectionType.NORTH;
}
}
开发者ID:MarjieVolk,项目名称:BeautyAndTheBeast,代码行数:14,代码来源:DirectionType.cs
示例12: Person
public Person(int x, int y)
: base(x, y, 1, 1, texturesMap[ProfessionType.Worker])
{
age = 0;
education = 0;
gender = GenderType.Male;
health = HEALTH_MAX;
profession = ProfessionType.Worker;
Random random = new Random();
direction = (DirectionType)(random.Next() % (int)DirectionType.SIZE);
remainingMovement = movementRange = 36;
BlocksMovement = false;
Name = "Person";
}
开发者ID:johnfn,项目名称:Illumination,代码行数:15,代码来源:Person.cs
示例13: GetDirectionalImageManager
private IImageManager GetDirectionalImageManager(IImageManager imageManager, DirectionType directionType)
{
//TODO: Compressed and PDF files need to be able to find each other for the case of a folder containing both .pdf and .cbr
IImageManager nextImageManager = null;
var path = imageManager.Location;
int directionOffset = directionType == DirectionType.Next ? 1 : -1;
//TODO: code for CompressedFileImageManager and FolderImageManager is virtually identical. Consolidate!
if ((imageManager is CompressedFileImageManager) || (imageManager is PDFImageManager))
{
var fileName = Path.GetFileName(path).ToLower();
var fileInfo = new FileInfo(path);
var supportFileTypes = imageManager is CompressedFileImageManager
? CompressedFileImageManager.SUPPORTED_FILETYPES
: PDFImageManager.SUPPORTED_FILETYPES;
var fileInfos = fileInfo.Directory.GetFiles()
.Where(x => supportFileTypes.Contains(x.Extension.ToLower()))
.OrderBy(x => x.Name, Utility.NaturalStringComparer)
.ToList();
var foundFileIndex = fileInfos.FindIndex(x => x.Name.ToLower() == fileName) + directionOffset;
if ((foundFileIndex < fileInfos.Count) && (foundFileIndex > -1))
{
imageManager.Dispose();
nextImageManager = this.Load(fileInfos[foundFileIndex].FullName);
}
}
else if (imageManager is FolderImageManager)
{
DirectoryInfo directoryInfo = new DirectoryInfo(path);
var directoryName = directoryInfo.Name.ToLower();
var directoryInfos = directoryInfo.Parent.GetDirectories()
.OrderBy(x => x.Name, Utility.NaturalStringComparer)
.ToList();
var foundDirectoryIndex = directoryInfos.FindIndex(x => x.Name.ToLower() == directoryName) + directionOffset;
if ((foundDirectoryIndex < directoryInfos.Count) && (foundDirectoryIndex > -1))
{
imageManager.Dispose();
nextImageManager = this.Load(directoryInfos[foundDirectoryIndex].FullName);
}
}
return nextImageManager;
}
开发者ID:theahuramazda,项目名称:Saluse-ComicReader,代码行数:47,代码来源:Engine.cs
示例14: Initialize
public void Initialize(string[] parameters)
{
if (parameters.Contains("Origin"))
hasOrigin = true;
if (parameters.Contains("Direction"))
direction = DirectionType.Direction;
else if (parameters.Contains("Angle"))
direction = DirectionType.Angle;
if (parameters.Contains("Speed"))
hasSpeed = true;
foreach (string param in parameters)
if (param == "Param")
paramCount++;
}
开发者ID:roflwaffl,项目名称:Phosphaze,代码行数:17,代码来源:Spawn.cs
示例15: InputOrder
public InputOrder(
string brokerID,
string investorID,
DirectionType direction,
OffsetFlag offsetFlag,
string instrumentID,
double price,
int volume,
string groupID)
{
this.BrokerID = brokerID;
this.InvestorID = investorID;
this.Direction = direction;
this.OffsetFlag = offsetFlag;
this.InstrumentID = instrumentID;
this.Price = price;
this.Volume = volume;
this.GroupID = groupID;
}
开发者ID:botvs,项目名称:QTS,代码行数:19,代码来源:InputOrder.cs
示例16: onUnitCollision
public override sealed void onUnitCollision(GameObject other)
{
base.onUnitCollision(other);
if (other.tag.Equals("LevelBorder"))
{
float angle = 0;
if (currentDirectionType == DirectionType.Left) {
currentDirectionType = DirectionType.Right;
angle = -rotateAngle*2;
}
else if (currentDirectionType == DirectionType.Right) {
currentDirectionType = DirectionType.Left;
angle = rotateAngle*2;
}
rotateUnit(angle);
}
}
开发者ID:YuriyKokosha,项目名称:ZombieSmash,代码行数:20,代码来源:UnitStateRunDrunk.cs
示例17: getAdjascentTile
public Tile getAdjascentTile(Tile t, DirectionType dir)
{
Tile retval = null;
switch(dir)
{
case DirectionType.West:
retval = getTileFromLocation(t.x, t.y - 1);
break;
case DirectionType.East:
retval = getTileFromLocation(t.x, t.y + 1);
break;
case DirectionType.North:
retval = getTileFromLocation(t.x - 1, t.y);
break;
case DirectionType.South:
retval = getTileFromLocation(t.x + 1, t.y);
break;
default: break;
}
return retval;
}
开发者ID:mengtest,项目名称:UnityRPG,代码行数:21,代码来源:Board.cs
示例18: moveCube
private void moveCube()
{
float testCubeXPos = _testCube.transform.position.x;
if (_dirType == DirectionType.Left){
_testCube.transform.Translate(Vector3.left * 0.5f);
} else if (_dirType == DirectionType.Right){
_testCube.transform.Translate(Vector3.right * 0.5f);
}
if (testCubeXPos < -3){
TestSignals.changeScaleSignal.dispatch();
_dirType = DirectionType.Right;
}
if (testCubeXPos > 3) {
TestSignals.normalScaleSignal.dispatch();
_dirType = DirectionType.Left;
}
Debug.Log(testCubeXPos);
}
开发者ID:HedrickDavid,项目名称:TemplateMVC,代码行数:22,代码来源:TestView.cs
示例19: ConvertTo
/// <summary>
///
/// </summary>
public static string ConvertTo(string text, TransliteType type, DirectionType direct)
{
string output = text;
Dictionary<string, string> tdictF = SetDictionary(type);
foreach (KeyValuePair<string, string> key in tdictF)
{
if(direct == DirectionType.OnKaz)
{
output = output.Replace(key.Key, key.Value);
}
else if(direct == DirectionType.OutKaz)
{
output = output.Replace(key.Value, key.Key);
}
}
Dispose();
return output;
}
开发者ID:ArseniySavin,项目名称:Qazaq-Transliteration,代码行数:25,代码来源:Initialization.cs
示例20: OnFocused
protected override bool OnFocused(DirectionType direction)
{
return true;
}
开发者ID:iainlane,项目名称:f-spot,代码行数:4,代码来源:Rating.cs
注:本文中的DirectionType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论