Changeset 296 for trunk/UBuilding.pas
- Timestamp:
- Mar 29, 2019, 12:58:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UBuilding.pas
r294 r296 52 52 SCost = 'Cost'; 53 53 SSpecialType = 'Special type'; 54 SNone = 'None'; 55 SCity = 'City'; 54 56 55 57 … … 83 85 84 86 class function TBuildingKind.GetFields: TItemFields; 87 var 88 Field: TItemField; 85 89 begin 86 90 Result := inherited; 87 91 Result.AddField(2, 'Cost', SCost, dtInteger); 88 Result.AddField(3, 'SpecialType', SSpecialType, dtInteger); 92 Field := Result.AddField(3, 'SpecialType', SSpecialType, dtEnumeration); 93 Field.EnumStates.Add(SNone); 94 Field.EnumStates.Add(SCity); 89 95 end; 90 96 … … 94 100 else if Index = 2 then Integer(Value) := Cost 95 101 else if Index = 3 then TBuildingSpecialType(Value) := SpecialType 96 else raise Exception.Create('Unsupported value index ' + IntToStr(Index));102 else inherited; 97 103 end; 98 104 … … 102 108 else if Index = 2 then Cost := Integer(Value) 103 109 else if Index = 3 then SpecialType := TBuildingSpecialType(Value) 104 else raise Exception.Create('Unsupported value index ' + IntToStr(Index));110 else inherited; 105 111 end; 106 112
Note:
See TracChangeset
for help on using the changeset viewer.