unit City;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;
{
Types of Settlements will be as follows:
Hamlets will be no more than 50 Settlers. // These are just my notes about the program
Villages will be no more than 100 Settlers.
Towns will be no more than 200 Settlers.
Cities will be no more than 500 Settlers.
Metropolises will have no limit on Settlers.
}
type
Tgtt = Array [1..3] of String;
TVillage = Packed Record
Name, Inn, Government : String;
Gods, Taverns, Trade : Tgtt;
Population, Families, Farmers, Artisans, Laborers, Paupers : Integer;
end; {type Village}
type
{ TForm1 }
TForm1 = class(TForm)
Farmers : TEdit;
Artisans : TEdit;
Laborers : TEdit;
Paupers : TEdit;
VillageName : TEdit;
Population : TEdit;
Families : TEdit;
InnSelector : TListBox;
TavernSelector : TListBox;
TradeSelector : TListBox;
Characters : TListBox;
CitySelector : TListBox;
Memo1 : TMemo;
InnDescription : TMemo;
TavernDescription : TMemo;
TradeDescription : TMemo;
CharacterDescription: TMemo;
VilNam : TStaticText;
InnDesc : TStaticText;
TavDesc : TStaticText;
TradSel : TStaticText;
TradDesc : TStaticText;
Chars : TStaticText;
CharDesc : TStaticText;
CitySel : TStaticText;
Popul : TStaticText;
Famil : TStaticText;
InnSel : TStaticText;
TavSel : TStaticText;
Farm : TStaticText;
Arts : TStaticText;
Labors : TStaticText;
Paups : TStaticText;
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
Villages : Array [1..1000] of TVillage;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
Procedure GetVillageData; // Get the Village Data.
Var
FilenameIn : Textfile;
Recds, y : Integer;
Begin {Proc GetVillageData}
Assignfile(FilenameIn, 'VillageData.txt');
Recds := 1;
Try
Reset(FilenameIn);
While not EOF(FilenameIn) do
Begin {While}
ReadLn(FilenameIn, Villages[Recds].Name);
ReadLn(FilenameIn, Villages[Recds].Inn);
ReadLn(FilenameIn, Villages[Recds].Government);
ReadLn(FilenameIn, Villages[Recds].Population);
ReadLn(FilenameIn, Villages[Recds].Families);
ReadLn(FilenameIn, Villages[Recds].Farmers);
ReadLn(FilenameIn, Villages[Recds].Artisans);
ReadLn(FilenameIn, Villages[Recds].Laborers);
ReadLn(FilenameIn, Villages[Recds].Paupers);
For y := 1 to 3 do
Begin {For y := 1 to 3 do}
ReadLn(FilenameIn, Villages[Recds].Gods[y]);
ReadLn(FilenameIn, Villages[Recds].Taverns[y]);
ReadLn(FilenameIn, Villages[Recds].Trade[y]);
end; {For y := 1 to 3 do}
Recds := Recds + 1;
end; {While}
Close(FilenameIn);
finally
end; {Try Finally}
End; {Proc GetVillageData}
begin {Proc FormCreate}
end; {Proc FormCreate}
end.