58 lines
962 B
ObjectPascal
58 lines
962 B
ObjectPascal
unit Game.Map;
|
|
|
|
interface
|
|
uses
|
|
Game.Intf;
|
|
|
|
|
|
type
|
|
TGameMap = class(TInterfacedObject, IGameMap)
|
|
private
|
|
FCategory: string;
|
|
FName: string;
|
|
FDisplayName: string;
|
|
public
|
|
constructor Create(const AName: string; const ADisplayName, ACategory: string);
|
|
|
|
{ IGameMap }
|
|
function GetCategory: string;
|
|
function GetName: string;
|
|
function GetDisplayName: string;
|
|
end;
|
|
|
|
|
|
implementation
|
|
uses
|
|
System.StrUtils;
|
|
|
|
|
|
{ TGameMap }
|
|
constructor TGameMap.Create(const AName, ADisplayName, ACategory: string);
|
|
begin
|
|
inherited Create;
|
|
|
|
FName := AName;
|
|
FDisplayName := IfThen(Length(ADisplayName) > 0, ADisplayName, AName);
|
|
FCategory := ACategory;
|
|
end;
|
|
|
|
|
|
function TGameMap.GetCategory: string;
|
|
begin
|
|
Result := FCategory;
|
|
end;
|
|
|
|
|
|
function TGameMap.GetName: string;
|
|
begin
|
|
Result := FName;
|
|
end;
|
|
|
|
|
|
function TGameMap.GetDisplayName: string;
|
|
begin
|
|
Result := FDisplayName;
|
|
end;
|
|
|
|
end.
|