本文整理汇总了C#中DetectionType类的典型用法代码示例。如果您正苦于以下问题:C# DetectionType类的具体用法?C# DetectionType怎么用?C# DetectionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DetectionType类属于命名空间,在下文中一共展示了DetectionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessDetectedEventArgs
public ProcessDetectedEventArgs(String detectedProcess, int processesCount,
DetectionType detectionType)
: base()
{
this.DetectedProcess = detectedProcess;
this.DetectionType = detectionType;
this.ProcessesCount = processesCount;
}
示例2: CanMove
public virtual MoveResult CanMove(FloatRectangle bounds, Vector2 interpolation, DetectionType detectionType)
{
FloatRectangle xTarget = bounds.Displace(interpolation * Direction.Right);
FloatRectangle yTarget = bounds.Displace(interpolation * Direction.Down);
FloatRectangle target = bounds.Displace(interpolation);
return CanMove(bounds, interpolation, detectionType, xTarget, yTarget, target);
}
示例3: Notification
public Notification(String processName, int processCount, DetectionType detectionType)
{
this.ProcessName = processName;
this.DetectionType = detectionType;
this.ProcessCount = processCount;
this.Response = UserResponse.NoResponse;
InitializeComponent();
SetPosition();
RefreshComponents();
}
示例4: DetectFace
public DetectionReturn DetectFace(DetectionType detectionType, String fileName, int sensibility, int minSize)
{
HaarCascade faceDetection;
switch(detectionType)
{
case DetectionType.Profile:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_profileface.xml");
break;
case DetectionType.Face2:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_alt.xml");
break;
case DetectionType.Face3:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_alt2.xml");
break;
case DetectionType.Face4:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_alt_tree.xml");
break;
case DetectionType.Default:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_default.xml");
break;
case DetectionType.Face:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_default.xml");
break;
default:
faceDetection = new HaarCascade(@"C:\Users\wagner\Documents\visual studio 2013\Projects\FaceDetection\FaceDetection\haarcascade_frontalface_default.xml");
break;
}
Image<Bgr, byte> image = new Image<Bgr, byte>(fileName);
Image<Gray, byte> imageGray = image.Convert<Gray,byte>();
MCvAvgComp[] detectedFaces = imageGray.DetectHaarCascade(faceDetection, 1.1, sensibility, Emgu.CV.CvEnum.HAAR_DETECTION_TYPE.DEFAULT, new Size(minSize, minSize))[0];
List<Rectangle> rectList = new List<Rectangle>();
foreach (var face in detectedFaces)
{
rectList.Add(new Rectangle()
{
X = face.rect.X,
Y = face.rect.Y,
Height = face.rect.Height,
Width = face.rect.Height,
Size = face.rect.Size,
Location = face.rect.Location
});
}
return new DetectionReturn(image, rectList);
}
示例5: Skillshot
public Skillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
this.DetectionType = detectionType;
this.SpellData = spellData;
this.StartTick = startT;
this.Start = start;
this.End = end;
this.MissilePosition = start;
this.Direction = (end - start).Normalized();
this.Unit = unit;
//Create the spatial object for each type of skillshot.
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
this.Circle = new Geometry.Circle(this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotLine:
this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotMissileLine:
this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
this.Sector = new Geometry.Sector(
start,
this.CollisionEnd - start,
spellData.Radius * (float)Math.PI / 180,
spellData.Range);
break;
case SkillShotType.SkillshotRing:
this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius);
break;
}
this.UpdatePolygon(); //Create the polygon.
}
示例6: Skillshot
public Skillshot(DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit,
Obj_AI_Base target = null
)
{
DetectionType = detectionType;
SpellData = spellData;
StartTick = startT;
Start = start;
End = end;
MissilePosition = start;
Direction = (end - start).Normalized();
Target = target;
Unit = unit;
//Create the spatial object for each type of skillshot.
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
Circle = new Geometry.Circle(CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotLine:
Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotMissileLine:
Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new Geometry.Sector(
start, CollisionEnd - start, spellData.Radius * (float) Math.PI / 180, spellData.Range);
break;
case SkillShotType.SkillshotRing:
Ring = new Geometry.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius);
break;
}
UpdatePolygon(); //Create the polygon.
}
示例7: ProcessExcludedDetectionTypes
/// <summary>
/// In cases where the user decided to use the shortcut NONE, this method sets the value of the ExcludedDetectionType property to reflect the correct values.
/// </summary>
public static DetectionType[] ProcessExcludedDetectionTypes(DetectionType[] excludedDetectionTypes)
{
if (excludedDetectionTypes == null || excludedDetectionTypes.Length == 0)
{
return excludedDetectionTypes;
}
if (excludedDetectionTypes.Length == 1)
{
if (excludedDetectionTypes[0] == DetectionType.None)
{
return new DetectionType[] { };
}
}
else
{
if (excludedDetectionTypes.Contains(DetectionType.None))
{
throw new Exception(string.Format(Properties.Resources.InvalidExcludedDetectionTypeSet, DetectionType.None));
}
}
return excludedDetectionTypes;
}
示例8: Skillshot
public Skillshot(DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
DetectionType = detectionType;
SpellData = spellData;
StartTick = startT;
Start = start;
End = end;
Direction = (end - start).Normalized();
Unit = unit;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
Circle = new Geometry.Circle(CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotLine:
Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotMissileLine:
Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new Geometry.Sector(
start, CollisionEnd - start, spellData.Radius * (float) Math.PI / 180, spellData.Range);
break;
case SkillShotType.SkillshotRing:
Ring = new Geometry.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius);
break;
case SkillShotType.SkillshotArc:
Arc = new Geometry.Arc(
start, end, Config.SkillShotsExtraRadius + (int) ObjectManager.Player.BoundingRadius);
break;
}
UpdatePolygon();
}
示例9: TriggerOnDetectSkillshot
private static void TriggerOnDetectSkillshot(
this SpellData spellData,
DetectionType detectionType,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
if (OnDetectSkillshot != null)
{
OnDetectSkillshot(new Skillshot(detectionType, spellData, startT, start, end, unit));
}
}
示例10: Skillshot
public Skillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit,
MissileClient missile = null)
{
this.DetectionType = detectionType;
this.SpellData = spellData;
this.StartTick = startT;
this.Start = start;
this.End = end;
this.Direction = (end - start).LSNormalized();
this.Unit = unit;
this.Missile = missile;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
this.Circle = new Geometry.Circle(this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotLine:
this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotMissileLine:
this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
this.Sector = new Geometry.Sector(
start,
this.CollisionEnd - start,
spellData.Radius * (float)Math.PI / 180,
spellData.Range);
break;
case SkillShotType.SkillshotRing:
this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius);
break;
case SkillShotType.SkillshotArc:
this.Arc = new Geometry.Arc(
start,
end,
Config.SkillShotsExtraRadius + (int)Program.Player.BoundingRadius);
break;
}
this.UpdatePolygon();
}
示例11: TriggerOnDetectSkillshot
private static void TriggerOnDetectSkillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Vector2 originalEnd,
Obj_AI_Base unit,
MissileClient missile = null)
{
OnDetectSkillshot?.Invoke(new Skillshot(detectionType, spellData, startT, start, end, unit, missile) { OriginalEnd = originalEnd });
}
示例12: OnInspectorGUI
public override void OnInspectorGUI ()
{
Climate_Zone_C self = (Climate_Zone_C)target;
//Time Number Variables
EditorGUILayout.LabelField("UniStorm Climate Generator", EditorStyles.boldLabel);
EditorGUILayout.LabelField("By: Black Horizon Studios", EditorStyles.label);
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.LabelField("Climate Options", EditorStyles.boldLabel);
EditorGUILayout.Space();
self.ClimateName = EditorGUILayout.TextField ("Climate Name", self.ClimateName);
EditorGUILayout.HelpBox("The name of your climate.", MessageType.None, true);
EditorGUILayout.Space();
editorDetectionType = (DetectionType)self.DetectionType;
editorDetectionType = (DetectionType)EditorGUILayout.EnumPopup("Detection Type", editorDetectionType);
self.DetectionType = (int)editorDetectionType;
EditorGUILayout.HelpBox("The Detection Type determins how your weather zone is triggered. This can be based on the Height (where your player must reach a certain height in order for the Climate Zone to change; this can be perfect for Mountains) or based on an OnTrigger collision (where you player must hit the trigger in order for the Climate Zone to change; perfect for Desert areas, Rainforests, Swamps, etc).", MessageType.None, true);
EditorGUILayout.Space();
if (self.DetectionType == 1)
{
bool PlayerObject = !EditorUtility.IsPersistent (self);
self.PlayerObject = (GameObject)EditorGUILayout.ObjectField ("Player Object", self.PlayerObject, typeof(GameObject), PlayerObject);
EditorGUILayout.HelpBox("Assign your player object here. The Climate System will use your player's height (Y position) to detect when to change Climate Zones.", MessageType.None, true);
EditorGUILayout.Space();
self.climateHeight = EditorGUILayout.IntField ("Climate Height", self.climateHeight);
EditorGUILayout.HelpBox("The height needed to change the Climate Zone.", MessageType.None, true);
EditorGUILayout.Space();
editorIfGreaterOrLessThan = (IfGreaterOrLessThan)self.ifGreaterOrLessThan;
editorIfGreaterOrLessThan = (IfGreaterOrLessThan)EditorGUILayout.EnumPopup("If Greater Or Less Than", editorIfGreaterOrLessThan);
self.ifGreaterOrLessThan = (int)editorIfGreaterOrLessThan;
EditorGUILayout.HelpBox("Based on the height above, does your player need to be above or below " + self.climateHeight.ToString() + " to make the climate change? Example: Moutains are above 300 units and Grasslands are below 300 units." , MessageType.None, true);
EditorGUILayout.Space();
self.updateInterval = EditorGUILayout.FloatField ("Update Interval", self.updateInterval);
EditorGUILayout.HelpBox("How often (in seconds) the Climate Zone is updated to check the player's height" , MessageType.None, true);
}
if (self.DetectionType == 0)
{
self.playerTag = EditorGUILayout.TextField ("Tag Name", self.playerTag);
EditorGUILayout.HelpBox("The Tag name of your player.", MessageType.None, true);
EditorGUILayout.Space();
}
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.LabelField("Current Climate", EditorStyles.boldLabel);
EditorGUILayout.HelpBox("This is the current climate that is generated.", MessageType.None, true);
self.startingSpringTemp = EditorGUILayout.IntField ("Starting Spring Temp", self.startingSpringTemp);
self.minSpringTemp = EditorGUILayout.IntField ("Min Spring", self.minSpringTemp);
self.maxSpringTemp = EditorGUILayout.IntField ("Max Spring", self.maxSpringTemp);
EditorGUILayout.Space();
self.startingSummerTemp = EditorGUILayout.IntField ("Starting Summer Temp", self.startingSummerTemp);
self.minSummerTemp = EditorGUILayout.IntField ("Min Summer", self.minSummerTemp);
self.maxSummerTemp = EditorGUILayout.IntField ("Max Summer", self.maxSummerTemp);
EditorGUILayout.Space();
self.startingFallTemp = EditorGUILayout.IntField ("Starting Fall Temp", self.startingFallTemp);
self.minFallTemp = EditorGUILayout.IntField ("Min Fall", self.minFallTemp);
self.maxFallTemp = EditorGUILayout.IntField ("Max Fall", self.maxFallTemp);
EditorGUILayout.Space();
self.startingWinterTemp = EditorGUILayout.IntField ("Starting Winter Temp", self.startingWinterTemp);
self.minWinterTemp = EditorGUILayout.IntField ("Min Winter", self.minWinterTemp);
self.maxWinterTemp = EditorGUILayout.IntField ("Max Winter", self.maxWinterTemp);
EditorGUILayout.Space();
//.........这里部分代码省略.........
示例13: Skillshot
public Skillshot(DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
DetectionType = detectionType;
SpellData = spellData;
StartTick = startT;
Start = start;
End = end;
MissilePosition = start;
Direction = (end - start).Normalized();
Unit = unit;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
Circle = new Geometry.Polygon.Circle(CollisionEnd, spellData.Radius, 22);
break;
case SkillShotType.SkillshotLine:
case SkillShotType.SkillshotMissileLine:
Rectangle = new Geometry.Polygon.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new Geometry.Polygon.Sector(
start, CollisionEnd - start, spellData.Radius * (float) Math.PI / 180, spellData.Range, 22);
break;
case SkillShotType.SkillshotRing:
Ring = new Geometry.Polygon.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
break;
}
UpdatePolygon();
}
示例14: TriggerOnDetectSkillshot
private static void TriggerOnDetectSkillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
OnDetectSkillshot?.Invoke(new Skillshot(detectionType, spellData, startT, start, end, unit));
}
示例15: Skillshot
public Skillshot(DetectionType detectionType,
SkillshotData skillshotData,
int startT,
Vector2 startPosition,
Vector2 endPosition,
Obj_AI_Base caster)
{
DetectionType = detectionType;
SkillshotData = skillshotData;
StartTick = startT;
StartPosition = startPosition;
EndPosition = endPosition;
MissilePosition = startPosition;
Direction = (endPosition - startPosition).Normalized();
Caster = caster;
//Create the spatial object for each type of skillshot.
switch (skillshotData.Type)
{
case SkillShotType.SkillshotCircle:
Circle = new SkillshotGeometry.Circle(CollisionEnd, skillshotData.Radius);
break;
case SkillShotType.SkillshotLine:
Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
break;
case SkillShotType.SkillshotMissileLine:
Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new SkillshotGeometry.Sector(
startPosition, CollisionEnd - startPosition, skillshotData.Radius*(float) Math.PI/180,
skillshotData.Range);
break;
case SkillShotType.SkillshotRing:
Ring = new SkillshotGeometry.Ring(CollisionEnd, skillshotData.Radius, skillshotData.RingRadius);
break;
}
UpdatePolygon(); // Create the polygon
}