From 938e61f01a6b4806f3b17e5e8f04049d00dff270 Mon Sep 17 00:00:00 2001 From: kelson8 Date: Mon, 6 Jan 2025 13:26:56 -0500 Subject: [PATCH] Add missing update to text_menu.cpp, and add constructor test. --- menus/text_menu.cpp | 8 ++++++-- test/constructor_test.cpp | 9 +++++++++ test/constructor_test.h | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 test/constructor_test.cpp create mode 100644 test/constructor_test.h diff --git a/menus/text_menu.cpp b/menus/text_menu.cpp index 8a250e3..c2b4944 100644 --- a/menus/text_menu.cpp +++ b/menus/text_menu.cpp @@ -31,9 +31,13 @@ void TextMenu::TextMainMenu() { if(show_text) { - TextFileFunctions::printTextOutput("test.txt"); - //ImGui::Text(TextFileFunctions::printTextOutput("test.txt")); + // This just spams the console. + //TextFileFunctions::printTextOutput("test.txt"); + // This works!!! + // Why? I didn't think this would print multiple lines. + //outputTextFileContents("test.txt"); + TextFileFunctions::outputTextFileContents("test.txt"); } diff --git a/test/constructor_test.cpp b/test/constructor_test.cpp new file mode 100644 index 0000000..4e65fee --- /dev/null +++ b/test/constructor_test.cpp @@ -0,0 +1,9 @@ +#include "constructor_test.h" + + +// TODO Attempt to call in the main class or where ever the hell I'm doing this ImGui test. +Car::Car(std::string x, std::string y, int z) { + brand = x; + model = y; + year = z; +} \ No newline at end of file diff --git a/test/constructor_test.h b/test/constructor_test.h new file mode 100644 index 0000000..c313763 --- /dev/null +++ b/test/constructor_test.h @@ -0,0 +1,15 @@ +#pragma once +#include + + +// https://www.w3schools.com/cpp/cpp_constructors.asp + +class Car +{ +public: + std::string brand; + std::string model; + int year; + Car(std::string x, std::string y, int z); // Constructor declaration +}; +