MCPcopy Create free account
hub / github.com/dds-bridge/dds / parse_PBN

Function parse_PBN

library/tests/parse.cpp:268–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266
267
268bool parse_PBN(
269 const vector<string>& list,
270 int& dealer,
271 int& vul,
272 DealPBN * dl)
273{
274 if (list.size() != 9)
275 {
276 cout << "PBN list does not have 9 elements: " << list.size() << "\n";
277 return false;
278 }
279
280 if (! get_head_element(list[0], "PBN"))
281 return false;
282 if (! get_int_element(list[1], dealer, "PBN dealer failed"))
283 return false;
284 if (! get_int_element(list[2], vul, "PBN vul failed"))
285 return false;
286 if (! get_int_element(list[3], dl->trump, "PBN trump failed"))
287 return false;
288 if (! get_int_element(list[4], dl->first, "PBN trump failed"))
289 return false;
290
291 for (int i = 0; i < 3; i++)
292 {
293 dl->currentTrickSuit[i] = 0;
294 dl->currentTrickRank[i] = 0;
295 }
296
297 if (! strip_quotes(
298 list[5] + " " + list[6] + " " + list[7] + " " + list[8],
299 dl->remainCards, "PBN string"))
300 return false;
301
302 return true;
303}
304
305
306bool parse_FUT(

Callers 1

read_fileFunction · 0.85

Calls 3

get_head_elementFunction · 0.85
get_int_elementFunction · 0.85
strip_quotesFunction · 0.85

Tested by

no test coverage detected