From cbd6d3aa606b18dde3f203e6edfab04935bbbd59 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 7 May 2024 22:17:32 +0300 Subject: [w9] Added rough solution to ex 3 --- week09/Exercise3/Train.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 week09/Exercise3/Train.h (limited to 'week09/Exercise3/Train.h') diff --git a/week09/Exercise3/Train.h b/week09/Exercise3/Train.h new file mode 100644 index 0000000..6b90477 --- /dev/null +++ b/week09/Exercise3/Train.h @@ -0,0 +1,29 @@ +#pragma once +#include + +class Train { + char model[128]; + unsigned railID; + char* regionsFileName; + char* currentRegion; + + void free(); + void copyFrom(const Train& other); + + void setCurrentRegion(std::ifstream& inFile); + +public: + Train(); + ~Train(); + Train(const Train& other); + Train& operator=(const Train& other); + Train(Train&& other); + Train& operator=(Train&& other); + + Train(const char model[127], unsigned railID, const char* regionsFileName); + + void TransferNextRegion(); + void SwitchRailLine(unsigned railID, const char* regionsFileName); + + friend class TrainNetwork; +}; -- cgit v1.2.3