Bug 252 (fan, Max., point)

Summary: Test case of legal hand found to have exceed maximum fan points (13 points)
Product: Mahjong Calculator Reporter: kinlokho2-c
Component: MahjongAssignee: Wong Jyu Fung <jfwong3-c>
Status: UNCONFIRMED ---    
Severity: minor CC: chleung374-c, himywong2-c, jfwong3-c
Priority: Normal    
Version: unspecified   
Hardware: PC   
OS: All   
Deadline: 2018-11-13   
Attachments: Capscreen of output for test case "Great Dragon Mix One Suit All Triplet"

Description kinlokho2-c 2018-11-10 13:03:45 HKT
Created attachment 16 [details]
Capscreen of output for test case "Great Dragon Mix One Suit All Triplet"

I discover that some test cases can output the correct name of the legal hand with an invalid corresponding fan point because it exceeds 13. 

How to reproduce:

1. Input 14 tiles which can complete a legal hand combining multiple hand types 
   with a total fan point exceeds 13.
   e.g. {"H5", "H5", "H5", "M9", "M9", "M9", "H6", "H6", "H6", "H7", "H7","H7", 
        "M5", "M5"}

Expected result:
Is a legal Hand Type
Points: 14
Name: Great Dragon Mix One Suit All Triplet 

Actual result:
Is a legal Hand Type
Points: 14
Name: Great Dragon Mix One Suit All Triplet 

To fix:
It seems that we forget to design a function, says SetMaximumFanPoint().
Therefore, even though it is possible to form a legal hand which combine multiple hand types with a fan point more than 13 conceptually, the maximum fan point display will only be 13.
Comment 1 Wong Jyu Fung 2018-11-18 21:47:23 HKT
As I haven't expected that the point would be over 13 which is the maximum point when I write the program. Therefore, When the points of the win hand is 14 or 15, it would not be changed into 13

I modified the getPoint() in pointsAccumulator so that when the points are over 13, it would still return 13
Comment 2 kinlokho2-c 2018-11-18 22:09:38 HKT
As I do not expect the fan point of any cases would be over 13 which is the maximum point when I write the program. Therefore, I neglect to maximize the fan point to 13 when coding.

I revised the code in class pointsAccumulator and modified the function getPoint() so that when the points of a legal hand type are over 13, it would return 13.