Ejemplo n.º 1
0
 private void OnEnable()
 {
     m_transform    = m_transform ?? transform;
     m_startPositon = m_transform.position;
     m_display      = m_display ?? gameObject.GetTextComponent();
     m_display.SetText($"-{m_lossTime.Value}");
     StartCoroutine(MoveCoroutine());
 }
        private IDisplayText[] CreateModels(Func <int, IDisplayText> factory, int count)
        {
            var result = new IDisplayText[count];

            for (var i = 0; i < count; ++i)
            {
                result[i] = factory(i + 1);
            }

            return(result);
        }
Ejemplo n.º 3
0
        public static void RunTests(Assembly assembly, IDisplayText lcd, IRunnerUserInput input = null, string logDirectory = null, bool showGcMessages = false)
        {
            if (assembly == null)
            {
                throw new ArgumentNullException("assembly");
            }
            if (lcd == null)
            {
                throw new ArgumentNullException("lcd");
            }

            var ui = new FeedbackToTextDisplay(lcd);

            TestHarness.RunTests(assembly, input, ui, logDirectory, showGcMessages);
        }
Ejemplo n.º 4
0
        private void SetText()
        {
            m_text = m_text ?? gameObject.GetTextComponent();
            if (m_text == null)
            {
                return;
            }

            string text = m_format;

            foreach (var variable in m_variables)
            {
                text = text.Replace($"{{{variable.Key}}}", variable.Update());
            }
            m_text.SetText(text);
        }
Ejemplo n.º 5
0
        private void SetText()
        {
            m_text = m_text ?? gameObject.GetTextComponent();
            if (m_text == null)
            {
                return;
            }

            string text = m_format;

            foreach ((var key, var value) in m_variables.Zip(m_currentStrings, (v, c) => (v.Key, c)))
            {
                text = text.Replace($"{{{key}}}", value);
            }

            m_text.SetText(text);
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            IDisplayText displayText = IocInstanceFactory <IDisplayText> .GetDisplayInstance();

            displayText.DisplayText();
        }
Ejemplo n.º 7
0
 public void SetScore(int score)
 {
     m_display = m_display ?? m_displayText.GetTextComponent();
     m_display.SetText("+" + score.ToString(format));
 }
Ejemplo n.º 8
0
 public FeedbackToTextDisplay(IDisplayText lcd)
 {
     _lcd = lcd;
 }
Ejemplo n.º 9
0
 public TextRenderer(IDisplayText textControl)
 {
     owner = textControl;
 }
Ejemplo n.º 10
0
 private void UpdateValue(IDisplayText[] models, int objectCount, int iterationCount)
 {
     for (var i = 0; i < iterationCount; ++i)
     {
         for (var j = 0; j < objectCount; ++j)
         {
             var model = models[j];
             model.Time = DateTime.Now;
             model.Status = !model.Status;
         }
     }
 }
Ejemplo n.º 11
0
        private IDisplayText[] CreateModels(Func<int, IDisplayText> factory, int count)
        {
            var result = new IDisplayText[count];

            for (var i = 0; i < count; ++i)
            {
                result[i] = factory(i + 1);
            }

            return result;
        }