Exemple #1
0
    public void DisplayUpdaterWorks()
    {
        DisplayUpdater du = new DisplayUpdater();

        Assert.True(du.IsEmpty());

        du.Add(new UnupdatedDisplay(), 0);
        Assert.False(du.IsEmpty());

        du.Clear();
        Assert.True(du.IsEmpty());

        du.Add(new UnupdatedDisplay(), 0);
        du.UpdateNextDisplay();
        Assert.True(du.IsEmpty());
    }
Exemple #2
0
    public void FixedUpdate()
    {
        int displaysUpdated = 0;

        while (displaysUpdated < displayUpdateRate && !displayUpdater.IsEmpty())
        {
            displayUpdater.UpdateNextDisplay();
            displaysUpdated++;
        }

        int texturesUpdated = 0;

        while (texturesUpdated < textureUpdateRate && !textureUpdater.IsEmpty())
        {
            textureUpdater.UpdateNextDisplay();
            texturesUpdated++;
        }
    }