From bd1b1dfdb56f3123ba4b5132c4330456b59580d6 Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Tue, 15 Dec 2020 16:17:38 +0700 Subject: [PATCH] Removed old classes --- cargoentity.cpp | 7 ------- cargoentity.h | 21 --------------------- deliverypointentity.cpp | 6 ------ deliverypointentity.h | 22 ---------------------- sea_transport.pro | 14 ++------------ storageentity.cpp | 8 -------- storageentity.h | 21 --------------------- userentity.cpp | 14 -------------- userentity.h | 22 ---------------------- vesselentity.cpp | 9 --------- vesselentity.h | 21 --------------------- 11 files changed, 2 insertions(+), 163 deletions(-) delete mode 100644 cargoentity.cpp delete mode 100644 cargoentity.h delete mode 100644 deliverypointentity.cpp delete mode 100644 deliverypointentity.h delete mode 100644 storageentity.cpp delete mode 100644 storageentity.h delete mode 100644 userentity.cpp delete mode 100644 userentity.h delete mode 100644 vesselentity.cpp delete mode 100644 vesselentity.h diff --git a/cargoentity.cpp b/cargoentity.cpp deleted file mode 100644 index 272e9ba..0000000 --- a/cargoentity.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "cargoentity.h" - -CargoEntity::CargoEntity(QString c_id, DeliveryPointEntity *dest) -{ - this->_cargo_id = c_id; - this->_destination = dest; -} diff --git a/cargoentity.h b/cargoentity.h deleted file mode 100644 index ae3e9be..0000000 --- a/cargoentity.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef CARGOENTITY_H -#define CARGOENTITY_H - -#include "deliverypointentity.h" - -#include - - -class DeliveryPointEntity; -class StorageEntity; -class CargoEntity -{ - QString _cargo_id; - DeliveryPointEntity *_destination; - -public: - CargoEntity(); - CargoEntity(QString _cargo_id, DeliveryPointEntity *_destination); -}; - -#endif // CARGOENTITY_H diff --git a/deliverypointentity.cpp b/deliverypointentity.cpp deleted file mode 100644 index f541f83..0000000 --- a/deliverypointentity.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "deliverypointentity.h" - -DeliveryPointEntity::DeliveryPointEntity(QString title) -{ - this->_title = title; -} diff --git a/deliverypointentity.h b/deliverypointentity.h deleted file mode 100644 index e8ab27e..0000000 --- a/deliverypointentity.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef DELIVERYPOINTENTITY_H -#define DELIVERYPOINTENTITY_H - -#include "storageentity.h" - -#include -#include - - -class CargoEntity; -class StorageEntity; -class DeliveryPointEntity -{ - QString _title; - std::vector _storage; - -public: - DeliveryPointEntity(); - DeliveryPointEntity(QString title); -}; - -#endif // DELIVERYPOINTENTITY_H diff --git a/sea_transport.pro b/sea_transport.pro index 16df44b..bcb103f 100644 --- a/sea_transport.pro +++ b/sea_transport.pro @@ -11,29 +11,19 @@ CONFIG += c++11 SOURCES += \ authwindow.cpp \ cargoeditdialog.cpp \ - cargoentity.cpp \ deliverypointeditdialog.cpp \ - deliverypointentity.cpp \ main.cpp \ storageeditdialog.cpp \ - storageentity.cpp \ usereditdialog.cpp \ - userentity.cpp \ - vesseleditdialog.cpp \ - vesselentity.cpp + vesseleditdialog.cpp HEADERS += \ authwindow.h \ cargoeditdialog.h \ - cargoentity.h \ deliverypointeditdialog.h \ - deliverypointentity.h \ storageeditdialog.h \ - storageentity.h \ usereditdialog.h \ - userentity.h \ - vesseleditdialog.h \ - vesselentity.h + vesseleditdialog.h FORMS += \ authwindow.ui \ diff --git a/storageentity.cpp b/storageentity.cpp deleted file mode 100644 index 31b70bb..0000000 --- a/storageentity.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "storageentity.h" - -StorageEntity::StorageEntity(int st_id, int mx_cap) -{ - this->_storage_id = st_id; - this->_max_capacity = mx_cap; - this->_cargo.reserve(mx_cap); -} diff --git a/storageentity.h b/storageentity.h deleted file mode 100644 index de7cbaa..0000000 --- a/storageentity.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef STORAGEENTITY_H -#define STORAGEENTITY_H - -#include "cargoentity.h" - -#include - -class DeliveryPointEntity; -class CargoEntity; -class StorageEntity -{ - int _storage_id; - int _max_capacity; - std::vector _cargo; - -public: - StorageEntity(); - StorageEntity(int st_id, int mx_cap); -}; - -#endif // STORAGEENTITY_H diff --git a/userentity.cpp b/userentity.cpp deleted file mode 100644 index 55971e9..0000000 --- a/userentity.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "userentity.h" - -UserEntity::UserEntity(QString login, QString password, UserEntity::UserRoleEnum role) -{ - this->_login = login; - - this->_password_hash = 0; - for (auto pchar : password) { - this->_password_hash += pchar.unicode(); - } - this->_password_hash %= (1 << 16); - - this->_role = role; -} diff --git a/userentity.h b/userentity.h deleted file mode 100644 index f1ec583..0000000 --- a/userentity.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef USERENTITY_H -#define USERENTITY_H - -#include - -typedef long long pwd_type; - -class UserEntity -{ - QString _login; - pwd_type _password_hash; - enum UserRoleEnum { - ADMINISTRATOR = 0, - DISPATCHER = 1, - CAPTAIN = 2 - } _role; - -public: - UserEntity(QString login, QString password, UserEntity::UserRoleEnum role); -}; - -#endif // USERENTITY_H diff --git a/vesselentity.cpp b/vesselentity.cpp deleted file mode 100644 index 14cf57d..0000000 --- a/vesselentity.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "vesselentity.h" - -VesselEntity::VesselEntity(int v_id, QString hp, int mx_cap) -{ - this->_vessel_id = v_id; - this->_home_port = hp; - this->_max_capacity = mx_cap; - this->_cargo_list.reserve(mx_cap); -} diff --git a/vesselentity.h b/vesselentity.h deleted file mode 100644 index abb8453..0000000 --- a/vesselentity.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef VESSELENTITY_H -#define VESSELENTITY_H - -#include "cargoentity.h" - -#include -#include - - -class VesselEntity -{ - int _vessel_id; - QString _home_port; - int _max_capacity; - std::vector _cargo_list; - -public: - VesselEntity(int v_id, QString hp, int mx_cap); -}; - -#endif // VESSELENTITY_H