From 6bf0b3fe551086b968b4e04623e10d53a60a3fe0 Mon Sep 17 00:00:00 2001 From: Rodrigo Alfonso Date: Wed, 22 Jan 2025 07:36:58 -0300 Subject: [PATCH] Adding clear parameter to getResult --- lib/LinkCableMultiboot.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/LinkCableMultiboot.hpp b/lib/LinkCableMultiboot.hpp index 8eb8ed0..008e982 100644 --- a/lib/LinkCableMultiboot.hpp +++ b/lib/LinkCableMultiboot.hpp @@ -515,9 +515,15 @@ class LinkCableMultiboot { State getState() { return state; } /** - * @brief Returns the result of the last operation. + * @brief Returns the result of the last operation. After this + * call, the result is cleared if `clear` is `true` (default behavior). + * @param clear Whether it should clear the result or not. */ - Result getResult() { return result; } + Result getResult(bool clear = true) { + Result _result = result; + result = NONE; + return result; + } /** * @brief Returns the number of connected players (`1~4`).