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

Abstract base class representing materials used in resource management. More...

#include <Resources.h>

Inheritance diagram for Materials:
Resources Concrete Steel Wood

Public Member Functions

 Materials ()
 Default constructor for the Materials class.
 
void increase ()
 Increases the quantity of materials.
 
virtual void obtain ()=0
 Abstract method to obtain materials.
 
virtual void refine ()=0
 Abstract method to refine materials.
 
int getKilo () const
 Gets the quantity of materials in kilograms.
 
void setKilo (int k)
 Sets the quantity of materials in kilograms.
 
- Public Member Functions inherited from Resources
 Resources ()
 Default constructor for Resources.
 

Protected Attributes

int kilograms
 The quantity of materials in kilograms.
 

Detailed Description

Abstract base class representing materials used in resource management.

The Materials class serves as an abstract base for different types of materials that can be obtained and refined. It defines common functionality and properties related to materials used within the city management system.

Constructor & Destructor Documentation

◆ Materials()

Materials::Materials ( )

Default constructor for the Materials class.

This constructor initializes the materials with default values.

Member Function Documentation

◆ getKilo()

int Materials::getKilo ( ) const
inline

Gets the quantity of materials in kilograms.

Returns
The amount of materials in kilograms.

◆ increase()

void Materials::increase ( )

Increases the quantity of materials.

This method is responsible for calling the obtain and refine methods to manage the material acquisition and refinement processes.

◆ obtain()

virtual void Materials::obtain ( )
pure virtual

Abstract method to obtain materials.

Derived classes must implement this method to define how materials are obtained.

Implemented in Concrete, Steel, and Wood.

◆ refine()

virtual void Materials::refine ( )
pure virtual

Abstract method to refine materials.

Derived classes must implement this method to define how materials are refined.

Implemented in Concrete, Steel, and Wood.

◆ setKilo()

void Materials::setKilo ( int k)
inline

Sets the quantity of materials in kilograms.

Parameters
kThe quantity of materials to set in kilograms.