I would recommend Steves solution as the starting point, but go a bit further with the use of enumerated types and sets...
type
TRace = (rcRace0, rcRace1, rcRace2, rcRace3, rcRace4);
TCharacterClass = (ccClass0, ccClass1, ccClass2, ccClass3);
TCharacterClassSet = set of TCharacterClass;
const
validCombinations : array[TRace] of TCharacterClassSet = (
[ccClass0, ccClass1, ccClass2, ccClass3], // race0 can be any class
[ccClass0, ccClass2], // race1
[ccClass0, ccClass1, ccClass2], // race2
[ccClass0, ccClass3], // race3
[ccClass0] // race4
);
You could also set up constants for the race names and character classes:
const
raceNames : array[TRace] of string = (
'Race 0',
'Race 1',
'Race 2',
'Race 3',
'Race 4'
);
characterClassNames = array[TCharacterClass] of string = (
'Class 0',
'Class 1 ',
'Class 2',
'Class 3'
);
Now, if you use comboboxes for user input and map the input to these enumerated types, the check if a combination is valid is simple:
function ValidRaceAndClass( aRace : TRace; aClass : TCharacterClass ) : Boolean;
begin
result := aClass in validCombinations[ aRace ];
end;