{"id":"4zQBamjexp","url":"https://pastebin.ca/4zQBamjexp","raw_url":"https://raw.anybin.ca/4zQBamjexp","visibility":"public","access":"public","created_at":1794000042896,"expires_at":1794604842896,"fetch_limit":null,"fetches_used":0,"reads_remaining":null,"size_bytes":1633,"syntax_hint":"c","title":null,"filename":null,"change_note":null,"cipher":null,"cipher_meta":null,"parent_id":null,"root_id":"4zQBamjexp","version":1,"owner_id":null,"recipient_id":null,"body":"bool GameCore::AI::TryToSubmitChoiceAndOption<>\n               (Manager *congress,PlayerTypes player,ResolutionTypes res,int option,\n               UnitPromotionClassTypes preferredChoice)\n\n{\n  IntRange iRandTarget;\n  uint resolutions_size;\n  UnitPromotionClassTypes *resolutions_begin;\n  UnitPromotionClassTypes *resolutions_end;\n  Instance *pkGame;\n  UnitPromotionClassTypes iPreferredTarget;\n  UnitPromotionClassTypes ePromotionClassType;\n  Vector<> resolutions;\n  iPreferredTarget = preferredChoice;\n  Types::Vector<>::Vector(&resolutions);\n  GameCore::Congress::Manager::GetPossibleResolutionTargets<>(congress,player,res,&resolutions);\n  resolutions_begin = Types::Vector<>::begin(&resolutions);\n  resolutions_end = Types::Vector<>::end(&resolutions);\n  for (; (resolutions_begin != resolutions_end && (*resolutions_begin != iPreferredTarget));\n      resolutions_begin = resolutions_begin + 1) {\n  }\n  resolutions_end = Types::Vector<>::end(&resolutions);\n  if (resolutions_begin == resolutions_end) {\n    pkGame = GameCore::Game::GetInstance();\n    resolutions_size = Types::Vector<>::size(&resolutions);\n    iRandTarget = GameCore::Game::Instance::GetRandNum(pkGame,(IntRange)resolutions_size,\"Random congress resolution target\");\n    ePromotionClassType = (UnitPromotionClassTypes)iRandTarget;\n    GameCore::Congress::Manager::SubmitResolutionDecisionFromUi<>(congress,player,res,&ePromotionClassType,option);\n  }\n  else {\n    GameCore::Congress::Manager::SubmitResolutionDecision<>(congress,player,res,&iPreferredTarget,option);\n  }\n  Types::Vector<>::~Vector(&resolutions);\n  return resolutions_begin != resolutions_end;\n}"}