// UMBC - CMSC 341 - Spring 2023 - Proj1 #include "fuel.h" FuelSys::FuelSys(){ } FuelSys::~FuelSys(){ } bool FuelSys::addTank(int tankID, int tankCap, int tankFuel = 0) { } bool FuelSys::removeTank(int tankID){ } bool FuelSys::findTank(int tankID){ } bool FuelSys::addPump(int tankID, int pumpID, int targetTank){ } bool FuelSys::removePump(int tankID, int pumpID){ } int FuelSys::totalFuel() const{ } bool FuelSys::drain(int tankID, int pumpID, int fuel){ } bool FuelSys::fill(int tankID, int fuel){ } const FuelSys & FuelSys::operator=(const FuelSys & rhs){ } void FuelSys::dumpSys() const{ if (m_current != nullptr){ Tank* tempTank = m_current->m_next;//we start at front item //we continue visting nodes until we reach the cursor while(m_current != nullptr && tempTank != m_current){ cout << "Tank " << tempTank->m_tankID << "(" << tempTank->m_tankFuel << " kg)" << endl; // now dump the targets for all pumps in this tank // we need to traverse the list of pumps dumpPumps(tempTank->m_pumps); tempTank = tempTank->m_next; } //at the end we visit the cursor (current) //this also covers the case that there is only one item cout << "Tank " << m_current->m_tankID << "(" << m_current->m_tankFuel << " kg)" << endl; dumpPumps(tempTank->m_pumps); cout << "The current tank is " << m_current->m_tankID << endl; } else cout << "There is no tank in the system!\n\n"; } void FuelSys::dumpPumps(Pump* pumps) const{ // this traverses the linked list to the end Pump* tempPump = pumps; while (tempPump != nullptr){ cout << " => pump " << tempPump->m_pumpID << "(To tank " << tempPump->m_target << ")" << endl; tempPump = tempPump->m_next; } }