
Procedure TheaWind(t:integer);     {Display Theater data}

Var i,j:integer;

begin
NormVideo;
Window(1,1,80,25);
With Theater[t] do
  begin
    Windx:=x;                       {Save restore values}
    Windy:=y;
    Winddx:=25;
    Winddy:=max+3;
    Border(x,y,winddx,max+3,2,15,0);
    Window(x+1,y+1,x+winddx-2,y+winddy-2);
    ClrScr;
    Gotoxy(5,1);
    FastWrite(Name,15,0,1);
    for i:=1 to max do
      begin
        Gotoxy(2,1+i);                {Display ships in theater}
        j:=Allied_Fleet[t,i];
        if j<>0 then
            with Allied_Navy[j] do
            Fastwrite(id,15,0,3);
        Gotoxy(13,1+i);
        j:=Axis_Fleet[t,i];
        if j<>0 then
            with Axis_Navy[j] do
            Fastwrite(id,15,0,3);
      end;

  end;
Window(1,1,80,25);
end;

Procedure KbdRd;
begin
  read(kbd,c);
  if (c='Q') or (c='q') then quitsw:=1;
end;

Procedure Restore;                  {Restore window to pic values}
begin
Window(1,1,80,25);
For i:=Windy to (Windy+Winddy) do
  begin
    Gotoxy(Windx,i);
    Fastwrite(copy(screen[i],Windx,Winddx),7,0,1);
  end;
end;

procedure Dispstatus(n:integer);        {Display status on ship n}

begin

Window(1,1,80,25);
Restore;
Windx:=21;                          {Setup window}
Windy:=8;
Winddx:=28;
Winddy:=12;
Border(Windx,windy,winddx,winddy,1,15,0);
Window(Windx+1,Windy+1,Windx+Winddx-2,Windy+winddy-2);
ClrScr;
Gotoxy(1,10);                                   {Display static data}
FastWrite('PRESS ANY KEY TO CONTINUE',7,0,1);
Gotoxy(1,1);
FastWrite(' ID:',7,0,1);
Gotoxy(1,2);
Fastwrite(' Model:',7,0,1);
Gotoxy(1,3);
FastWrite(' Attack:',7,0,1);
Gotoxy(1,4);
FastWrite(' Defense:',7,0,1);
Gotoxy(1,5);
FastWrite(' Damage',7,0,1);
Gotoxy(1,6);
FastWrite(' Theater:',7,0,1);
Gotoxy(1,7);
FastWrite(' Location:',7,0,1);
with Allied_Navy[n] do
begin
  Gotoxy(12,1);
  FastWrite(ID,7,0,1);
  Gotoxy(12,2);
  If Model='A' then Fastwrite('Carrier',7,0,1);
  If Model='S' then Fastwrite('Submarine',7,0,1);
  If Model='C' then Fastwrite('Crusier',7,0,1);
  If Model='V' then Fastwrite('Convoy',7,0,1);
  If Model='B' then Fastwrite('Battleship',7,0,1);
  If Model='D' then Fastwrite('Destroyer',7,0,1);
  If Model='K' then Fastwrite('Kamikazi',7,0,1);
  If Model='M' then Fastwrite('Mtr.Ptl.Bt.',7,0,1);
  If Model='P' then Fastwrite('Planes',7,0,1);
  LowVideo;
  Gotoxy(12,3);
  write(Attack);
  Gotoxy(12,4);
  write(Defense);
  gotoxy(12,5);
  write(damage);
  i:=0;j:=0;
  if Theater<>0 then i:=theater;
  if Fleet<>0 then j:=fleet;
end;
gotoxy(12,6);
if i=0 then
   Fastwrite('Unlimited',7,0,1)
else with Theater[i] do
   Fastwrite(Name,7,0,1);
gotoxy(12,7);
if j=0 then
   Fastwrite('In port',7,0,1)
else with Theater[j] do
   Fastwrite(Name,7,0,1);
Uncursor;
KbdRd;
Window(1,1,80,25);
Restore;
TheaWind(theano);
end;

