Rename 'Pick' to 'RandomPick'

... because 'pick' is way too generic a name to spend a keyword on.
This commit is contained in:
Randy Heit 2014-12-23 21:46:27 -06:00
parent bfb94f13d2
commit 3fb9e754f1
5 changed files with 11 additions and 11 deletions

View File

@ -158,7 +158,7 @@ std2:
'random' { RET(TK_Random); } 'random' { RET(TK_Random); }
'random2' { RET(TK_Random2); } 'random2' { RET(TK_Random2); }
'frandom' { RET(TK_FRandom); } 'frandom' { RET(TK_FRandom); }
'pick' { RET(TK_Pick); } 'randompick' { RET(TK_RandomPick); }
L (L|D)* { RET(TK_Identifier); } L (L|D)* { RET(TK_Identifier); }

View File

@ -122,5 +122,5 @@ xx(TK_Array, "'array'")
xx(TK_In, "'in'") xx(TK_In, "'in'")
xx(TK_SizeOf, "'sizeof'") xx(TK_SizeOf, "'sizeof'")
xx(TK_AlignOf, "'alignof'") xx(TK_AlignOf, "'alignof'")
xx(TK_Pick, "'pick'") xx(TK_RandomPick, "'randompick'")
#undef xx #undef xx

View File

@ -371,7 +371,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls)
return new FxRandom(rng, min, max, sc); return new FxRandom(rng, min, max, sc);
} }
else if (sc.CheckToken(TK_Pick)) else if (sc.CheckToken(TK_RandomPick))
{ {
FRandom *rng; FRandom *rng;
TArray<FxExpression*> list; TArray<FxExpression*> list;
@ -398,7 +398,7 @@ static FxExpression *ParseExpression0 (FScanner &sc, const PClass *cls)
break; break;
sc.MustGetToken(','); sc.MustGetToken(',');
} }
return new FxPick(rng, list, sc); return new FxRandomPick(rng, list, sc);
} }
else if (sc.CheckToken(TK_FRandom)) else if (sc.CheckToken(TK_FRandom))
{ {

View File

@ -559,7 +559,7 @@ public:
// //
//========================================================================== //==========================================================================
class FxPick : public FxExpression class FxRandomPick : public FxExpression
{ {
protected: protected:
FRandom * rng; FRandom * rng;
@ -567,8 +567,8 @@ protected:
public: public:
FxPick(FRandom *, TArray<FxExpression*> mi, const FScriptPosition &pos); FxRandomPick(FRandom *, TArray<FxExpression*> mi, const FScriptPosition &pos);
~FxPick(); ~FxRandomPick();
FxExpression *Resolve(FCompileContext&); FxExpression *Resolve(FCompileContext&);
ExpVal EvalExpression(AActor *self); ExpVal EvalExpression(AActor *self);

View File

@ -1696,7 +1696,7 @@ ExpVal FxRandom::EvalExpression (AActor *self)
// //
// //
//========================================================================== //==========================================================================
FxPick::FxPick(FRandom * r, TArray<FxExpression*> mi, const FScriptPosition &pos) FxRandomPick::FxRandomPick(FRandom * r, TArray<FxExpression*> mi, const FScriptPosition &pos)
: FxExpression(pos) : FxExpression(pos)
{ {
for (unsigned int index = 0; index < mi.Size(); index++) for (unsigned int index = 0; index < mi.Size(); index++)
@ -1713,7 +1713,7 @@ FxPick::FxPick(FRandom * r, TArray<FxExpression*> mi, const FScriptPosition &pos
// //
//========================================================================== //==========================================================================
FxPick::~FxPick() FxRandomPick::~FxRandomPick()
{ {
} }
@ -1723,7 +1723,7 @@ FxPick::~FxPick()
// //
//========================================================================== //==========================================================================
FxExpression *FxPick::Resolve(FCompileContext &ctx) FxExpression *FxRandomPick::Resolve(FCompileContext &ctx)
{ {
CHECKRESOLVED(); CHECKRESOLVED();
for (unsigned int index = 0; index < min.Size(); index++) for (unsigned int index = 0; index < min.Size(); index++)
@ -1741,7 +1741,7 @@ FxExpression *FxPick::Resolve(FCompileContext &ctx)
// //
//========================================================================== //==========================================================================
ExpVal FxPick::EvalExpression(AActor *self) ExpVal FxRandomPick::EvalExpression(AActor *self)
{ {
ExpVal val; ExpVal val;
val.Type = VAL_Int; val.Type = VAL_Int;