CSCE-A201 / Disaster-on-Dysnomia

Text based RPG for CSCE A201
0 stars 0 forks source link

File upload #12

Closed Sawyer-W-Anderson closed 2 months ago

Sawyer-W-Anderson commented 3 months ago

Engineroom code and text files: If we have any issues with the code's structure, we can edit it as needed here.

Sawyer-W-Anderson commented 2 months ago

Perfect. I'll take a look and update these sometime tomorrow or over the weekend as soon as I have the time.

On Thu, Jul 18, 2024 at 2:45 PM thatcherty @.***> wrote:

@.**** requested changes on this pull request.

In Engineroom/engineroom.cpp https://github.com/CSCE-A201/Text-Based-Adventure-Name-Pending/pull/12#discussion_r1683577168 :

  • switch (choice)
  • {
  • case 1:
  • lookAtEngine();
  • break;
  • case 2:
  • cout << readFromFile("engineroom_leave.txt") << endl;
  • return;
  • default:
  • cout << "Invalid choice. Please try again.\n\n"; // Double newline for clarity
  • }
  • } while (choice != 2);
  • }
  • +private:

  • bool enginePiece = false; // Assuming initially player doesn't have engine piece

Class looks great! This variable is the one change I would request. The player class was planned to hold the engine piece variable, so that can be referenced in the enter function where needed. The enter function will likely need to take in the player object as an argument.

In Engineroom/engineroom.cpp https://github.com/CSCE-A201/Text-Based-Adventure-Name-Pending/pull/12#discussion_r1683577475 :

  • cerr << "Error: Could not open file " << filename << endl;
  • return "";
  • }
  • string content;
  • getline(file, content, '\0'); // Read entire file content into string
  • file.close();
  • content += "\n"; // Append a newline to the content
  • return content; +}
  • +// Class for the Engine Room +class EngineRoom +{ +public:

  • // Function to handle entering the engine room
  • void enter()

here would need enter(Player &player) if we give the player class the engine piece variable. I added a note in the pull request, but take a look at the conventions branch in github and see what you think!

— Reply to this email directly, view it on GitHub https://github.com/CSCE-A201/Text-Based-Adventure-Name-Pending/pull/12#pullrequestreview-2187021809, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJQSMSWYT2ZSVQJQJOSJ7TDZNBARDAVCNFSM6AAAAABLBO6LF6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDCOBXGAZDCOBQHE . You are receiving this because you authored the thread.Message ID: <CSCE-A201/Text-Based-Adventure-Name-Pending/pull/12/review/2187021809@ github.com>

-- Austin W Cranford Phone: 907-201-0340 Email: @.***

thatcherty commented 2 months ago

Copied over the engine room class to main.cpp