コード例 #1
0
        private void Spiel_OnEngineUpdate(object sender, EventArgs e)
        {
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                //BitmapEng.RenderImage(Spiel.ScreenWidth, Spiel.ScreenHeigth, Spiel.m_output);

                CanvasDisplay.BeginInit();

                for (int i = 0; i < Spiel.m_output.Length; i++)
                {
                    if (Spiel.m_output[i].State == 1)
                    {
                        CanvasDisplay.Children[i].Visibility = Visibility.Visible;
                    }
                    else
                    {
                        CanvasDisplay.Children[i].Visibility = Visibility.Hidden;
                    }
                }

                CanvasDisplay.EndInit();
                Delay = Spiel.Delay;
                FCnt++;
            }));

            DoEvents();
        }
コード例 #2
0
ファイル: BoidHearing.cs プロジェクト: ZimCodes/FinalAI
    /// <summary>
    /// Reset the amount of time the canvas is displayed for the allies of the islanders;
    /// </summary>
    private void ResetAllyCanvasTimer(HearAspect _hearobj)
    {
        CanvasDisplay otherCanvas = _hearobj.GetComponentInParent <CanvasDisplay>();

        otherCanvas.ResetDisplayTime(this.GetComponentInParent <SightTouchAspect>().aspect);
    }