sudo apt-get marks
 
Loading...
Searching...
No Matches
TaxStrategy Class Referenceabstract

Abstract base class for tax strategies. More...

#include <TaxSystem.h>

Inheritance diagram for TaxStrategy:
FlatTaxStrategy ProgressiveTaxStrategy

Public Member Functions

virtual ~TaxStrategy ()=default
 Destroys the TaxStrategy object.
 
virtual float calculateTax (CityGrowth *growth)=0
 Calculates the tax based on the implemented strategy.
 
virtual std::string getStrategy ()=0
 Gets the name of the tax strategy.
 

Detailed Description

Abstract base class for tax strategies.

This class defines the interface for different tax strategies that can be implemented. Each strategy will have its own method of calculating taxes.

Member Function Documentation

◆ calculateTax()

virtual float TaxStrategy::calculateTax ( CityGrowth * growth)
pure virtual

Calculates the tax based on the implemented strategy.

Parameters
growthPointer to a CityGrowth object used to gather relevant data for tax calculation.
Returns
The calculated tax amount.

Implemented in FlatTaxStrategy, and ProgressiveTaxStrategy.

◆ getStrategy()

virtual std::string TaxStrategy::getStrategy ( )
pure virtual

Gets the name of the tax strategy.

Returns
A string representing the name of the strategy.

Implemented in FlatTaxStrategy, and ProgressiveTaxStrategy.