MCPcopy Create free account
hub / github.com/JACoders/OpenJK / EvaluateConditional

Method EvaluateConditional

code/icarus/Sequencer.cpp:1146–1477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144//FIXME: This function will be written better later once the functionality of the ideas here are tested
1145
1146int CSequencer::EvaluateConditional( CBlock *block , CIcarus* icarus)
1147{
1148 IGameInterface* game = icarus->GetGame();
1149 CBlockMember *bm;
1150 char tempString1[128], tempString2[128];
1151 vec3_t vec;
1152 int id, i, oper, memberNum = 0;
1153 char *p1 = NULL, *p2 = NULL;
1154 int t1, t2;
1155
1156 //
1157 // Get the first parameter
1158 //
1159
1160 bm = block->GetMember( memberNum++ );
1161 id = bm->GetID();
1162
1163 t1 = id;
1164
1165 switch ( id )
1166 {
1167 case CIcarus::TK_FLOAT:
1168 sprintf( (char *) tempString1, "%.3f", *(float *) bm->GetData() );
1169 p1 = (char *) tempString1;
1170 break;
1171
1172 case CIcarus::TK_VECTOR:
1173
1174 tempString1[0] = '\0';
1175
1176 for ( i = 0; i < 3; i++ )
1177 {
1178 bm = block->GetMember( memberNum++ );
1179 vec[i] = *(float *) bm->GetData();
1180 }
1181
1182 sprintf( (char *) tempString1, "%.3f %.3f %.3f", vec[0], vec[1], vec[2] );
1183 p1 = (char *) tempString1;
1184
1185 break;
1186
1187 case CIcarus::TK_STRING:
1188 case CIcarus::TK_IDENTIFIER:
1189 case CIcarus::TK_CHAR:
1190
1191 p1 = (char *) bm->GetData();
1192 break;
1193
1194 case CIcarus::ID_GET:
1195 {
1196 int type;
1197 char *name;
1198
1199 //get( TYPE, NAME )
1200 type = (int) (*(float *) block->GetMemberData( memberNum++ ));
1201 name = (char *) block->GetMemberData( memberNum++ );
1202
1203 //Get the type returned and hold onto it

Callers

nothing calls this directly

Calls 12

RandomMethod · 0.80
DebugPrintMethod · 0.80
EvaluateMethod · 0.80
GetGameMethod · 0.45
GetMemberMethod · 0.45
GetIDMethod · 0.45
GetDataMethod · 0.45
GetMemberDataMethod · 0.45
GetFloatMethod · 0.45
GetStringMethod · 0.45
GetVectorMethod · 0.45
GetTagMethod · 0.45

Tested by

no test coverage detected