Compare commits
No commits in common. "250d8523ecccebf35e8cc0955419e0dfbb85b5f5" and "09810d6449cad7ac5b085692ff1613c907953b91" have entirely different histories.
250d8523ec
...
09810d6449
|
|
@ -1,25 +0,0 @@
|
||||||
cmake_minimum_required(VERSION 3.28)
|
|
||||||
project(Drugwars)
|
|
||||||
find_package(Doxygen REQUIRED)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
|
||||||
|
|
||||||
add_executable(Drugwars src/main.cpp
|
|
||||||
src/Bag.cpp
|
|
||||||
src/Player.cpp
|
|
||||||
src/Bank.cpp
|
|
||||||
|
|
||||||
)
|
|
||||||
target_include_directories(Drugwars PRIVATE src/include)
|
|
||||||
|
|
||||||
if(DOXYGEN_FOUND)
|
|
||||||
set(DOXYGEN_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs")
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY)
|
|
||||||
|
|
||||||
add_custom_target(doc ALL
|
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} docs/Doxyfile
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
COMMENT "Generating API documentation with Doxygen"
|
|
||||||
VERBATIM)
|
|
||||||
endif()
|
|
||||||
28
src/Bank.cpp
28
src/Bank.cpp
|
|
@ -1,28 +0,0 @@
|
||||||
//
|
|
||||||
// Created by gustavomiranda on 27/09/24.
|
|
||||||
//
|
|
||||||
#include <cmath>
|
|
||||||
#include "Bank.h"
|
|
||||||
|
|
||||||
Bank::Bank(double taxvalue) {
|
|
||||||
setTax(taxvalue);
|
|
||||||
money = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bank::depositMoney(int value) {
|
|
||||||
money += value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bank::withdrawMoney(int value) {
|
|
||||||
if (money >= value){
|
|
||||||
money -= value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int Bank::getMoney() {
|
|
||||||
return money;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bank::updateMoney() {
|
|
||||||
money = std::round(money * (1+tax));
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
//
|
|
||||||
// Created by gustavomiranda on 27/09/24.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef DRUGWARS_BANK_H
|
|
||||||
#define DRUGWARS_BANK_H
|
|
||||||
|
|
||||||
class Bank{
|
|
||||||
private:
|
|
||||||
int money;
|
|
||||||
double tax;
|
|
||||||
void setTax(double value);
|
|
||||||
public:
|
|
||||||
Bank(double taxvalue);
|
|
||||||
void depositMoney(int value);
|
|
||||||
void withdrawMoney(int value);
|
|
||||||
int getMoney();
|
|
||||||
void updateMoney();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif //DRUGWARS_BANK_H
|
|
||||||
Loading…
Reference in New Issue