Inheritance: MonoBehaviour
        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;
 }
Exemplo n.º 3
0
    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);
        }
    }
Exemplo n.º 4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
 /// <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);
     });
 }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
    public void updateStatusIndicator()
    {
        StatusIndicator statusIndicator = getStatusIndicator();

        if (statusIndicator != null)
        {
            statusIndicator.setHealth(currentHealth, maxHealth);
        }
    }
Exemplo n.º 10
0
    private void Awake()
    {
        boxCollider         = gameObject.GetComponent <BoxCollider>();
        boxCollider.enabled = true;

        statusIndicator = gameObject.GetComponent <StatusIndicator>();
        statusIndicator.image.CrossFadeAlpha(0f, 0f, false);

        lightsOn = true;
    }
Exemplo n.º 11
0
 private void OnReset()
 {
     if (statusIndicator == null)
     {
         StatusIndicator ind = GameObject.Find("UIOverlay").GetComponentInChildren <StatusIndicator>();
         if (ind != null)
         {
             statusIndicator = ind;
         }
     }
 }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
 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));
     }
 }
Exemplo n.º 14
0
 public MainWindow()
 {
     InitializeComponent();
     sIndicator = new StatusIndicator(Repos.Status);
     sIndicator.Show();
     Repos.LoadRepos();
     while (!Repos.IsLoaded)
     {
         Thread.Sleep(200);
     }
     sIndicator.Close();
 }
Exemplo n.º 15
0
        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),
            });
Exemplo n.º 16
0
 private void Update()
 {
     if (players_in_range > 0)
     {
         CheckInteraction();
     }
     else
     {
         if (indicator)
         {
             indicator.Finish();
             indicator = null;
         }
     }
 }
Exemplo n.º 17
0
 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!");
     }
 }
Exemplo n.º 18
0
    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);
        }
    }
Exemplo n.º 19
0
        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); });
        }
Exemplo n.º 20
0
        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));
            }
        }
Exemplo n.º 21
0
        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));
            }
        }
Exemplo n.º 22
0
        /// <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));
            }
        }
Exemplo n.º 23
0
        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();
        }
Exemplo n.º 24
0
        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;
        }
Exemplo n.º 25
0
        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));
            }
        }
Exemplo n.º 26
0
        /// <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);
        }
Exemplo n.º 27
0
 public void setStatusIndicator(StatusIndicator statusIndicator)
 {
     this.statusIndicator = statusIndicator;
 }
Exemplo n.º 28
0
 private void Awake()
 {
     musicController = GetComponentInParent <MusicController>();
     statusIndicator = GetComponent <StatusIndicator>();
 }
Exemplo n.º 29
0
 public void setStatusIndicator(StatusIndicator statusIndicator)
 {
     this.statusIndicator = statusIndicator;
 }
Exemplo n.º 30
0
        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;
            }
        }
Exemplo n.º 31
0
 private void Awake()
 {
     sequencer       = GameObject.FindGameObjectWithTag("SequencerCanvas").GetComponentInParent <Sequencer>();
     statusIndicator = GetComponent <StatusIndicator>();
 }