Changeset 338
- Timestamp:
- Sep 8, 2024, 10:52:50 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Map.pas
r330 r338 28 28 FId: Integer; 29 29 FMap: TMap; 30 FPower: Integer;31 30 FUnit: TUnit; 32 function GetPower: Integer;33 31 procedure SetArea(AValue: TMapArea); 34 32 procedure SetBuilding(AValue: TBuilding); 35 33 procedure SetId(AValue: Integer); 36 procedure SetPower(AValue: Integer);37 34 procedure SetUnit(AValue: TUnit); 38 35 public … … 69 66 property OneUnit: TUnit read FUnit write SetUnit; 70 67 property Building: TBuilding read FBuilding write SetBuilding; 71 //property Power: Integer read GetPower;72 68 end; 73 69 … … 917 913 { TCell } 918 914 919 procedure TCell.SetPower(AValue: Integer);920 begin921 if FPower = AValue then Exit;922 if AValue < 0 then923 raise Exception.Create(SNegativeCellPowerNotAllowed);924 FPower := AValue;925 //Check;926 end;927 928 915 procedure TCell.SetUnit(AValue: TUnit); 929 916 var … … 990 977 FBuilding := AValue; 991 978 if Assigned(FBuilding) then FBuilding.MapCell := Self; 992 end;993 994 function TCell.GetPower: Integer;995 begin996 if Assigned(OneUnit) then Result := OneUnit.Power997 else Result := 0;998 979 end; 999 980
Note:
See TracChangeset
for help on using the changeset viewer.