From b2806a321ae52decb2a774c8d26390bbb60d201e Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Thu, 25 Dec 2025 17:33:51 -0500 Subject: [PATCH 1/7] refactor (view): use array for field view --- src/4thand5.m.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/4thand5.m.cpp b/src/4thand5.m.cpp index 142d86f..6f5b135 100644 --- a/src/4thand5.m.cpp +++ b/src/4thand5.m.cpp @@ -1,9 +1,10 @@ +#include #include #include +#include #include #include #include -#include #include "feed.h" #include "game_data.h" @@ -43,15 +44,10 @@ int main(int argc, char *argv[]) gameState.homeTeamId = getGameData(0); // Initialize data views - std::vector> fieldView = { - {'+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'}, - {'|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', '1', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '2', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '3', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '4', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '5', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '4', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '3', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '2', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', '1', '|', '0', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'}, - {'|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'}, - {'|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'}, - {'|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'}, - {'|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', '|', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '|'}, - {'+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '+', '-', '-', '-', '-', '-', '-', '-', '-', '-', '+'} - }; + const std::size_t fieldViewRowSize = 137uz; + const std::size_t fieldViewSize = fieldViewRowSize * 7uz; + std::array fieldView{}; + fieldView.fill(42); // Default fill with '*' // Initialize rendering [ncurses] (void)initscr(); @@ -72,10 +68,10 @@ int main(int argc, char *argv[]) // Buffer rendering (void)wmove(stdscr, minY, minX); - for (int fieldRow = 0; fieldRow < fieldView.size(); fieldRow++) { - for (int fieldCol = 0; fieldCol < fieldView[fieldRow].size(); fieldCol++) { - (void)wmove(stdscr, fieldRow, fieldCol); - (void)waddch(stdscr, fieldView[fieldRow][fieldCol]); + for (std::size_t fieldViewRow = 0; fieldViewRow < fieldView.size() / fieldViewRowSize; fieldViewRow++) { + for (std::size_t fieldViewCol = 0; fieldViewCol < fieldViewRowSize; fieldViewCol++) { + (void)wmove(stdscr, fieldViewRow, fieldViewCol); + (void)waddch(stdscr, fieldView[fieldViewRow + fieldViewCol]); } } From d989af1924df816ba754470ccc333d6116ba01cd Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Thu, 25 Dec 2025 22:04:43 -0500 Subject: [PATCH 2/7] refactor (input): use std::array for cmd --- src/4thand5.m.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/4thand5.m.cpp b/src/4thand5.m.cpp index 6f5b135..d6a5e08 100644 --- a/src/4thand5.m.cpp +++ b/src/4thand5.m.cpp @@ -54,9 +54,8 @@ int main(int argc, char *argv[]) (void)nonl(); // Core loop [input processing + output rendering] - const int cmdLimit = 5; - char cmd[cmdLimit + 1] = {0}; - int minX = 0, minY = 0, maxX = 0, maxY = 0; + std::array cmd{}; + unsigned int minX = 0, minY = 0, maxX = 0, maxY = 0; while (true) { // Check window sizing (void)getbegyx(stdscr, minY, minX); @@ -77,7 +76,7 @@ int main(int argc, char *argv[]) (void)wmove(stdscr, fieldView.size(), minX); (void)wclrtoeol(stdscr); - (void)waddnstr(stdscr, cmd, cmdLimit); + (void)waddnstr(stdscr, cmd.data(), cmd.size()); (void)wmove(stdscr, maxY - 1, minX); (void)wclrtoeol(stdscr); @@ -86,7 +85,7 @@ int main(int argc, char *argv[]) // Reset cursor to input await command wmove(stdscr, maxY - 1, minX); - wgetnstr(stdscr, cmd, cmdLimit); + wgetnstr(stdscr, cmd.data(), cmd.size()); } // Cleanup From 71e1100c77ece63a03093b4bbc5cda5e8e4c8521 Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Thu, 25 Dec 2025 22:05:18 -0500 Subject: [PATCH 3/7] refactor (cmake): CMAKE_CXX_STANDARD 20->23 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b217fc..0cca4cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.1) project(4thand5-cli VERSION 0.0.1 LANGUAGES C CXX) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED True) set(COMPONENT_NAME 4thand5-cli) set(SRC_DIR ${PROJECT_SOURCE_DIR}/src) From 337e0ef9f72ffbe2759b573b3cef06aefcbef478 Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Sat, 27 Dec 2025 00:02:30 -0500 Subject: [PATCH 4/7] feat (cfg): basic cfg read --- CMakeLists.txt | 2 ++ config/4thand5 | 1 + src/4thand5.m.cpp | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 config/4thand5 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cca4cb..3776f16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) set(COMPONENT_NAME 4thand5-cli) set(SRC_DIR ${PROJECT_SOURCE_DIR}/src) set(SCR_DIR ${PROJECT_SOURCE_DIR}/scripts) +set(CFG_DIR ${PROJECT_SOURCE_DIR}/config) set(TST_DIR ${PROJECT_SOURCE_DIR}/tests) enable_testing() @@ -29,6 +30,7 @@ install( install( FILES + ${CFG_DIR}/4thand5 TYPE DATA COMPONENT ${COMPONENT_NAME} ) diff --git a/config/4thand5 b/config/4thand5 new file mode 100644 index 0000000..92a6458 --- /dev/null +++ b/config/4thand5 @@ -0,0 +1 @@ ++---------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----------+| | | 1 | 0 | 2 | 0 | 3 | 0 | 4 | 0 | 5 | 0 | 4 | 0 | 3 | 0 | 2 | 0 | 1 | 0 | || | | | | | | | | | | | | | | | | | | | | || | | | | | | | | | | | | | | | | | | | | || | | | | | | | | | | | | | | | | | | | | || | | | | | | | | | | | | | | | | | | | | |+---------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----------+ diff --git a/src/4thand5.m.cpp b/src/4thand5.m.cpp index d6a5e08..427e31a 100644 --- a/src/4thand5.m.cpp +++ b/src/4thand5.m.cpp @@ -1,8 +1,11 @@ +#include #include #include #include #include +#include #include +#include #include #include @@ -49,6 +52,14 @@ int main(int argc, char *argv[]) std::array fieldView{}; fieldView.fill(42); // Default fill with '*' + // Initialize configuration + std::ifstream configFile("/usr/share/4thand5"); + if (configFile.is_open()) { + (void)std::copy(std::istreambuf_iterator(configFile), std::istreambuf_iterator(), std::begin(fieldView)); + } + + configFile.close(); + // Initialize rendering [ncurses] (void)initscr(); (void)nonl(); @@ -63,20 +74,17 @@ int main(int argc, char *argv[]) // TODO: window size minimums + resizing // Perform command - // TODO: logic updates + // TODO: logic updates: cmd // Buffer rendering (void)wmove(stdscr, minY, minX); for (std::size_t fieldViewRow = 0; fieldViewRow < fieldView.size() / fieldViewRowSize; fieldViewRow++) { for (std::size_t fieldViewCol = 0; fieldViewCol < fieldViewRowSize; fieldViewCol++) { (void)wmove(stdscr, fieldViewRow, fieldViewCol); - (void)waddch(stdscr, fieldView[fieldViewRow + fieldViewCol]); + (void)waddch(stdscr, fieldView[(fieldViewRowSize * fieldViewRow) + fieldViewCol]); } } - (void)wmove(stdscr, fieldView.size(), minX); - (void)wclrtoeol(stdscr); - (void)waddnstr(stdscr, cmd.data(), cmd.size()); (void)wmove(stdscr, maxY - 1, minX); (void)wclrtoeol(stdscr); @@ -84,8 +92,8 @@ int main(int argc, char *argv[]) (void)wrefresh(stdscr); // Reset cursor to input await command - wmove(stdscr, maxY - 1, minX); - wgetnstr(stdscr, cmd.data(), cmd.size()); + (void)wmove(stdscr, maxY - 1, minX); + (void)wgetnstr(stdscr, cmd.data(), cmd.size()); } // Cleanup From 3eb87cdd5c35c06f010030136a3a2254be9f4a37 Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Sat, 27 Dec 2025 01:34:34 -0500 Subject: [PATCH 5/7] refactor (*): update basic flow --- src/4thand5.m.cpp | 38 ++++++++++-------------------- src/CMakeLists.txt | 4 ++-- src/{feeds => feed}/CMakeLists.txt | 3 ++- src/feed/feed.cpp | 27 +++++++++++++++++++++ src/{feeds => feed}/feed.h | 8 ++++--- src/feeds/feed.cpp | 10 -------- tests/integration/CMakeLists.txt | 2 +- tests/integration/feed.t.cpp | 2 +- tests/unit/CMakeLists.txt | 2 +- tests/unit/feed.t.cpp | 2 +- 10 files changed, 53 insertions(+), 45 deletions(-) rename src/{feeds => feed}/CMakeLists.txt (88%) create mode 100644 src/feed/feed.cpp rename src/{feeds => feed}/feed.h (70%) delete mode 100644 src/feeds/feed.cpp diff --git a/src/4thand5.m.cpp b/src/4thand5.m.cpp index 427e31a..2c06509 100644 --- a/src/4thand5.m.cpp +++ b/src/4thand5.m.cpp @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -8,6 +7,7 @@ #include #include #include +#include #include "feed.h" #include "game_data.h" @@ -29,37 +29,25 @@ int main(int argc, char *argv[]) (void)std::signal(SIGINT, signalHandler); - // Initialize data - fourthandfive::GameState gameState { - .homeTeamId = 0, - .awayTeamId = 0, - .homeTeamScore = 0, - .awayTeamScore = 0, - .homeTeamTO = 3, - .awayTeamTO = 3, - .possession = 0, - .down = 0, - .distance = 10, - .yardLine = 0, - .period = 0, - .clock = std::chrono::seconds(900) - }; - gameState.homeTeamId = getGameData(0); - - // Initialize data views - const std::size_t fieldViewRowSize = 137uz; - const std::size_t fieldViewSize = fieldViewRowSize * 7uz; - std::array fieldView{}; - fieldView.fill(42); // Default fill with '*' - // Initialize configuration + std::array configuration{}; std::ifstream configFile("/usr/share/4thand5"); if (configFile.is_open()) { - (void)std::copy(std::istreambuf_iterator(configFile), std::istreambuf_iterator(), std::begin(fieldView)); + (void)std::copy(std::istreambuf_iterator(configFile), std::istreambuf_iterator(), std::begin(configuration)); } configFile.close(); + // Initialize data + std::vector gameLog{}; + // gameLog = getGameData(0); + + // Initialize data views + const std::size_t fieldViewRowSize = 137uz; + const std::size_t fieldViewSize = fieldViewRowSize * 7uz; + std::array fieldView{}; + (void)std::copy(std::begin(configuration), std::end(configuration), std::begin(fieldView)); + // Initialize rendering [ncurses] (void)initscr(); (void)nonl(); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d8ca405..85f2d78 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ set(EXECUTABLE_NAME 4thand5) -add_subdirectory(feeds) +add_subdirectory(feed) add_subdirectory(game_data) add_executable(${EXECUTABLE_NAME}) @@ -8,7 +8,7 @@ add_executable(${EXECUTABLE_NAME}) target_link_libraries(${EXECUTABLE_NAME} PRIVATE ncurses - feeds # local + feed # local game_data # local ) diff --git a/src/feeds/CMakeLists.txt b/src/feed/CMakeLists.txt similarity index 88% rename from src/feeds/CMakeLists.txt rename to src/feed/CMakeLists.txt index 0e7ab19..7729367 100644 --- a/src/feeds/CMakeLists.txt +++ b/src/feed/CMakeLists.txt @@ -1,9 +1,10 @@ -set(LIBRARY_NAME feeds) +set(LIBRARY_NAME feed) add_library(${LIBRARY_NAME} STATIC) target_link_libraries(${LIBRARY_NAME} PUBLIC + game_data # local INTERFACE PRIVATE ) diff --git a/src/feed/feed.cpp b/src/feed/feed.cpp new file mode 100644 index 0000000..eeb56b6 --- /dev/null +++ b/src/feed/feed.cpp @@ -0,0 +1,27 @@ +#include "feed.h" + +#include + +namespace fourthandfive { + +std::vector getGameData(const int gameId) { + return { + { + .homeTeamId = 0, + .awayTeamId = 0, + .homeTeamScore = 0, + .awayTeamScore = 0, + .homeTeamTO = 3, + .awayTeamTO = 3, + .possession = 0, + .down = 0, + .distance = 10, + .yardLine = 0, + .period = 0, + .clock = std::chrono::seconds(900) + } + }; +} + +} // close namespace fourthandfive + diff --git a/src/feeds/feed.h b/src/feed/feed.h similarity index 70% rename from src/feeds/feed.h rename to src/feed/feed.h index d7cffd1..2186079 100644 --- a/src/feeds/feed.h +++ b/src/feed/feed.h @@ -1,7 +1,9 @@ #ifndef FOURTHANDFIVE_FEED_H #define FOURTHANDFIVE_FEED_H -#include +#include + +#include "game_data.h" namespace fourthandfive { /** @@ -10,9 +12,9 @@ namespace fourthandfive { * Retrieve game data from provider feed. * * @param gameId Game ID - * @return Game data + * @return Game log */ - int getGameData(const int gameId); + std::vector getGameData(const int gameId); } // close namespace fourthandfive #endif /* FOURTHANDFIVE_FEED_H */ diff --git a/src/feeds/feed.cpp b/src/feeds/feed.cpp deleted file mode 100644 index 003a4ca..0000000 --- a/src/feeds/feed.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "feed.h" - -namespace fourthandfive { - -int getGameData(const int gameId) { - return 42; -} - -} // close namespace fourthandfive - diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index 774b2ea..16c603f 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -5,7 +5,7 @@ add_executable(4thand5.i.t) target_link_libraries(4thand5.i.t PRIVATE Catch2::Catch2WithMain - feeds # local + feed # local ) target_sources(4thand5.i.t diff --git a/tests/integration/feed.t.cpp b/tests/integration/feed.t.cpp index b32b198..0029e3f 100644 --- a/tests/integration/feed.t.cpp +++ b/tests/integration/feed.t.cpp @@ -5,7 +5,7 @@ namespace fourthandfive { TEST_CASE( "Test Game Data Feed", "[feed]" ) { - REQUIRE( getGameData(0) == 42 ); + REQUIRE( getGameData(0).size() >= 0uz ); } } // close namespace fourthandfive diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index d8fad36..eb4f8cd 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -5,7 +5,7 @@ add_executable(4thand5.u.t) target_link_libraries(4thand5.u.t PRIVATE Catch2::Catch2WithMain - feeds # local + feed # local ) target_sources(4thand5.u.t diff --git a/tests/unit/feed.t.cpp b/tests/unit/feed.t.cpp index b32b198..0029e3f 100644 --- a/tests/unit/feed.t.cpp +++ b/tests/unit/feed.t.cpp @@ -5,7 +5,7 @@ namespace fourthandfive { TEST_CASE( "Test Game Data Feed", "[feed]" ) { - REQUIRE( getGameData(0) == 42 ); + REQUIRE( getGameData(0).size() >= 0uz ); } } // close namespace fourthandfive From 89903bc0724dbc704cd6b32f2054b071139c63cc Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Sat, 27 Dec 2025 01:40:18 -0500 Subject: [PATCH 6/7] refactor (game): rename GameState to GameData --- src/4thand5.m.cpp | 4 ++-- src/feed/feed.cpp | 2 +- src/feed/feed.h | 2 +- src/game_data/game_data.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/4thand5.m.cpp b/src/4thand5.m.cpp index 2c06509..24221ce 100644 --- a/src/4thand5.m.cpp +++ b/src/4thand5.m.cpp @@ -39,8 +39,8 @@ int main(int argc, char *argv[]) configFile.close(); // Initialize data - std::vector gameLog{}; - // gameLog = getGameData(0); + std::vector gameDataLog{}; + gameDataLog = getGameData(0); // Initialize data views const std::size_t fieldViewRowSize = 137uz; diff --git a/src/feed/feed.cpp b/src/feed/feed.cpp index eeb56b6..fb17807 100644 --- a/src/feed/feed.cpp +++ b/src/feed/feed.cpp @@ -4,7 +4,7 @@ namespace fourthandfive { -std::vector getGameData(const int gameId) { +std::vector getGameData(const int gameId) { return { { .homeTeamId = 0, diff --git a/src/feed/feed.h b/src/feed/feed.h index 2186079..f9733fa 100644 --- a/src/feed/feed.h +++ b/src/feed/feed.h @@ -14,7 +14,7 @@ namespace fourthandfive { * @param gameId Game ID * @return Game log */ - std::vector getGameData(const int gameId); + std::vector getGameData(const int gameId); } // close namespace fourthandfive #endif /* FOURTHANDFIVE_FEED_H */ diff --git a/src/game_data/game_data.h b/src/game_data/game_data.h index 4d6e335..d307528 100644 --- a/src/game_data/game_data.h +++ b/src/game_data/game_data.h @@ -5,7 +5,7 @@ namespace fourthandfive { -struct GameState { +struct GameData { unsigned int homeTeamId{0}; unsigned int awayTeamId{0}; unsigned int homeTeamScore{0}; From 64ee75ac183bdfd6398d71aae47be2ec5135e3db Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Sat, 27 Dec 2025 01:42:58 -0500 Subject: [PATCH 7/7] refactor (cmake): reorder variable set --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3776f16..9a4e758 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,9 @@ project(4thand5-cli VERSION 0.0.1 LANGUAGES C CXX) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED True) set(COMPONENT_NAME 4thand5-cli) +set(CFG_DIR ${PROJECT_SOURCE_DIR}/config) set(SRC_DIR ${PROJECT_SOURCE_DIR}/src) set(SCR_DIR ${PROJECT_SOURCE_DIR}/scripts) -set(CFG_DIR ${PROJECT_SOURCE_DIR}/config) set(TST_DIR ${PROJECT_SOURCE_DIR}/tests) enable_testing()