-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Separate / Divide code handling graphics from code handling logic #114
Merged
tcoyvwac
merged 34 commits into
plibither8:master
from
tcoyvwac:fix/extract_graphics_code_from_logic_code
Oct 13, 2019
Merged
Fix: Separate / Divide code handling graphics from code handling logic #114
tcoyvwac
merged 34 commits into
plibither8:master
from
tcoyvwac:fix/extract_graphics_code_from_logic_code
Oct 13, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawAscii() renamed to AsciiArt2048().
DataSuppliment() is a simple dependency injection tool for (future) functions in the "game-graphics" (and other similar / related) translation units. This DI-like function helps the separation of the coupling between data and the UI.
* Using DataSuppliment(), decoupled global variable state from drawMainMenuGraphics(). * drawMainMenuGraphics() now uses DrawAlways() to render to screen.
drawEndGameStatistics() renamed to EndGameStatisticsPrompt().
drawScoreBoard() renamed to CurrentGameScoreBoardPrompt(). Accepts a custom tuple-struct type (scoreboard_display_data_t) as additional data for its printing purposes.
scoreboard_display_data_t{} made outside of drawBoard().
- drawBoard() renamed to GameScoreBoardOverlay(). - CurrentGameScorePrompt() renamed to GameScoreBoardBox(). - Accepts a custom tuple-struct type (scoreboard_display_data_t) as additional data for its printing purposes.
tcoyvwac
force-pushed
the
fix/extract_graphics_code_from_logic_code
branch
from
October 13, 2019 06:12
fc2369a
to
e36d2eb
Compare
data - EndGameStatisticsPrompt() uses finalscore_display_data_t{} (a custom tuple) to display text data for certrain fields. - Removed header-include to "score.hpp" for game-graphics TU.
- drawEndScreen() is now GameEndScreenOverlay(). - drawInputControls() is now GameInputControlsOverlay().
TU - prettyPrintScoreboard() renamed to ScoreboardOverlay().
- ScoreboardOverlay() uses scoreboard_display_data_list_t as parameter.
tcoyvwac
force-pushed
the
fix/extract_graphics_code_from_logic_code
branch
from
October 13, 2019 06:48
e36d2eb
to
5812b23
Compare
graphics TU - prettyPrintStats() now named TotalStatisticsOverlay().
parameter - TotalStatisticsOverlay() uses total_stats_display_data_t as parameter.
- getPlaySizeOfGameboardDataArray and getTileOnGameboardDataArray now have public TU linkage visibility.
- drawTileString() and tileColor() moved to tile-graphics TU.
- drawGameBoard() now renamed to GameBoardTextOutput(). - GameBoardTextOutput() wrapped in Gameboard::Graphics namespace.
- Moved AsciiArt2048() call from Game-Graphics TU's GameScoreBoardOverlay() into Game TU's drawGraphics().
- FLAG_GAME_IS_ASKING_QUESTION_MODE added to gamestatus_t. - DisplayGameQuestionsToPlayerPrompt() created to hold all text prompt for questions to player. Only active when FLAG_GAME_IS_ASKING_QUESTION_MODE is active.
- drawEndGameLoopGraphics() is a helper function that draws items needed for game-over screen.
tcoyvwac
force-pushed
the
fix/extract_graphics_code_from_logic_code
branch
from
October 13, 2019 07:15
5812b23
to
be5d659
Compare
The PR will be closed via a regular "Merge". 📨 📥 |
As there are no objections, will merge. |
This PR removes soft-blocking on Issue #111. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contributions to the project are welcomed.
New contributors vary in Issues and Pull Requests. However, logical Issues and PRs (to do with game flow and running of the game) are different from stylistic Issues and PRs (to do with spacing in 2048 game board's grid, language text-labels presentation, e.t.c.).
Currently, for newcomers and reviewers, it can be slow to understand the project's code because "graphics" code is too interlinked with code dealing with logic. This PR is to help fix this.
Key points:
std::cout
has been reduced as much as possible.