From dc291de04681fa78a949b9aa8eb5f8f29b0f9f0e Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 2 Dec 2010 05:05:29 +0100 Subject: Changed Hand::eat_-functions to return a bool, so a failure can be distinguished from a depleted list of tiles. --- server/hand.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server/hand.h') diff --git a/server/hand.h b/server/hand.h index e38a387..879bc8d 100644 --- a/server/hand.h +++ b/server/hand.h @@ -16,20 +16,20 @@ namespace Hand { // Check if the tiles is matching the normal format but missing one. bool basic_format_tenpai(const Tiles& tiles, bool pair_eaten = false, bool wait_eaten = false); - // Eat a single tile (i.e. the tanki machi) from beginning of list and return rest. - Tiles eat_tanki(Tiles tiles); + // Eat a single tile (i.e. the tanki machi) from beginning of list and return success flag. + bool eat_tanki(Tiles& tiles); - // Eat two tiles waiting for a third to complete a chi (i.e. ryanmen, penchan or kanchan machi) if possible. - Tiles eat_chi_wait(Tiles tiles); + // Eat two tiles waiting for a third to complete a chi (i.e. ryanmen, penchan or kanchan machi) if possible and return success flag. + bool eat_chi_wait(Tiles& tiles); - // Eat a pair from beginning of list if possible and return rest, else return empty list. - Tiles eat_pair(Tiles tiles); + // Eat a pair from beginning of list if possible and return success flag. + bool eat_pair(Tiles& tiles); - // Eat a pon from beginning of list if possible and return rest, else return empty list. - Tiles eat_pon(Tiles tiles); + // Eat a pon from beginning of list if possible and return success flag. + bool eat_pon(Tiles& tiles); - // Eat a chi from beginning of list if possible and return rest, else return empty list. - Tiles eat_chi(Tiles tiles); + // Eat a chi from beginning of list if possible and return success flag. + bool eat_chi(Tiles& tiles); } #endif -- cgit v1.2.3