- first stage of simplifying the type system.
Let's use inline checkers in PType instead of constantly having to do clumsy IsKindOf checks etc. Once complete this also means that the types can be taken out of the class hierarchy, freeing up some common names.
This commit is contained in:
parent
522ce59be2
commit
b2d944974e
16 changed files with 152 additions and 137 deletions
|
|
@ -424,7 +424,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc)
|
|||
}
|
||||
params.Push(f.GetIndex());
|
||||
}
|
||||
else if (args[i]->IsKindOf(RUNTIME_CLASS(PInt)))
|
||||
else if (args[i]->isIntCompatible())
|
||||
{
|
||||
char *endp;
|
||||
int v = (int)strtoll(sc.String, &endp, 0);
|
||||
|
|
@ -441,7 +441,7 @@ static void ParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc)
|
|||
if (args[i] == TypeBool) v = !!v;
|
||||
params.Push(v);
|
||||
}
|
||||
else if (args[i]->IsKindOf(RUNTIME_CLASS(PFloat)))
|
||||
else if (args[i]->isFloat())
|
||||
{
|
||||
char *endp;
|
||||
double v = strtod(sc.String, &endp);
|
||||
|
|
@ -775,7 +775,7 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc)
|
|||
{
|
||||
params.Push(V_GetColor(nullptr, sc));
|
||||
}
|
||||
else if (args[i]->IsKindOf(RUNTIME_CLASS(PInt)))
|
||||
else if (args[i]->isIntCompatible())
|
||||
{
|
||||
char *endp;
|
||||
int v = (int)strtoll(sc.String, &endp, 0);
|
||||
|
|
@ -794,7 +794,7 @@ static void ParseOptionMenuBody(FScanner &sc, DOptionMenuDescriptor *desc)
|
|||
if (args[i] == TypeBool) v = !!v;
|
||||
params.Push(v);
|
||||
}
|
||||
else if (args[i]->IsKindOf(RUNTIME_CLASS(PFloat)))
|
||||
else if (args[i]->isFloat())
|
||||
{
|
||||
char *endp;
|
||||
double v = strtod(sc.String, &endp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue