|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3522 (0xdc2)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
package body Scene is
package Int_Io is new Text_Io.Integer_Io (Num => Integer);
function Creer_Scene return P_Scene is
Result : P_Scene;
begin
Result := new Cell_Scene;
Result.En_Cours := False;
Result.La_Duree := 0;
Result.Nb_Acteurs := 0;
return Result;
end Creer_Scene;
function Scene_Est_Vide (S : in P_Scene) return Boolean is
begin
return Scene_Vide = S;
end Scene_Est_Vide;
procedure Inc_Nb_Acteurs_Scene (Une_Scene : in out P_Scene) is
begin
Une_Scene.Nb_Acteurs := Une_Scene.Nb_Acteurs + 1;
end Inc_Nb_Acteurs_Scene;
procedure Lire_Scene (S : in out P_Scene) is
Une_Scene : P_Scene;
Un_Acteur : Role.Acteur;
I : Integer := 0;
Continu : Boolean := True;
begin
if Scene_Est_Vide (S => S) then
Une_Scene := Creer_Scene;
else
Une_Scene := S;
end if;
while (not Intermediate_Code.End_Of_File) loop
Un_Acteur.Num_Station := Intermediate_Code.Get;
Un_Acteur.Num_Acteur := Intermediate_Code.Get;
while Continu loop
I := I + 1;
if Role.Role_Est_Vide (R => Une_Scene.Les_Roles (I)) then
Continu := False;
Inc_Nb_Acteurs_Scene (Une_Scene => Une_Scene);
else
if Une_Scene.Les_Roles (I).L_Acteur.Num_Station =
Un_Acteur.Num_Station and
Une_Scene.Les_Roles (I).L_Acteur.Num_Acteur =
Un_Acteur.Num_Acteur then
Continu := False;
end if;
end if;
end loop;
Une_Scene.Les_Roles (I) :=
Role.Lire_Un_Role (R => Une_Scene.Les_Roles (I), A => Un_Acteur);
if Une_Scene.La_Duree < Une_Scene.Les_Roles (I).La_Duree then
Une_Scene.La_Duree := Une_Scene.Les_Roles (I).La_Duree;
end if;
Une_Scene.Les_Roles (I).L_Acteur := Un_Acteur;
I := 0;
Continu := True;
end loop;
S := Une_Scene;
end Lire_Scene;
procedure Jouer_Scene (S : P_Scene) is
Scene_Chrono : Timer_Moteur.Objet;
begin
Timer_Moteur.Init_Temps (Scene_Chrono);
Timer_Moteur.Reset_Temps (Scene_Chrono);
Timer_Moteur.Start_Temps (Scene_Chrono);
for I in 1 .. S.Nb_Acteurs loop
Role.Demarrer_Role (R => S.Les_Roles (I));
end loop;
while S.La_Duree >= Timer_Moteur.Temps_Moteur (Scene_Chrono) loop
for I in 1 .. S.Nb_Acteurs loop
Role.Solliciter_Role (R => S.Les_Roles (I),
Chrono => Scene_Chrono);
end loop;
end loop;
Timer_Moteur.Stop_Temps (Scene_Chrono);
end Jouer_Scene;
procedure Affiche_Scene (S : in P_Scene) is
Continu : Boolean := True;
N : Integer;
begin
Text_Io.Put_Line ("affichage de la scene :");
for I in 1 .. S.Nb_Acteurs loop
Role.Affiche_Role (R => S.Les_Roles (I));
Text_Io.Put_Line ("");
Text_Io.Put ("la duree du role est : ");
Int_Io.Put (S.Les_Roles (I).La_Duree);
Text_Io.Put_Line ("");
end loop;
Text_Io.Put ("la duree de la scene est : ");
Int_Io.Put (S.La_Duree);
Text_Io.Put_Line ("");
end Affiche_Scene;
end Scene;