//A coroutine that handles the real time portion of the battle mechanics
    IEnumerator LineProcessing()
    {
        //Before each loop we check if the battle is over
        while (!IsBattleOver())
        {
            //If the line is empty, we wait until someone joins
            while (line.Count == 0)
            {
                yield return(null);
            }

            //Set the controlling boolean to true
            currentGoing = true;

            //Pop the first one in line
            current = line[0];
            line.RemoveAt(0);
            //Tell the popped unit to go
            current.Act();

            //Wait for the current to be done
            while (currentGoing)
            {
                yield return(null);
            }
        }

        //Once we escape the above loop, the battle is over
        BattleEnded();
    }
예제 #2
0
 private void Tick(BattleActor BA1, BattleActor BA2)
 {
     BA1.Act();
     BA2.Act();
 }