protected void ExitSceneAll(int lineno) { foreach (var ch in OnStage) { ch.OnStage = false; } OnStage.Clear(); }
protected void ExitScene(int lineno, Character character) { if (!character.OnStage) { throw new RuntimeException(lineno, "{0} is not on stage, and thus cannot exit!", character.Name); } OnStage.Remove(character); character.OnStage = false; }
protected void EnterScene(int lineno, Character character) { if (character.OnStage) { throw new RuntimeException(lineno, "{0} is already on stage, and thus cannot enter!", character.Name); } character.OnStage = true; OnStage.Add(character); }
protected void Activate(int lineno, Character character) { if (!character.OnStage) { throw new RuntimeException(lineno, "{0} is not on stage, and thus cannot speak!", character.Name); } /* If there are exactly two people on stage, the other one should be * second person */ if (NumberOnStage == 2) { SecondPerson = OnStage.Single(ch => !ch.Equals(character)); } else { SecondPerson = null; } FirstPerson = character; }