unit u_Player;

interface

type
  TPlayer = record
    Name  : string[30];
    Point,
    Money : Integer;
    {X, Y  : Integer;
    MD    : Boolean; }
  end;

var
  iPlayer : TPlayer;
  Command  : array[1..2] of array of Integer;

procedure Player_Save(FileName : string);
procedure Player_Load(FileName : string);

implementation
uses
  LexUtils;

procedure Player_Save;
var
  F : file;
begin
    AssignFile(F, FileName);
    Rewrite(F, 1);
    BlockWrite(F, iPlayer, SizeOf(TPlayer));
    CloseFile(F);
end;

procedure Player_Load;
var
  F : file;
begin
  if FileEx(FileName) then
  begin
    AssignFile(F, FileName);
    Reset(F, 1);
    BlockRead(F, iPlayer, SizeOf(TPlayer));
    CloseFile(F);
  end
  else
  begin
    iPlayer.Name   := '';
    iPlayer.Comand := 1;
    Player_Save(FileName);
  end;
  iPlayer.Color  := 0;
end;



end.
