Bonjour,
Je me pose une question philosophique sur un besoin spécifique, et j'aurai aimé avoir votre assentiment a se sujet là !
Que lest pour vous la meilleur approche pour résoudre mon besoin, est-ce ceci:
Ou bien ceci:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 TPolaris = record private FValue: UInt8; // Mer: bits 0-1 (2 bits) function GetMer: UInt8; procedure SetMer(Value: UInt8); // Biome: bits 2-5 (4 bits) function GetBiome: UInt8; procedure SetBiome(Value: UInt8); // Riviere: bit 6 (1 bit) function GetRiviere: Boolean; procedure SetRiviere(Value: Boolean); // Lac: bit 7 (1 bit) function GetLac: Boolean; procedure SetLac(Value: Boolean); public property Value: UInt8 read FValue write FValue; property Mer: UInt8 read GetMer write SetMer; property Biome: UInt8 read GetBiome write SetBiome; property Riviere: Boolean read GetRiviere write SetRiviere; property Lac: Boolean read GetLac write SetLac; end;
Merci d'avance de vos retours...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 type Polaris = type UInt8; TPolarisHelper = record helper for Polaris // Mer: bits 0-1 (2 bits) function GetMer: UInt8; procedure SetMer(Value: UInt8); // Biome: bits 2-5 (4 bits) function GetBiome: UInt8; procedure SetBiome(Value: UInt8); // Riviere: bit 6 (1 bit) function GetRiviere: Boolean; procedure SetRiviere(Value: Boolean); // Lac: bit 7 (1 bit) function GetLac: Boolean; procedure SetLac(Value: Boolean); property Mer: UInt8 read GetMer write SetMer; property Biome: UInt8 read GetBiome write SetBiome; property Riviere: Boolean read GetRiviere write SetRiviere; property Lac: Boolean read GetLac write SetLac; end;
Partager