-
Notifications
You must be signed in to change notification settings - Fork 1
/
FacilityControl.pas
122 lines (101 loc) · 3.04 KB
/
FacilityControl.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
unit FacilityControl;
interface
uses
Math, TypeControl, FacilityTypeControl, VehicleTypeControl;
type
TFacility = class
private
FId: Int64;
FType: TFacilityType;
FOwnerPlayerId: Int64;
FLeft: Double;
FTop: Double;
FCapturePoints: Double;
FVehicleType: TVehicleType;
FProductionProgress: LongInt;
public
constructor Create(const id: Int64; const facilityType: TFacilityType; const ownerPlayerId: Int64;
const left: Double; const top: Double; const capturePoints: Double; const vehicleType: TVehicleType;
const productionProgress: LongInt); overload;
constructor Create(const facility: TFacility); overload;
function GetId: Int64;
property Id: Int64 read GetId;
function GetType: TFacilityType;
property FacilityType: TFacilityType read GetType;
function GetOwnerPlayerId: Int64;
property OwnerPlayerId: Int64 read GetOwnerPlayerId;
function GetLeft: Double;
property Left: Double read GetLeft;
function GetTop: Double;
property Top: Double read GetTop;
function GetCapturePoints: Double;
property CapturePoints: Double read GetCapturePoints;
function GetVehicleType: TVehicleType;
property VehicleType: TVehicleType read GetVehicleType;
function GetProductionProgress: LongInt;
property ProductionProgress: LongInt read GetProductionProgress;
destructor Destroy; override;
end;
TFacilityArray = array of TFacility;
implementation
constructor TFacility.Create(const id: Int64; const facilityType: TFacilityType; const ownerPlayerId: Int64;
const left: Double; const top: Double; const capturePoints: Double; const vehicleType: TVehicleType;
const productionProgress: LongInt);
begin
FId := id;
FType := facilityType;
FOwnerPlayerId := ownerPlayerId;
FLeft := left;
FTop := top;
FCapturePoints := capturePoints;
FVehicleType := vehicleType;
FProductionProgress := productionProgress;
end;
constructor TFacility.Create(const facility: TFacility);
begin
FId := facility.Id;
FType := facility.FacilityType;
FOwnerPlayerId := facility.OwnerPlayerId;
FLeft := facility.Left;
FTop := facility.Top;
FCapturePoints := facility.CapturePoints;
FVehicleType := facility.VehicleType;
FProductionProgress := facility.ProductionProgress;
end;
function TFacility.GetId: Int64;
begin
result := FId;
end;
function TFacility.GetType: TFacilityType;
begin
result := FType;
end;
function TFacility.GetOwnerPlayerId: Int64;
begin
result := FOwnerPlayerId;
end;
function TFacility.GetLeft: Double;
begin
result := FLeft;
end;
function TFacility.GetTop: Double;
begin
result := FTop;
end;
function TFacility.GetCapturePoints: Double;
begin
result := FCapturePoints;
end;
function TFacility.GetVehicleType: TVehicleType;
begin
result := FVehicleType;
end;
function TFacility.GetProductionProgress: LongInt;
begin
result := FProductionProgress;
end;
destructor TFacility.Destroy;
begin
inherited;
end;
end.