public void Ctor_HasFlows_CorrectFlows() { var flows = new[] { Mock.Of <IAnalysisIssueFlow>(), Mock.Of <IAnalysisIssueFlow>() }; var hotspot = new Hotspot("hotspot key", "local-path.cpp", "server-path", "message", 1, 2, 3, 4, "hash", ValidRule, DateTimeOffset.MinValue, DateTimeOffset.MinValue, flows); hotspot.Flows.Should().BeEquivalentTo(flows); }
/// <summary> /// Position/draw hotspot correctly on canvas /// </summary> private void PositionHotspots() { var controlWidth = _image.ActualWidth; var controlHeight = _image.ActualHeight; if (controlWidth <= 0.0 || controlHeight <= 0.0) { return; } foreach (FrameworkElement element in _canvas.Children) { Hotspot hotspot = element.DataContext as Hotspot; double X = controlWidth * (hotspot.CenterX / 100) - (ItemDimension * 0.5); double Y = controlHeight * (hotspot.CenterY / 100) - (ItemDimension * 0.5); Point imagePos = new Point(X, Y); var posTransform = _image.TransformToVisual(_canvas); Point canvasPos = posTransform.TransformPoint(imagePos); Canvas.SetLeft(element, canvasPos.X); Canvas.SetTop(element, canvasPos.Y); } }
void Awake() { // Vector2 vvvv = StoV2(500); // short fffff = V2toS(vvvv); Instance = this; goHotspot = new GameObject("HotSpotMap"); goHotspot.transform.localScale = new Vector3(-1f, 1f, 1f); goHotspot.layer = 13; mrHotspot = goHotspot.AddComponent <MeshRenderer>(); mrHotspot.enabled = false; mfHotspot = goHotspot.AddComponent <MeshFilter>(); matHotspot = new Material[3]; matHotspot[0] = new Material(Resources.Load <Material>("Materials/hotspot")); matHotspot[0].SetColor("_Color", new Color(238f / 255f, 201f / 255f, 201f / 255f)); matHotspot[1] = new Material(Resources.Load <Material>("Materials/hotspot")); matHotspot[1].SetColor("_Color", new Color(31f / 255f, 82f / 255f, 176f / 255f)); matHotspot[2] = new Material(Resources.Load <Material>("Materials/hotspot")); matHotspot[2].SetColor("_Color", new Color(158f / 255f, 195f / 255f, 255f / 255f)); mrHotspot.materials = matHotspot; matHotspotPick = new Material[3]; matHotspotPick[0] = new Material(Resources.Load <Material>("Materials/hotspot_pick")); matHotspotPick[1] = matHotspotPick[0]; matHotspotPick[2] = matHotspotPick[0]; meshHotspot = new Mesh(); meshHotspot.bounds = new Bounds(Vector3.zero, new Vector3(100f, 100f, 100f)); mfHotspot.mesh = meshHotspot; meshHotspot.subMeshCount = 3; meshHotspot.name = "HotspotMesh"; CreateRes(); //indices = MissileSystem.CreateTriangleStripIndex(vxEcef); }
private Hotspot ConvertToHotspot(SonarQubeHotspot sonarQubeHotspot) { var localFilePath = absoluteFilePathLocator.Locate(sonarQubeHotspot.FilePath); var priority = GetPriority(sonarQubeHotspot.Rule.VulnerabilityProbability); var sqRule = sonarQubeHotspot.Rule; var rule = new HotspotRule( sqRule.RuleKey, sqRule.RuleName, sqRule.SecurityCategory, priority, sqRule.RiskDescription, sqRule.VulnerabilityDescription, sqRule.FixRecommendations ); var hotspot = new Hotspot( hotspotKey: sonarQubeHotspot.HotspotKey, filePath: localFilePath, serverFilePath: sonarQubeHotspot.FilePath, message: sonarQubeHotspot.Message, startLine: sonarQubeHotspot.TextRange.StartLine, endLine: sonarQubeHotspot.TextRange.EndLine, startLineOffset: sonarQubeHotspot.TextRange.StartOffset, endLineOffset: sonarQubeHotspot.TextRange.EndOffset, lineHash: sonarQubeHotspot.LineHash, rule: rule, createTimestamp: sonarQubeHotspot.CreationTimestamp, lastUpdateTimestamp: sonarQubeHotspot.LastUpdateTimestamp, flows: null); return(hotspot); }
public FacultyInterface(string id) { this.id = id; InitializeComponent(); FacultyDataHandler facultyData = new FacultyDataHandler(id); hotspot = new Hotspot(); this.Text = "Welcome, " + facultyData.GetName(); this.labelPhoneAns.Text = facultyData.GetPhone(); this.labelNameAns.Text = facultyData.GetName(); this.labelMotherAns.Text = facultyData.GetMother(); this.labelIDAns.Text = facultyData.GetID(); this.labelGenderAns.Text = facultyData.GetGender().ToString(); this.labelFatherAns.Text = facultyData.GetFather(); this.labelEmailAns.Text = facultyData.GetEmail(); this.labelDOBAns.Text = facultyData.GetDOB(); this.labelDepartmentAns.Text = facultyData.GetDepartment().ToString(); this.labelBloodGroupAns.Text = facultyData.GetBloodGroup().ToString(); foreach (var course in facultyData.GetCourseList()) { this.comboboxCourses.Items.Add(course); } }
public void SetEndtime() { Hotspot a = (Hotspot)all_hotspots[id_display.GetComponent <Text>().text]; a.SetEndTime(videoPlayer.time); //Debug.Log(a.getEnd()); }
// Finds the minimum distance to the nearest hotspot and the hotspot itself private void Call() { distances = new Dictionary <Hotspot, float>(); foreach (Hotspot hotspot in hotspots) { if (hotspot.visited == false) { distances.Add(hotspot, CalculateDistance(hotspot)); } } if (distances.Count == 0) { return; } //Finds the minimum value from the distances dictionary along with respective hotspot object KeyValuePair <Hotspot, float> firstHotspot = distances.First(); minimumDistance = firstHotspot.Value; closestHotspot = firstHotspot.Key; foreach (KeyValuePair <Hotspot, float> distance in distances) { if (minimumDistance > distance.Value) { minimumDistance = distance.Value; closestHotspot = distance.Key; } } }
LargeObject buildDesk() { LargeObject d = new LargeObject(); d.hotspots = new List <Hotspot>(); //Nothing on top yet d.prefab = desk; d.padding = Absolute(d.prefab.rotation * new Vector3(0.15f, 0.0f, 0.0f)); Hotspot main = new Hotspot(); // Positioned determined by hand main.position = new Vector3(0.11f, -0.1872f, -0.1f); main.direction = new Vector3(0, 0, 0); main.angle = Quaternion.Euler(0, 180, 0); d.hotspots.Add(main); Hotspot accessory = new Hotspot(); // Positioned determined by hand accessory.position = new Vector3(0.06f, -0.1872f, 0.45f); accessory.direction = new Vector3(0, 0, 0); accessory.angle = Quaternion.Euler(0, 0, 0); d.hotspots.Add(accessory); Hotspot small = new Hotspot(); // Positioned determined by hand small.position = new Vector3(0.06f, -0.1872f, -0.52f); small.direction = new Vector3(0, 0, 0); small.angle = Quaternion.Euler(0, 00, 0); d.hotspots.Add(small); return(d); }
public void ExposeHotspot(Vector3Int localPosition, float temperature, float volume) { if (hotspots.ContainsKey(localPosition) && hotspots[localPosition].Hotspot != null) { // TODO soh? hotspots[localPosition].Hotspot.UpdateValues(volume * 25, temperature); } else { MetaDataNode node = metaDataLayer.Get(localPosition); GasMix gasMix = node.GasMix; if (gasMix.GetMoles(Gas.Plasma) > 0.5 && gasMix.GetMoles(Gas.Oxygen) > 0.5 && temperature > Reactions.PLASMA_MINIMUM_BURN_TEMPERATURE) { // igniting Hotspot hotspot = new Hotspot(node, temperature, volume * 25); node.Hotspot = hotspot; hotspots[localPosition] = node; } } if (hotspots.ContainsKey(localPosition) && hotspots[localPosition].Hotspot != null) { //expose everything on this tile Expose(localPosition, localPosition); //expose impassable things on the adjacent tile Expose(localPosition, localPosition + Vector3Int.right); Expose(localPosition, localPosition + Vector3Int.left); Expose(localPosition, localPosition + Vector3Int.up); Expose(localPosition, localPosition + Vector3Int.down); } }
/// <summary> /// Get the strongest hotspot in range of this player. /// </summary> /// <returns>Returns a hotspot.</returns> private Hotspot ReturnBestAvailableHotspot() { // No hotspots in range. if (_hotspotsInRange.Count == 0) { return(null); } // Get strongest hot spot in range. Hotspot strongestHotspot = null; for (int i = 0; i < _hotspotsInRange.Count; i++) { // Skip drained hotspots. if (_hotspotsInRange[i].Drained) { continue; } if (strongestHotspot == null) { strongestHotspot = _hotspotsInRange[i]; } else { if (_hotspotsInRange[i].ReturnSignalStrength(this) > strongestHotspot.ReturnSignalStrength(this)) { strongestHotspot = _hotspotsInRange[i]; } } } return(strongestHotspot); }
public void ExposeHotspot(Vector3Int position, float temperature, float volume) { if (hotspots.ContainsKey(position) && hotspots[position].Hotspot != null) { // TODO soh? hotspots[position].Hotspot.UpdateValues(volume * 25, temperature); } else { MetaDataNode node = metaDataLayer.Get(position); GasMix gasMix = node.GasMix; if (gasMix.GetMoles(Gas.Plasma) > 0.5 && gasMix.GetMoles(Gas.Oxygen) > 0.5 && temperature > Reactions.PLASMA_MINIMUM_BURN_TEMPERATURE) { // igniting Hotspot hotspot = new Hotspot(node, temperature, volume * 25); node.Hotspot = hotspot; hotspots[position] = node; } } if (hotspots.ContainsKey(position) && hotspots[position].Hotspot != null) { List <LivingHealthBehaviour> healths = matrix.Get <LivingHealthBehaviour>(position); foreach (LivingHealthBehaviour health in healths) { health.ApplyDamage(null, 1, DamageType.Burn); } } }
override public void ShowGUI() { hotspot = (Hotspot)EditorGUILayout.ObjectField("Hotspot to rename:", hotspot, typeof(Hotspot), true); newName = EditorGUILayout.TextField("New label:", newName); AfterRunningOption(); }
// Calculates the distance to the nearest hotspot private float CalculateDistance(Hotspot hotspot) { Vector3 hotspot_pos = map.MapPositionAt((float)hotspot.longitude, (float)hotspot.latitude); Vector3 player_pos = player.transform.position; return(Vector3.Distance(hotspot_pos, player_pos)); }
private void MakeScrollButton(Hottype type, CalendarDay day, Point location) { // this Hotspot is only used to restore the location of the button // not as a hover region var spot = new Hotspot { Type = type, Bounds = new Rectangle(location.X, location.Y, 0, 0), Day = day }; var button = new MoreButton(); button.Font = moreFont; button.ForeColor = AppColors.ControlColor; button.Location = location; button.Text = type == Hottype.Up ? LessGlyph : MoreGlyph; button.Size = new Size(moreSize.Width + 4, moreSize.Height + 2); button.Tag = spot; button.MouseDown += ClickScrollButton; Controls.Add(button); if (type == Hottype.Up) { day.UpButton = button; } else { day.DownButton = button; } }
void _exportListButton_Click(object sender, EventArgs e) { var editor = (Editors.SceneEditor)MainScreen.Instance.ActiveEditor; if (editor.Hotspots.Count == 0) { return; } Windows.SelectFilePopup popup = new Windows.SelectFilePopup(); popup.Center(); popup.Closed += (s, e2) => { if (popup.DialogResult) { List <Hotspot> clonedSpots = new List <Hotspot>(editor.Hotspots.Count); foreach (var spot in editor.Hotspots) { Hotspot newSpot = new Hotspot(); newSpot.Title = spot.Title; spot.DebugAppearance.CopyAppearanceTo(newSpot.DebugAppearance); newSpot.Settings = new Dictionary <string, string>(spot.Settings); clonedSpots.Add(newSpot); } popup.SelectedLoader.Save(clonedSpots, popup.SelectedFile); } }; popup.FileLoaderTypes = new FileLoaders.IFileLoader[] { new FileLoaders.Hotspots() }; popup.SkipFileExistCheck = true; popup.SelectButtonText = "Save"; popup.Show(true); }
public void Ctor_NoFlows_EmptyFlows() { IReadOnlyList <IAnalysisIssueFlow> flows = null; var hotspot = new Hotspot("hotspot key", "local-path.cpp", "server-path", "message", 1, 2, 3, 4, "hash", ValidRule, DateTimeOffset.MinValue, DateTimeOffset.MinValue, flows); hotspot.Flows.Should().BeEmpty(); }
public bool LoadHotspot(Hotspot spot) { Hotspots.Add(spot); HotspotPanel.RebuildListBox(); return(true); }
public void recordBranch(string id, string branch_name) { Hotspot current_hotspot = (Hotspot)all_hotspots[id]; current_hotspot.SetBranch(); current_hotspot.SetName(branch_name); all_hotspots[id] = current_hotspot; }
public void openWindow(string id) { Hotspot current_hotspot = (Hotspot)table[id]; inputPanelControl.loadHotspot(id, current_hotspot.getName(), current_hotspot.getText(), current_hotspot.getUrl_photo()); goToHotspot(current_hotspot); videoPlayer.Pause(); }
public void update_hotspot(string id, string name, string text, string url_photo) { Hotspot current_hotspot = (Hotspot)all_hotspots[id]; Debug.Log(id); current_hotspot.SetMoreInfo(name, text, url_photo); all_hotspots[id] = current_hotspot; }
private bool ShouldHandle(Hotspot hotspot) { if (hotspot == null) return false; var macroCallExpression = hotspot.Expression as MacroCallExpression; return macroCallExpression != null && GetType().IsInstanceOfType(macroCallExpression.Macro); }
public JsonResult Delete(int id) { Hotspot hotspot = db.Hotspot.Find(id); db.Hotspot.Remove(hotspot); db.SaveChanges(); return(Json(new { success = true }, JsonRequestBehavior.AllowGet)); }
private bool ShouldHandle(Hotspot hotspot) { if (hotspot == null) return false; var macroCallExpressionNew = hotspot.Expression as MacroCallExpressionNew; if (macroCallExpressionNew == null) return false; return ThisImplementationsMacroDefinition().IsInstanceOfType(macroCallExpressionNew.Definition); }
public void goToHotspot(Hotspot hs) { double hs_start_time = hs.getStart(); videoPlayer.Prepare(); long location_frame = Convert.ToInt64(hs_start_time / (videoPlayer.frameCount / videoPlayer.frameRate) * videoPlayer.frameCount) + 5; videoPlayer.frame = location_frame; Camera.main.transform.LookAt(hs.getHotspot().transform); }
public override void OnInspectorGUI() { Hotspot hs = (Hotspot)target; if (GUILayout.Button("OnCollide")) { hs.OnCollide(); } DrawDefaultInspector(); }
public static void SendCurrentToolToStart() { if (Current == null) { return; } Current.Transform.Position = StartPosition; Current = null; }
public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } Hotspot comparisonObj = (Hotspot)obj; return((comparisonObj.Latitude == this.Latitude) && (comparisonObj.Longitude == this.Longitude)); }
// Use this for initialization void Start() { hotSpotDatabase = GameObject.FindGameObjectWithTag("GameController").GetComponent <HotspotDatabase> (); itemDatabase = GameObject.FindGameObjectWithTag("GameController").GetComponent <ItemDatabase> (); inv = GameObject.FindGameObjectWithTag("GameController").GetComponent <InventoryDatabase> (); controll = GameObject.FindGameObjectWithTag("GameController").GetComponent <Gamecontroller>(); hotspot = hotSpotDatabase.FetchHotspotBySlug(this.gameObject.name); hotspotName = hotspot.Title; inventorySlot = Resources.Load <GameObject> ("Prefab/Slot"); inventoryItem = Resources.Load <GameObject> ("Prefab/Item"); }
private void BrdHotspot_Loaded(object sender, RoutedEventArgs e) { // 计算比例,设置热点的位置。 Border brdHotspot = (Border)sender; Hotspot hotspot = (Hotspot)brdHotspot.DataContext; double locationX = hotspot.LocationX / 100.0d * iscHotspot.ActualWidth; double locationY = hotspot.LocationY / 100.0d * iscHotspot.ActualHeight; Canvas.SetLeft(brdHotspot, locationX); Canvas.SetTop(brdHotspot, locationY); }
public void delete_hotspot() { string id = id_display.GetComponent <Text>().text; Hotspot h = (Hotspot)all_hotspots[id]; GameObject a = h.getHotspot(); all_hotspots.Remove(id); Destroy(a); window.SetActive(false); videoPlayer.Play(); }
// Update is called once per frame void Update() { //Vector3 fw; //Vector3 up; //avatar.GetPointingDirection(OvrAvatar.HandType.Right, ref fw, ref up); //avatar.ControllerRight.transform //var t = avatar.GetHandTransform(OvrAvatar.HandType.Right, OvrAvatar.HandJoint.IndexTip); line.enabled = true; var t = avatar.ControllerRight.transform; transform.position = t.position; transform.rotation = t.rotation; var pos1 = t.position; var pos2 = t.position + (t.forward * pointerLen); RaycastHit hit; if (Physics.Raycast(t.position, t.forward, out hit, Mathf.Infinity, RaycastMask.mask)) { //Debug.LogFormat("Raycasted {0}", hit.collider.gameObject.name); pos2 = hit.point; line.startColor = Color.grey; line.endColor = Color.grey; var hotspot = hit.collider.gameObject.GetComponent <Hotspot>(); if (selectedHotspot != null && selectedHotspot != hotspot) { selectedHotspot.RaycastHit(false); selectedHotspot = null; } if (hotspot != null) { selectedHotspot = hotspot; selectedHotspot.RaycastHit(true); if (selectedHotspot.HotspotEnabled) { line.startColor = Color.red; line.endColor = Color.red; } } } else { if (selectedHotspot != null) { selectedHotspot.RaycastHit(false); selectedHotspot = null; } line.startColor = Color.white; line.endColor = Color.white; } line.SetPositions(new Vector3[] { pos1, pos2 }); }
public void DeleteHotspot(Hotspot hotspot) { if (hotspot == null) { throw new ArgumentNullException("hotspot"); } else { _hotspotRepository.Delete(hotspot); _eventPublisher.EntityDeleted(hotspot); } }
/// <summary> /// Восстановить сохранненые значения. /// </summary> public void RestoreSettings(Hotspot hotspot) { hotspot.ToolTip = ToolTip; hotspot.URL = URL; }
private IHotspotSession CreateFakeHotspotSession() { var hotspotSession = Substitute.For<IHotspotSession>(); var templateField = new TemplateField("", new MacroCallExpression(_quickParamterlessMacro), 0); var hotspot = new Hotspot(new HotspotInfo(templateField), hotspotSession); var rangeMarger = Substitute.For<IRangeMarker>(); hotspot.RangeMarkers.Add(rangeMarger); var hotspots = new List<Hotspot> { new Hotspot(new HotspotInfo(new TemplateField("", 0)), hotspotSession), hotspot }; hotspotSession.Hotspots.Returns(hotspots); return hotspotSession; }
void Start() { this.renderer = GetComponent<SpriteRenderer> (); this.collider2d = GetComponent<BoxCollider2D> (); this.hotspot = GetComponent<Hotspot> (); }
public HotspotSettingsWrapper(Hotspot hotspot) { ToolTip = hotspot.ToolTip; URL = hotspot.URL; }
void buildHotspot() { this.addEventListner(MouseEvent.MOUSE_DOWN, new EventDispatcher.CallBack(hotspotSceneClicked)); XmlNodeList nodes = _node.SelectNodes("spot"); _spots = new Sprite[nodes.Count]; _spotImages = new PopupImageClip[nodes.Count]; for (int i=0; i<nodes.Count; i++){ Hotspot spot = new Hotspot(); spot.x = float.Parse(nodes[i].Attributes["x"].Value)-22; spot.y = float.Parse(nodes[i].Attributes["y"].Value)-22; spot.id = "spot-"+i; spot.tag= i; spot.addEventListner(MouseEvent.MOUSE_DOWN, new EventDispatcher.CallBack(hotspotClicked)); addChild(spot); spot.startAnimation(); _spots[i] = spot; Texture2D texture = _menuElement.GetTextureById(nodes[i].Attributes["src"].Value); PopupImageClip image = new PopupImageClip(texture); image.alpha = 0; image.scaleX = image.scaleY = 0f; image.x = spot.x; image.y = spot.y; image.id = "spot-image-"+i; image.tag= i; image.addEventListner(MouseEvent.MOUSE_DOWN, new EventDispatcher.CallBack(hotspotImageClicked)); addChild(image); _spotImages[i] = image; } }
public static float GetDistanceToProfile( string file) { float distance = float.MaxValue; string[] lines; try { lines = System.IO.File.ReadAllLines(file); } catch( Exception e) { Logger.Alert(e.ToString()); return float.MaxValue; } Hotspot me = new Hotspot( StyxWoW.Me.Location ); foreach( string line in lines ) { Hotspot hs; if( GetHotSpot( line, out hs) ) { float hsDist = SqrDist2x(hs, me); if (hsDist < distance) { //Logger.WriteDebug(string.Format("LineDist: {0:f} " + line + " " + hs.ToString(), hsDist)); distance = hsDist; } } } return distance; }
static bool GetHotSpot(string line, out Hotspot hotspot) { hotspot = new Hotspot() { X = 0, Y = 0, Z = 0 }; if (!line.Contains("<Hotspot ")) { return false; } string[] sep = new string[] { "X=\"", "Y=\"", "Z=\"", "\"" }; string[] xBeg = line.Split(sep, StringSplitOptions.RemoveEmptyEntries); if (xBeg.Length < 6) { return false; } bool xOk = float.TryParse(xBeg[1], out hotspot.X); if (!xOk) { return false; } bool yOk = float.TryParse(xBeg[3], out hotspot.Y); if (!yOk) { return false; } bool zOk = float.TryParse(xBeg[5], out hotspot.Z); if (!zOk) { return false; } return true; }
static float SqrDist2x(Hotspot a, Hotspot b) { return (a.X - b.X) * (a.X - b.X) + (a.Y - b.Y) * (a.Y - b.Y); }
protected override void ValueSelectedCallback(Hotspot oldHotspot) { throw new System.NotImplementedException(); }
private string HotspotValue(Hotspot hotspot) { return string.IsNullOrEmpty(hotspot.CurrentValue) ? hotspot.Name : hotspot.CurrentValue; }