diff --git a/8382/[8382]Verbin_Kirill/Debug/Game1.pdb b/8382/[8382]Verbin_Kirill/Debug/Game1.pdb new file mode 100644 index 000000000..f5d248f74 Binary files /dev/null and b/8382/[8382]Verbin_Kirill/Debug/Game1.pdb differ diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.Build.CppClean.log b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.Build.CppClean.log new file mode 100644 index 000000000..1b1cb53e9 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.Build.CppClean.log @@ -0,0 +1,10 @@ +c:\users\frast\source\repos\game1\debug\game1.exe +c:\users\frast\source\repos\game1\debug\game1.ilk +c:\users\frast\source\repos\game1\debug\game1.pdb +c:\users\frast\source\repos\game1\game1\debug\game1.obj.enc +c:\users\frast\source\repos\game1\game1\debug\vc142.idb +c:\users\frast\source\repos\game1\game1\debug\vc142.pdb +c:\users\frast\source\repos\game1\game1\debug\game1.tlog\cl.command.1.tlog +c:\users\frast\source\repos\game1\game1\debug\game1.tlog\link.command.1.tlog +c:\users\frast\source\repos\game1\game1\debug\game1.tlog\link.read.1.tlog +c:\users\frast\source\repos\game1\game1\debug\game1.tlog\link.write.1.tlog diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.log b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.log new file mode 100644 index 000000000..e95d75fb1 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.log @@ -0,0 +1,65 @@ + Game1.cpp +C:\Users\frast\source\repos\Game1\Game1\surse.h(7,6): error C2086: int Load::x: переопределение +C:\Users\frast\source\repos\Game1\Game1\surse.h(4): message : см. объявление "Load::x" +C:\Users\frast\source\repos\Game1\Game1\surse.h(8,6): error C2086: int Load::y: переопределение +C:\Users\frast\source\repos\Game1\Game1\surse.h(4): message : см. объявление "Load::y" +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(3,27): error C2533: Load::{ctor}: конструкторы не разрешены для возвращаемого типа +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(6,21): error C2440: =: невозможно преобразовать "int *" в "int **" +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(6,7): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(7,21): error C2440: =: невозможно преобразовать "int *" в "int **" +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(7,7): message : Типы, на которые указывают указатели, не связаны; для преобразования требуется reinterpret_cast, приведение в стиле С или приведение в стиле функции +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(8,2): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(11,8): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(11,22): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(11,36): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(14,13): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(14,27): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(14,41): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(20,8): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(20,22): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(20,36): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(23,13): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(23,27): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(23,41): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(26,13): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(32,4): error C2065: count: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(3,39): error C2248: Load::Load: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(3): message : см. объявление "Load::Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(4,10): error C2248: Load::Load: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.cpp(3): message : см. объявление "Load::Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(4,16): error C2264: Load::Load: ошибка в определении или объявлении функции; функция не вызвана +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(5,19): error C2248: Load::np: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(5): message : см. объявление "Load::np" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(5,25): error C2248: Load::tp: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(6): message : см. объявление "Load::tp" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(5,31): error C2248: Load::x: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(4): message : см. объявление "Load::x" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(5,36): error C2248: Load::y: невозможно обратиться к private член, объявленному в классе "Load" +C:\Users\frast\source\repos\Game1\Game1\surse.h(4): message : см. объявление "Load::y" +C:\Users\frast\source\repos\Game1\Game1\surse.h(3): message : см. объявление "Load" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(61,8): error C2065: att_arr: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(61,27): error C2065: B2: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(61,108): error C2065: j: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(61,111): error C2065: k: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(61,113): error C2660: Unit::Attack: функция не принимает 1 аргументов +C:\Users\frast\source\repos\Game1\Game1\unit.h(13,14): message : см. объявление "Unit::Attack" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(66,113): error C2065: k: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(66,115): error C2660: Unit::Attack: функция не принимает 1 аргументов +C:\Users\frast\source\repos\Game1\Game1\unit.h(13,14): message : см. объявление "Unit::Attack" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(74,6): error C2374: l: переопределение; множественная инициализация +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(45): message : см. объявление "l" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(90,8): error C2065: att_arr: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(90,27): error C2065: B1: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(90,108): error C2065: j: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(90,111): error C2065: k: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(90,113): error C2660: Unit::Attack: функция не принимает 1 аргументов +C:\Users\frast\source\repos\Game1\Game1\unit.h(13,14): message : см. объявление "Unit::Attack" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(94,157): error C2065: k: необъявленный идентификатор +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(94,159): error C2660: Unit::Attack: функция не принимает 1 аргументов +C:\Users\frast\source\repos\Game1\Game1\unit.h(13,14): message : см. объявление "Unit::Attack" +C:\Users\frast\source\repos\Game1\Game1\LogikScript.cpp(103,24): error C2653: GameObject: не является именем класса или пространства имен diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/CL.command.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/CL.command.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/CL.command.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/Game1.lastbuildstate b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/Game1.lastbuildstate new file mode 100644 index 000000000..c7eab669c --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/Game1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v142:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0 +Debug|Win32|C:\Users\frast\source\repos\Game1\| diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link-rc.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092-rc.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.23092.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.command.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.command.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.command.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.read.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.read.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.write.1.tlog b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.write.1.tlog new file mode 100644 index 000000000..46b134b19 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/Debug/Game1.tlog/link.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/archer.cpp b/8382/[8382]Verbin_Kirill/Game1/archer.cpp new file mode 100644 index 000000000..7744efc85 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/archer.cpp @@ -0,0 +1 @@ +#include "archer.h" \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/archer.h b/8382/[8382]Verbin_Kirill/Game1/archer.h new file mode 100644 index 000000000..f72562c1a --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/archer.h @@ -0,0 +1,13 @@ +#ifndef ARCHER +#define ARCHER +#include "unit.h" + +class Archer : public Unit { +public: + Archer() = default; + virtual void Mapping(int, int, int) = 0; + virtual int Move(int, int) = 0; + virtual int Attack(int**, int) = 0; + virtual void GetDamage(int) = 0 ; +}; +#endif \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/army.cpp b/8382/[8382]Verbin_Kirill/Game1/army.cpp new file mode 100644 index 000000000..0012f1acb --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/army.cpp @@ -0,0 +1,257 @@ +#include "army.h" + + +HeavyRider::HeavyRider() { + hp = 50; + dp = 10; +} + +int HeavyRider::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 4) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int HeavyRider::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i == 1)) { + return this->dp; + } + } + } + return 0; +} + +void HeavyRider::GetDamage(int d) { + this->hp -= d; +} + +void HeavyRider::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} + +HeavyArcher::HeavyArcher() { + hp = 30; + dp = 5; +} + +int HeavyArcher::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 2) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int HeavyArcher::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i <= 4)) { + return this->dp; + } + } + } + return 0; +} + +void HeavyArcher::GetDamage(int d) { + this->hp -= d; +} + +void HeavyArcher::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} + +HeavySaber::HeavySaber() { + hp = 40; + dp = 7; + +} + +int HeavySaber::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 2) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int HeavySaber::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i == 1)) { + return this->dp; + } + } + } + return 0; +} + +void HeavySaber::GetDamage(int d) { + this->hp -= d; +} + +void HeavySaber::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} + +LightRider::LightRider() { + hp = 35; + dp = 10; + +} + +int LightRider::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 5) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int LightRider::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i == 1)) { + return this->dp; + } + } + } + return 0; +} + +void LightRider::GetDamage(int d) { + this->hp -= d; +} + +void LightRider::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} + +LightArcher::LightArcher() { + hp = 15; + dp = 5; + +} + +int LightArcher::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 3) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int LightArcher::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i <= 5)) { + return this->dp; + } + } + } + return 0; +} + +void LightArcher::GetDamage(int d) { + this->hp -= d; +} + +void LightArcher::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} + +LightSaber::LightSaber() { + hp = 25; + dp = 7; +} + +int LightSaber::Move(int x, int y) { + if (this->x + x < 7 && this->x + x > 0 && this->y + y < 14 && this->y + y > 0) { + if (abs(x) + abs(y) <= 3) { + this->x += x; + this->y += y; + } + else { + return 0; + } + } + else { + return 0; + } + return 1; +} + +int LightSaber::Attack(int** map, int at) { + for (int i = 0; i < 7; i++) { + for (int j = 0; j < 14; j++) { + if (map[i][j] == at && (abs(this->x - i) + abs(this->y) - i == 1)) { + return this->dp; + } + } + } + return 0; +} + +void LightSaber::GetDamage(int d) { + this->hp -= d; +} + +void LightSaber::Mapping(int x, int y, int id) { + this->x = x; + this->y = y; + this->id = id; +} \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/army.h b/8382/[8382]Verbin_Kirill/Game1/army.h new file mode 100644 index 000000000..5c7d066b7 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/army.h @@ -0,0 +1,63 @@ +#ifndef ARMY +#define ARMY +#include +#include "archer.h" +#include "rider.h" +#include "saber.h" + +class HeavyRider : public Rider { +public: + HeavyRider(); + void Mapping(int, int, int); + int Move(int, int); + int Attack(int**, int); + void GetDamage(int); +}; + +class HeavyArcher : public Archer { +public: + HeavyArcher(); + void Mapping(int, int, int); + int Move(int, int) final; + int Attack(int**, int); + void GetDamage(int); +}; + +class HeavySaber : public Saber { +public: + HeavySaber(); + void Mapping(int, int, int); + int Move(int, int); + int Attack(int**, int); + void GetDamage(int); +}; + +class LightRider : public Rider { +public: + LightRider(); + void Mapping(int, int, int); + int Move(int, int); + int Attack(int**, int); + void GetDamage(int); +}; + +class LightArcher : public Archer { +public: + LightArcher(); + void Mapping(int, int, int); + int Move(int, int); + int Attack(int**, int); + void GetDamage(int); +}; + +class LightSaber : public Saber { +public: + LightSaber(); + void Mapping(int, int, int); + int Move(int, int); + int Attack(int**, int); + void GetDamage(int); +}; + +#endif + diff --git a/8382/[8382]Verbin_Kirill/Game1/base.cpp b/8382/[8382]Verbin_Kirill/Game1/base.cpp new file mode 100644 index 000000000..ea72cd99c --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/base.cpp @@ -0,0 +1,170 @@ +#include "base.h" +Base::Base(int fr) { + x = 4; + fraction = fr; + hp = 500; + id_array = new int[6]; + respawn_point = 6; + for (int i = 0; i < 6; i++) { + id_array[i] = 0; + } + if (fraction == 0) { + id = 0; + u_id = 1; + y = 0; + } + else { + id = 100; + u_id = 101; + y = 13; + } +} + +HeavyArcher* Base::CreateHeavyArcher(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + HeavyArcher* tmp = new HeavyArcher(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } +} +HeavyRider* Base::CreateHeavyRider(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + HeavyRider* tmp = new HeavyRider(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } + } + +HeavySaber* Base::CreateHeavySaber(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + HeavySaber* tmp = new HeavySaber(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } +} + +LightArcher* Base::CreateLightArcher(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + LightArcher* tmp = new LightArcher(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } +} + +LightRider* Base::CreateLightRider(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + LightRider* tmp = new LightRider(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } +} + +LightSaber* Base::CreateLightSaber(int x, int y) { + if (this->u_id - this->id < 40 && this->respawn_point > 0) { + LightSaber* tmp = new LightSaber(); + tmp->Mapping(x, y, this->u_id); + for (int i = 0; i < 6; i++) { + if (this->id_array[i] == 0) { + this->id_array[i] = tmp->id; + break; + } + } + this->u_id++; + this->respawn_point--; + return tmp; + } + else { + return NULL; + } +} + +int Base::UnitsCount() { + int count = 0; + for (int i = 0; i < 6; i++) { + if (this->id_array[i] != 0) { + count++; + } + } + return count; +} +void Base::UnitDeathControl(int* detharr) { + for (int i = 0; i < 12; i++) { + if (this->fraction == 0) { + if (detharr[i] < 100 && detharr[i] > 0) { + for (int j = 0; j < 6; j++) { + if (this->id_array[j] == detharr[i]) { + this->id_array[j] = 0; + this->respawn_point++; + } + } + } + } else { + if (detharr[i] > 100) { + for (int j = 0; j < 6; j++) { + if (this->id_array[j] == detharr[i]) { + this->id_array[j] = 0; + this->respawn_point++; + } + } + } + } + } +} +void Base::GetDamage(int d) { + this->hp -= d; +} \ No newline at end of file diff --git a/8382/[8382]Verbin_Kirill/Game1/base.h b/8382/[8382]Verbin_Kirill/Game1/base.h new file mode 100644 index 000000000..806d0a520 --- /dev/null +++ b/8382/[8382]Verbin_Kirill/Game1/base.h @@ -0,0 +1,25 @@ +#ifndef BASE +#define BASE +#include "army.cpp" + +class Base { +public: + int respawn_point; + int x, y; + int hp; + int fraction; + int* id_array; + int id, u_id; + Base(int); + HeavyArcher* CreateHeavyArcher(int, int); + HeavyRider* CreateHeavyRider(int, int); + HeavySaber* CreateHeavySaber(int, int); + LightArcher* CreateLightArcher(int, int); + LightRider* CreateLightRider(int, int); + LightSaber* CreateLightSaber(int, int); + void GetDamage(int); + int UnitsCount(); + void UnitDeathControl(int*); +}; +#endif +