public static IIdleStrategy Create(string strategyName, StatusIndicator controllableStatus) { switch (strategyName) { case "ControllableIdleStrategy": var idleStrategy = new ControllableIdleStrategy(controllableStatus); controllableStatus.SetOrdered(ControllableIdleStrategy.PARK); return(idleStrategy); case "YieldingIdleStrategy": return(new YieldingIdleStrategy()); case "SleepingIdleStrategy": return(new SleepingIdleStrategy(1)); case "BusySpinIdleStrategy": return(new BusySpinIdleStrategy()); case "NoOpIdleStrategy": return(new NoOpIdleStrategy()); default: return(new BackoffIdleStrategy( Configuration.IDLE_MAX_SPINS, Configuration.IDLE_MAX_YIELDS, Configuration.IDLE_MIN_PARK_MS, Configuration.IDLE_MAX_PARK_MS)); } }
private void Awake() { statusIndicator = gameObject.GetComponent <StatusIndicator>(); statusIndicator.image.CrossFadeAlpha(0f, 0f, false); statusIndicator.image.CrossFadeColor(statusIndicator.activeColor, statusIndicator.fadeTime * 1.2f, false, false); lightsOn = true; }
private void Start() { stats = PlayerStats.Instance; stats.CurrentHealth = stats.m_MaxHealth; if (statusIndicator == null) { StatusIndicator ind = GameObject.Find("PlayerHP").GetComponentInChildren <StatusIndicator>(); if (ind != null) { statusIndicator = ind; } } statusIndicator.SetHealth(stats.CurrentHealth, stats.m_MaxHealth); if (m_Anim == null) { m_Anim = GetComponent <Animator>(); } m_AudioManager = AudioManager.instance; if (m_AudioManager == null) { Debug.LogError("No audioManager found in " + this.name); } }
void Awake() { if (instance == null) { instance = this; } }
void Start() { playerStats = PlayerStats.instance; playerStats.curHealth = playerStats.maxHealth; audioManager = AudioManager.instance; if (audioManager == null) { Debug.Log("ENEMY: No audioManager found."); } if (statusIndicator == null) { Debug.LogError("No status indicator on player"); statusIndicator = GameObject.FindGameObjectWithTag("StatusIndicator").GetComponent <StatusIndicator>(); statusIndicator.SetHealth(playerStats.curHealth, playerStats.maxHealth); } else { statusIndicator.SetHealth(playerStats.curHealth, playerStats.maxHealth); } InvokeRepeating("RegenHealth", 1f / playerStats.healthRegenRate, 1f / playerStats.healthRegenRate); }
private void OnEnable() { stats = PlayerStats.instance; statusIndicator = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <StatusIndicator>(); pistol = GameObject.Find("Arm").transform.GetChild(0).GetComponent <Weapon>(); rifle = GameObject.Find("Arm").transform.GetChild(1).GetComponent <Weapon>(); UpdateValues(); }
/// <summary> /// Create a supplier of <seealso cref="IdleStrategy"/>s that will use the system property. /// </summary> /// <param name="controllableStatus"> if a <seealso cref="org.agrona.concurrent.ControllableIdleStrategy"/> is required. </param> /// <returns> the new idle strategy </returns> public static Func <IIdleStrategy> IdleStrategySupplier(StatusIndicator controllableStatus) { return(() => { var name = Config.GetProperty(CLUSTER_IDLE_STRATEGY_PROP_NAME, DEFAULT_IDLE_STRATEGY); return IdleStrategyFactory.Create(name, controllableStatus); }); }
private void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Contaminated") { statusIndicator = gameObject.GetComponent <StatusIndicator>(); statusIndicator.image.CrossFadeColor(statusIndicator.activeColor, statusIndicator.fadeTime * 1.2f, false, false); modConStatusIndicator.image.CrossFadeColor(statusIndicator.activeColor, statusIndicator.fadeTime * 1.2f, false, false); } }
public void updateStatusIndicator() { StatusIndicator statusIndicator = getStatusIndicator(); if (statusIndicator != null) { statusIndicator.setHealth(currentHealth, maxHealth); } }
private void Awake() { boxCollider = gameObject.GetComponent <BoxCollider>(); boxCollider.enabled = true; statusIndicator = gameObject.GetComponent <StatusIndicator>(); statusIndicator.image.CrossFadeAlpha(0f, 0f, false); lightsOn = true; }
private void OnReset() { if (statusIndicator == null) { StatusIndicator ind = GameObject.Find("UIOverlay").GetComponentInChildren <StatusIndicator>(); if (ind != null) { statusIndicator = ind; } } }
private async void btnShowStat_Click(object sender, RoutedEventArgs e) { sIndicator = new StatusIndicator(Statistics.Status); sIndicator.Show(); IEnumerable <Statistics.StatRow> data = await Statistics.GetStatistics(dtaFrom.SelectedDate.Value, dtaTo.SelectedDate.Value, personSelector.SelectedElements, siteSelector.SelectedElements); ctrlStat.DataContext = data; SetStatVisible(); sIndicator.Close(); }
public static IIdleStrategy Create(string strategyName, StatusIndicator controllableStatus) { switch (strategyName) { default: return(new BackoffIdleStrategy( Configuration.IDLE_MAX_SPINS, Configuration.IDLE_MAX_YIELDS, Configuration.IDLE_MIN_PARK_MS, Configuration.IDLE_MAX_PARK_MS)); } }
public MainWindow() { InitializeComponent(); sIndicator = new StatusIndicator(Repos.Status); sIndicator.Show(); Repos.LoadRepos(); while (!Repos.IsLoaded) { Thread.Sleep(200); } sIndicator.Close(); }
public static HtmlString ToSpan(this ReplicaRoles?state, string tooltip = null, bool abbreviate = false) { var desc = state.HasValue ? state.Value.AsString(EnumFormat.Description) : ""; if (abbreviate) { desc = desc.Substring(0, 1); } return(state switch { ReplicaRoles.Primary => StatusIndicator.UpCustomSpan(desc, tooltip), ReplicaRoles.Secondary => desc.AsHtml(), //case ReplicaRoles.Resolving: _ => StatusIndicator.DownCustomSpan(desc, tooltip), });
private void Update() { if (players_in_range > 0) { CheckInteraction(); } else { if (indicator) { indicator.Finish(); indicator = null; } } }
protected virtual void Start() { //data = new EntityData(); pathNodes = new List <Node>(); nodeParent = GetComponentInParent <Node>(); movementSpeed = 200; try { statusIndicator = transform.GetChild(0).GetComponent <StatusIndicator>(); } catch (UnityException) { Debug.LogError(this.name + " doesnt have a status indicator!"); } }
void Start() { stats.Init(); statusIndicator = Instantiate(statusIndicatorPrefab, new Vector3(360, 154, 0), new Quaternion(0, 0, 0, 0)); if (statusIndicator == null) { Debug.Log("rip"); } else { statusIndicator.SetHealth(stats.currHealth, stats.maxHealth); } }
private async Task TestConnection() { await new SynchronizationContextRemover(); StatusIndicator.Busy(); DispatchOnUiThread(() => { Notifications.ClearNotificationsOfType(NotificationType.Error); Notifications.ClearNotificationsOfType(NotificationType.Success); Notifications.ClearNotificationsOfType(NotificationType.Info); }); await TestConnection(BuildConnectionData()); StatusIndicator.ClearStatus(); DispatchOnUiThread(() => { Notifications.ClearNotificationsOfType(NotificationType.Progress); }); }
public static IHtmlString ToSpan(this SynchronizationStates?state, string tooltip = null) { switch (state) { case SynchronizationStates.Synchronizing: case SynchronizationStates.Synchronized: return(StatusIndicator.UpCustomSpam(state.GetDescription(), tooltip)); case SynchronizationStates.NotSynchronizing: case SynchronizationStates.Reverting: case SynchronizationStates.Initializing: return(StatusIndicator.DownCustomSpam(state.GetDescription(), tooltip)); default: return(StatusIndicator.UnknownCustomSpam(state.GetDescription(), tooltip)); } }
public static IHtmlString Span(this MonitorStatus status, string text, string tooltip = null) { switch (status) { case MonitorStatus.Good: return(StatusIndicator.UpCustomSpam(text, tooltip)); case MonitorStatus.Warning: return(StatusIndicator.WarningCustomSpam(text, tooltip)); case MonitorStatus.Critical: return(StatusIndicator.DownCustomSpam(text, tooltip)); default: return(StatusIndicator.UnknownCustomSpam(text, tooltip)); } }
/// <summary> /// Returns an icon span representation of this MonitorStatus /// </summary> public static IHtmlString IconSpan(this MonitorStatus status) { switch (status) { case MonitorStatus.Good: return(StatusIndicator.IconSpan(StatusIndicator.UpClass)); case MonitorStatus.Warning: case MonitorStatus.Maintenance: return(StatusIndicator.IconSpan(StatusIndicator.WarningClass)); case MonitorStatus.Critical: return(StatusIndicator.IconSpan(StatusIndicator.DownClass)); default: return(StatusIndicator.IconSpan(StatusIndicator.UnknownClass)); } }
public void TestMethod1() { int max = 15; string msg = "test message"; var f = new StatusIndicator(new Status(max)); var t = Task.Factory.StartNew(() => { for (int i = 0; i < max; i++) { f.SIndicator.Current++; f.SIndicator.CurName = msg + i; Thread.Sleep(300); } }); f.ShowDialog(); //f.Close(); }
private void UpdateValues(SpektrometrStatus status) { int mainStatus = status.MainStatus; for (int i = 0; i < 6; i++) { StatusIndicator.SetItemCheckState(i, (mainStatus & (1 << i)) != 0 ? CheckState.Checked : CheckState.Unchecked); } int ioStatus = status.IoStatus; for (int i = 0; i < 8; i++) { IOStatus.SetItemCheckState(i, (ioStatus & (1 << i)) != 0 ? CheckState.Checked : CheckState.Unchecked); } AktualneImpulsy1.Value = status.AktualneImpulsy1; AktualneImpulsy2.Value = status.AktualneImpulsy2; lastIoStatus = status.IoStatus; }
public static IHtmlString ToSpan(this ReplicaRoles?state, string tooltip = null, bool abbreviate = false) { var desc = state.GetDescription(); if (abbreviate) { desc = desc.Substring(0, 1); } switch (state) { case ReplicaRoles.Primary: return(StatusIndicator.UpCustomSpam(desc, tooltip)); case ReplicaRoles.Secondary: return(desc.AsHtml()); //case ReplicaRoles.Resolving: default: return(StatusIndicator.DownCustomSpam(desc, tooltip)); } }
/// <summary> /// Gets the status bar color. /// </summary> /// <returns>Returns console color for status bar. </returns> private ConsoleColor SetStatusBarConsoleColor() { StatusIndicator status = GetStatusIndicator(); ConsoleColor barColor = ConsoleColor.Gray; switch (status) { case StatusIndicator.Good: barColor = StatusGoodColor; break; case StatusIndicator.Low: barColor = StatusLowColor; break; case StatusIndicator.Critical: barColor = StatusCriticalColor; break; } return(barColor); }
public void setStatusIndicator(StatusIndicator statusIndicator) { this.statusIndicator = statusIndicator; }
private void Awake() { musicController = GetComponentInParent <MusicController>(); statusIndicator = GetComponent <StatusIndicator>(); }
public void setStatusIndicator(StatusIndicator statusIndicator) { this.statusIndicator = statusIndicator; }
void ReleaseDesignerOutlets() { if (BufferSizeInput != null) { BufferSizeInput.Dispose(); BufferSizeInput = null; } if (BufferSizeSlider != null) { BufferSizeSlider.Dispose(); BufferSizeSlider = null; } if (ChatMessageInput != null) { ChatMessageInput.Dispose(); ChatMessageInput = null; } if (ChatMessageList != null) { ChatMessageList.Dispose(); ChatMessageList = null; } if (ClientList != null) { ClientList.Dispose(); ClientList = null; } if (ClientTable != null) { ClientTable.Dispose(); ClientTable = null; } if (ClientColumn != null) { ClientColumn.Dispose(); ClientColumn = null; } if (NameInput != null) { NameInput.Dispose(); NameInput = null; } if (PortInput != null) { PortInput.Dispose(); PortInput = null; } if (SendButton != null) { SendButton.Dispose(); SendButton = null; } if (StartButton != null) { StartButton.Dispose(); StartButton = null; } if (StatusIndicator != null) { StatusIndicator.Dispose(); StatusIndicator = null; } if (StatusIndicatorText != null) { StatusIndicatorText.Dispose(); StatusIndicatorText = null; } }
private void Awake() { sequencer = GameObject.FindGameObjectWithTag("SequencerCanvas").GetComponentInParent <Sequencer>(); statusIndicator = GetComponent <StatusIndicator>(); }