Bug 516 - The program cannot display all cards after code refactoring from text to text art
Summary: The program cannot display all cards after code refactoring from text to text...
Status: RESOLVED FIXED
Alias: None
Product: 2021A-CS3343-Gp17-Big2PokerGame
Classification: Unclassified
Component: GameController (show other bugs)
Version: 3.0
Hardware: PC Windows
: High critical
Deadline: 2020-12-04
Assignee: Chung Ka Shing
URL:
Depends on:
Blocks:
 
Reported: 2020-12-04 11:44 HKT by CHAN Tsz Yin
Modified: 2020-12-04 12:01 HKT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description CHAN Tsz Yin 2020-12-04 11:44:11 HKT

    
Comment 1 CHAN Tsz Yin 2020-12-04 11:45:58 HKT
The program displays error messag
Comment 2 CHAN Tsz Yin 2020-12-04 11:48:47 HKT
I found out that the program cannot output all the cards when they are refactored from text-based card to text-art-based card. This is a very urgent issue, please solve it AS SOON AS POSSIBLE!

In order to continue other progress, I have recovered the code back to text-based card version.
Comment 3 CHAN Tsz Yin 2020-12-04 11:50:58 HKT
My first projection to this error is the program failed to get the text-art-card and therefore none of the cards can be displayed.
Comment 4 CHAN Tsz Yin 2020-12-04 11:52:19 HKT
I will rewrite the format and function of converting the text to text-art.
Comment 5 CHAN Tsz Yin 2020-12-04 11:54:21 HKT
I removed the return text-art function in Card class first. I realize this way is incorrect as it is not Card class's responsibility. I will decide if the modification will be made in either Hand class, Play class or GameController class soon.
Comment 6 CHAN Tsz Yin 2020-12-04 11:56:58 HKT
I changed the way generating text art card and apply it in GameController class. The algorithm of creating text-art-card card by card is incorrect. My current solution is to create several line objects and output them with dedicated line format line by line.
Comment 7 CHAN Tsz Yin 2020-12-04 11:58:08 HKT
Dear all, I changed the way generating text-art cards with my new solution, it seems works well. Please help me double check.
Comment 8 CHAN Tsz Yin 2020-12-04 11:59:24 HKT
There is a minor issue that there is extra space in later card which leading the output format is a bit incorrect after 10th cards.
Comment 9 CHAN Tsz Yin 2020-12-04 12:00:20 HKT
I added more checking conditions to prevent redundant space issue. Please help me check if there is other issues. Thaknks!
Comment 10 CHAN Tsz Yin 2020-12-04 12:01:00 HKT
Double confirmed and it works nice now!