From 97d3b53c7add5df47bece63078f27109e8cfecda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 14:51:45 +0400 Subject: [PATCH 01/10] test lection_1 --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 7aeb918..9fc9538 100644 --- a/src/Main.java +++ b/src/Main.java @@ -9,7 +9,7 @@ public static void main(String[] args) { for (int i = 1; i <= 5; i++) { //TIP Press to start debugging your code. We have set one breakpoint // for you, but you can always add more by pressing . - System.out.println("i test git= " + i); + System.out.println("i lection_1 = " + i); } } } \ No newline at end of file From 4ac2670a98b787b693766060b64c90837a219c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 14:53:27 +0400 Subject: [PATCH 02/10] test lection 1 branch --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 9fc9538..7ecc08d 100644 --- a/src/Main.java +++ b/src/Main.java @@ -9,7 +9,7 @@ public static void main(String[] args) { for (int i = 1; i <= 5; i++) { //TIP Press to start debugging your code. We have set one breakpoint // for you, but you can always add more by pressing . - System.out.println("i lection_1 = " + i); + System.out.println("i wow test branch = " + i); } } } \ No newline at end of file From 7a777099158df7c88b1576b286a7946517795fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 25 Sep 2024 14:54:28 +0400 Subject: [PATCH 03/10] test lection 1 branch --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 7ecc08d..c21554e 100644 --- a/src/Main.java +++ b/src/Main.java @@ -9,7 +9,7 @@ public static void main(String[] args) { for (int i = 1; i <= 5; i++) { //TIP Press to start debugging your code. We have set one breakpoint // for you, but you can always add more by pressing . - System.out.println("i wow test branch = " + i); + System.out.println("i wow test branch 2 = " + i); } } } \ No newline at end of file From 15a2a7bfd816944794444d9fadb9022ca759757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 2 Oct 2024 15:25:10 +0400 Subject: [PATCH 04/10] =?UTF-8?q?=D0=BD=D0=B0=D0=B4=D0=BE=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20gun.mod,=20smg=20=D0=B8?= =?UTF-8?q?=20=D0=B2=D0=B7=D0=B0=D0=B8=D0=BC=D0=BE=D0=B4=D0=B5=D0=B9=D1=81?= =?UTF-8?q?=D1=82=D0=B2=D0=B8=D0=B5=20=D0=BC=D0=B5=D0=B6=D0=B4=D1=83=20Pla?= =?UTF-8?q?yer=20=D0=B8=20Weapon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/uiDesigner.xml | 124 +++++++++++++++++++++++++++++++++++++++++++ src/Main.java | 21 ++++---- src/gun.java | 58 ++++++++++++++++++++ src/modificate.java | 3 ++ src/player.java | 35 ++++++++++++ src/shooting.java | 4 ++ src/smg.java | 3 ++ src/weapon.java | 37 +++++++++++++ 8 files changed, 274 insertions(+), 11 deletions(-) create mode 100644 .idea/uiDesigner.xml create mode 100644 src/gun.java create mode 100644 src/modificate.java create mode 100644 src/player.java create mode 100644 src/shooting.java create mode 100644 src/smg.java create mode 100644 src/weapon.java diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Main.java b/src/Main.java index c21554e..bff6c06 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,15 +1,14 @@ -//TIP To Run code, press or -// click the icon in the gutter. public class Main { public static void main(String[] args) { - //TIP Press with your caret at the highlighted text - // to see how IntelliJ IDEA suggests fixing it. - System.out.printf("Hello and welcome!"); - - for (int i = 1; i <= 5; i++) { - //TIP Press to start debugging your code. We have set one breakpoint - // for you, but you can always add more by pressing . - System.out.println("i wow test branch 2 = " + i); - } + // пусть у нас есть 2D игра с видом сверху, шутер. + // есть игрок и оружие + // для упрощения у нас небудет карты, а будем в тупую опрашивать объекты игроков на их положение + + + + // доделать gun.mod, smg + + // подвязать взаимодействие player и weapon + // weapon.hit, gun.shoot, } } \ No newline at end of file diff --git a/src/gun.java b/src/gun.java new file mode 100644 index 0000000..45a70d7 --- /dev/null +++ b/src/gun.java @@ -0,0 +1,58 @@ +public class gun extends weapon implements shooting, modificate{ + + private int magazineSize = 0; + private int ammo = 0; + + + gun(String name,float range){ + super(name,range); + } + + gun(String name,float range, int magazineSize){ + super(name,range); + this.magazineSize = magazineSize; + } + + public void shoot(){ + if (ammo>0){ + ammo -= 1; + System.out.println("BANG!"); + } + else { + System.out.println("Cinn..."); + } + } + + + public void reload(){ + if(this.ammo>0 & magazineSize>0) { + setAmmo(this.magazineSize); + System.out.println("reload success"); + } + else{ + System.out.println("reload fail"); + } + } + + public void mod() { + + } + + protected void setAmmo(int ammo) { + this.ammo = ammo; + } + + public int getAmmo() { + return ammo; + } + + protected void setMagazineSize(int magazineSize) { + if (magazineSize>0) { + this.magazineSize = magazineSize; + } + } + + protected int getMagazineSize() { + return magazineSize; + } +} diff --git a/src/modificate.java b/src/modificate.java new file mode 100644 index 0000000..6be6f30 --- /dev/null +++ b/src/modificate.java @@ -0,0 +1,3 @@ +public interface modificate { + public void mod(); +} diff --git a/src/player.java b/src/player.java new file mode 100644 index 0000000..8ee96ff --- /dev/null +++ b/src/player.java @@ -0,0 +1,35 @@ +public class player { + private int healthPoint = 100; + coords cord = new coords(); + + protected class coords{ + private float posY=0; + private float posX=0; + + coords(){ + this.posX = 0; + this.posY = 0; + } + coords(float x,float y){ + this.posX = x; + this.posY = y; + } + + public float getPosX() { + return posX; + } + + public void setPosX(float posX) { + this.posX = posX; + } + + public float getPosY() { + return posY; + } + + public void setPosY(float posY) { + this.posY = posY; + } + } + +} diff --git a/src/shooting.java b/src/shooting.java new file mode 100644 index 0000000..31fdb08 --- /dev/null +++ b/src/shooting.java @@ -0,0 +1,4 @@ +public interface shooting { + public void shoot(); + public void reload(); +} diff --git a/src/smg.java b/src/smg.java new file mode 100644 index 0000000..98af752 --- /dev/null +++ b/src/smg.java @@ -0,0 +1,3 @@ +public class smg { + +} diff --git a/src/weapon.java b/src/weapon.java new file mode 100644 index 0000000..dc599a7 --- /dev/null +++ b/src/weapon.java @@ -0,0 +1,37 @@ +public class weapon{ + // это класс орижия + // оно способно наносить урон игроку (player) + // и имеет радиус применения + private String name = "weapon"; + private int damage = 0; + private float range = 0; + static int id = 1; + + + + public boolean hit(){ + return false; + }; + + weapon(String name){ + this.name = name; + } + + weapon(String name,float range){ + this.name = name; + this.range =range; + } + + protected void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static int getId() { + return id; + } + +} \ No newline at end of file From 0d5946d93cf290ea5f29b1694318c59a405a9d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Thu, 3 Oct 2024 00:25:15 +0400 Subject: [PATCH 05/10] =?UTF-8?q?*=20=D0=B8=D1=80=D1=80=D0=B0=D1=80=D1=85?= =?UTF-8?q?=D0=B8=D1=8F=20weapon=20->=20gun=20->=20smg=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=83=D1=87=D0=B0=D0=B5=D1=82=D1=81=D1=8F=202=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=BC=D0=BA=D0=B0=20*=20=D0=B8=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=B0=20=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=B6=D0=B4=D1=8B=D0=B9=20=D0=B8=D0=B7=20=D0=BD=D0=B8?= =?UTF-8?q?=D1=85=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD(shooting=20=D0=B2=20gun,=20=D0=B0=20modificate=20=D0=B2?= =?UTF-8?q?=20weapon)=20*=20=D0=B0=D0=B1=D1=81=D1=82=D1=80=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20ent?= =?UTF-8?q?ity=20c=20=D0=B0=D0=B1=D1=81=D1=82=D1=80=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B5?= =?UTF-8?q?=D0=B9=20printInfo()=20*=20=D0=9A=D0=90=D0=96=D0=94=D0=AB=D0=99?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D1=81=D0=BE=D0=B4=D0=B5?= =?UTF-8?q?=D1=80=D0=B6=D0=B8=D1=82=20>2=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9?= =?UTF-8?q?=20*=20=D0=B2=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=BC=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=B5=20=D0=B5=D1=81=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=B8=D0=B7?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE=D1=80=20?= =?UTF-8?q?*=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B8=D0=BD=D0=BA=D0=B0=D0=BF=D1=81=D1=83=D0=BB=D1=8F?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D0=B2=20entity,=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=81=20coords,=20=D0=B3=D0=B4=D0=B5=20=D1=81=D0=B5?= =?UTF-8?q?=D1=82=D1=82=D0=B5=D1=80=D1=8B=20posX=20posY=20=D1=8F=D0=B2?= =?UTF-8?q?=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F=20private=20*=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=B5=20=D0=B8=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=B2=20entity,=20counter=20=D0=B8=20displayCounter()?= =?UTF-8?q?=20*=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D1=8B=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=B6=D0=B4=D0=BE=D0=BC=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81?= =?UTF-8?q?=D0=B5=20*=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D1=8B=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE=D0=B2=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D1=8E=D1=82=20=D0=BA=D0=B0=D0=BA=D1=83=D1=8E-=D1=82=D0=BE=20?= =?UTF-8?q?=D1=81=D0=BB=D0=BE=D0=B6=D0=BD=D1=83=D1=8E=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D0=B8=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Main.java | 58 ++++++++++++++++++++--- src/entity.java | 109 ++++++++++++++++++++++++++++++++++++++++++++ src/gun.java | 84 ++++++++++++++++++++++------------ src/modificate.java | 3 +- src/player.java | 86 +++++++++++++++++++++------------- src/shooting.java | 2 +- src/smg.java | 71 ++++++++++++++++++++++++++++- src/weapon.java | 69 ++++++++++++++++++++++------ 8 files changed, 398 insertions(+), 84 deletions(-) create mode 100644 src/entity.java diff --git a/src/Main.java b/src/Main.java index bff6c06..ddd4c52 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,14 +1,60 @@ public class Main { public static void main(String[] args) { - // пусть у нас есть 2D игра с видом сверху, шутер. - // есть игрок и оружие - // для упрощения у нас небудет карты, а будем в тупую опрашивать объекты игроков на их положение + /*✅ иррархия weapon -> gun -> smg получается 2 потомка + //✅ 2 интерфейса и каждый из них реализован(shooting в gun, а modificate в weapon) + //✅ абстрактный класс entity c абстрактной функцией printInfo() + //✅ КАЖДЫЙ класс содержит >2 полей + //✅ в каждом классе есть параметризированный конструктор + //✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private + //✅ статическое поле и метод в entity, counter и displayCounter() + //✅ методы в каждом классе + //✅ методы реализовывают какую-то сложную логику + */ + // у нас есть игрок и оружие + player Bob = new player("Bob"); + Bob.printInfo(); + player BigBob = new player("Big Bob", 200); + Bob.printInfo(); + // printInfo и displayInfo это по сути выполняют одно и тоже, но printInfo это унаследованный от абстрактного класса + weapon axe = new weapon("axe", 19); + axe.displayInfo(); - // доделать gun.mod, smg + gun pistol = new gun("p250", 14,10); + pistol.displayInfo(); + + smg p90 = new smg("P90",27,50,"auto"); + p90.displayInfo(); + + Bob.printInfo(); + BigBob.printInfo(); + System.out.println("Сущности созданны и получена информация о них\n"); + + Bob.attack(pistol, BigBob); + BigBob.printInfo(); + System.out.println("О нееет! Bob стреляет в BigBob'a!\n"); + + Bob.attack(axe, BigBob); + BigBob.printInfo(); + System.out.println("Ужас!!! Bob бьёт BigBob'a топором!\n"); + + if(!BigBob.getLive()){ + BigBob.setHealthPoint(200); + BigBob.setLive(true); + BigBob.printInfo(); + System.out.println("Возвращаем BigBob'a к жизни\n"); + } + else { + BigBob.printInfo(); + System.out.println(); + } + + + + Bob.attack(p90, BigBob); + BigBob.printInfo(); + System.out.println("О нееет! Bob расстреливает BigBob'a!\n"); - // подвязать взаимодействие player и weapon - // weapon.hit, gun.shoot, } } \ No newline at end of file diff --git a/src/entity.java b/src/entity.java new file mode 100644 index 0000000..1c99e71 --- /dev/null +++ b/src/entity.java @@ -0,0 +1,109 @@ + +public abstract class entity { + private String name = "Entity"; + private int healthPoint = 100; + + static int counter = 1; + private int id = counter; + entity.coords cord = new entity.coords(); + + entity() { + } + + entity(String name) { + this.name = name; + this.healthPoint = healthPoint; + } + + entity(int healthPoint) { + this.healthPoint = healthPoint; + } + + entity(String name, int healthPoint) { + this.name = name; + this.healthPoint = healthPoint; + this.healthPoint = healthPoint; + } + + entity(int posX, int posY) { + cord.setPosX(posX); + cord.setPosY(posY); + } + + entity(String name, int posX, int posY) { + this.name = name; + cord.setPosX(posX); + cord.setPosY(posY); + } + + entity(String name, int healthPoint, int posX, int posY) { + this.name = name; + this.healthPoint = healthPoint; + cord.setPosX(posX); + cord.setPosY(posY); + } + + //ИНКАПСУЛИРОВАННЫЙ класс координат + protected class coords { + private int posY; + private int posX; + + coords() { + this.posX = 0; + this.posY = 0; + } + + coords(int x, int y) { + this.posX = x; + this.posY = y; + } + public void changePos(int x,int y){ + setPosX(x); + setPosY(y); + } + public int getPosX() { + return posX; + } + + private void setPosX(int posX) { + this.posX = posX; + } + + public int getPosY() { + return posY; + } + + private void setPosY(int posY) { + this.posY = posY; + } + } + + //Абстрактная функция + public abstract void printInfo(); + + public int getId() { + return id; + } + + public static void displayCounter() { + + System.out.printf("Counter: %d \n", counter); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getHealthPoint() { + return healthPoint; + } + + protected void setHealthPoint(int healthPoint) { + this.healthPoint = healthPoint; + } + +} diff --git a/src/gun.java b/src/gun.java index 45a70d7..da70929 100644 --- a/src/gun.java +++ b/src/gun.java @@ -1,53 +1,81 @@ -public class gun extends weapon implements shooting, modificate{ - - private int magazineSize = 0; - private int ammo = 0; +public class gun extends weapon implements shooting { + private int magazineSize = 1; + private int ammo = 1; + gun(){ + super("Gun"); + } + gun(String name) { + super(name); + } - gun(String name,float range){ - super(name,range); + gun(String name, int damage) { + super(name, damage); } - gun(String name,float range, int magazineSize){ - super(name,range); + gun(String name, int damage, int magazineSize) { + super(name); + setDamage(damage); this.magazineSize = magazineSize; + this.ammo = magazineSize; } - - public void shoot(){ - if (ammo>0){ - ammo -= 1; - System.out.println("BANG!"); + @Override + public void displayInfo(){ + System.out.printf("Name: %s, Damage: %d, id: %d, MagSize:%d, Ammo: %d\n",getName(),getDamage(),getId(),getMagazineSize(),getAmmo()); + } + @Override + public int attack(player attacker, player prey) { //переопределяем функцию из класса родителя различие в выводе в else + if (((getDamage() >= prey.getHealthPoint()) & getAmmo()>0) | prey.getLive()==false) { + setAmmo(getAmmo()-1);//прозводим выстрел + prey.setLive(false); + prey.setHealthPoint(0); + System.out.printf("Player \"%s\" KILL player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); + return 1;//если убил, то возвращает 1 + } else if ((getDamage() < prey.getHealthPoint()) & getAmmo()>0){ + setAmmo(getAmmo()-1); + prey.setHealthPoint(prey.getHealthPoint() - getDamage()); + System.out.printf("Player \"%s\" SHOOT player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); + return 0;// если ранил, то 2 } else { - System.out.println("Cinn..."); + System.out.println("NoAmmo!"); + return 2; //если осечка, то 0 } } - - public void reload(){ - if(this.ammo>0 & magazineSize>0) { - setAmmo(this.magazineSize); - System.out.println("reload success"); - } - else{ - System.out.println("reload fail"); - } + @Override + public int shoot(player attacker, player prey) {//переопределяем функцию из интерфейса + return attack(attacker, prey); } - public void mod() { + @Override + public void reload() {//переопределяем функцию из интерфейса для использования protected функций + setAmmo(getMagazineSize()); + System.out.printf("%s reload!\n",getName()); + + } + public void remade(String name,int damage,int magazineSize){// переделка класса используя protected функции + setDamage(damage); + setName(name); + setMagazineSize(magazineSize); } - protected void setAmmo(int ammo) { - this.ammo = ammo; + protected void setAmmo(int ammo) {// используется только для перезарядки(reload) + if (ammo>0 & ammo<=getMagazineSize()) { + this.ammo = ammo; + } + else { + this.ammo = 0; + } } public int getAmmo() { return ammo; } - protected void setMagazineSize(int magazineSize) { - if (magazineSize>0) { + protected void setMagazineSize(int magazineSize) { // используется для remade + if (magazineSize > 0) { this.magazineSize = magazineSize; } } diff --git a/src/modificate.java b/src/modificate.java index 6be6f30..fc10946 100644 --- a/src/modificate.java +++ b/src/modificate.java @@ -1,3 +1,4 @@ public interface modificate { - public void mod(); + public void rename(String name); + public void remade(String name,int damage); } diff --git a/src/player.java b/src/player.java index 8ee96ff..a880988 100644 --- a/src/player.java +++ b/src/player.java @@ -1,35 +1,57 @@ -public class player { - private int healthPoint = 100; - coords cord = new coords(); - - protected class coords{ - private float posY=0; - private float posX=0; - - coords(){ - this.posX = 0; - this.posY = 0; - } - coords(float x,float y){ - this.posX = x; - this.posY = y; - } - - public float getPosX() { - return posX; - } - - public void setPosX(float posX) { - this.posX = posX; - } - - public float getPosY() { - return posY; - } - - public void setPosY(float posY) { - this.posY = posY; - } +public class player extends entity { + // наследуемся от абстрактного класса entity + private Boolean isLive = true; // состояние жизни у игрока + + player() { + super("Player"); + } + + player(String name) { + super(name); + } + + player(String name, int posX, int posY) { + super(name); + } + + player(String name, int healthPoint) { + super(healthPoint); + setName(name); + } + + public void setPos(int x, int y) { + cord.changePos(x,y); + } + + public int[] getPos() { + int posX = cord.getPosX(); + int posY = cord.getPosY(); + int[] arr = {posX, posY}; + System.out.printf("player \"%s\" has posX: %d | posY: %d\n", getName(), posX, posY); + return arr; + } + + protected void setHealthPoint(int healthPoint) { + super.setHealthPoint(healthPoint); + } + + @Override + public void printInfo() { // переопределяем функцию из абстрактного класса + System.out.printf("Player \"%s\", posX: %d, posY: %d, Hp: %d, is live: %s\n", getName(), cord.getPosX(), cord.getPosY(), getHealthPoint(), getLive()); + // в стоит ли дальше использовать в подобных функицях get'ры и set'ры этого же класса? Отпишите пожалуйста! + } + + public int attack(weapon wp, player prey) { + //атакуем жертву(prey) используя оружие(wp) + return wp.attack(this, prey); + } + + public Boolean getLive() { + return isLive; + } + + public void setLive(Boolean live) { + isLive = live; } } diff --git a/src/shooting.java b/src/shooting.java index 31fdb08..73e3ecd 100644 --- a/src/shooting.java +++ b/src/shooting.java @@ -1,4 +1,4 @@ public interface shooting { - public void shoot(); + public int shoot(player attacker, player prey); public void reload(); } diff --git a/src/smg.java b/src/smg.java index 98af752..b45beb4 100644 --- a/src/smg.java +++ b/src/smg.java @@ -1,3 +1,72 @@ -public class smg { +public class smg extends gun { + mode fireMode = mode.AUTO; + + enum mode { + SEMI, + AUTO + } + + smg() { + super("Smg"); + } + + smg(String name) { + super(name); + } + + smg(String name, int damage) { + super(name, damage); + } + + smg(String name, int damage, int magazineSize) { + super(name, damage, magazineSize); + } + + smg(String name, String strFireMode) { + super(name); + switch (strFireMode) { + case "semi": this.fireMode = mode.SEMI; break; + case "auto": this.fireMode = mode.AUTO; break; + } + } + + smg(String name, int damage, String strFireMode) { + super(name, damage); + switch (strFireMode) { + case "semi": this.fireMode = mode.SEMI; break; + case "auto": this.fireMode = mode.AUTO; break; + } + } + + smg(String name, int damage, int magazineSize, String strFireMode) { + super(name, damage,magazineSize); + switch (strFireMode) { + case "semi": this.fireMode = mode.SEMI; break; + case "auto": this.fireMode = mode.AUTO; break; + } + } + @Override + public void displayInfo(){ + String mode=""; + switch (fireMode) { + case SEMI: mode = "semi"; break; + case AUTO: mode = "auto"; break; + } + System.out.printf("Name: %s, Damage: %d, id: %d, MagSize:%d, Ammo: %d, Mode: %s\n",getName(),getDamage(),getId(),getMagazineSize(),getAmmo(),mode); + } + @Override + public int attack(player attacker, player prey) {//переопределяем функцию из интерфейса + switch (fireMode) { + case SEMI: return attack(attacker, prey); + case AUTO: + int temp = 0; + while (temp == 0){// стреляем пока не кончатся патроны, или не умрет цель + temp = super.attack(attacker, prey); + } + return temp; + + default: return attack(attacker, prey); + } + } } diff --git a/src/weapon.java b/src/weapon.java index dc599a7..db9ea67 100644 --- a/src/weapon.java +++ b/src/weapon.java @@ -1,25 +1,64 @@ -public class weapon{ - // это класс орижия +public class weapon implements modificate { + // это класс оружия // оно способно наносить урон игроку (player) - // и имеет радиус применения - private String name = "weapon"; - private int damage = 0; - private float range = 0; - static int id = 1; + private String name = "weapon"; + private int damage = 1; + static int counter = 1; + private int id = counter; + weapon() { + this.id = counter++; + } - public boolean hit(){ - return false; - }; + weapon(String name) { + this.id = counter++; + this.name = name; + } - weapon(String name){ + weapon(String name, int damage) { + this.id = counter++; this.name = name; + this.damage = damage; } - - weapon(String name,float range){ + public void displayInfo(){ + System.out.printf("Name: %s, Damage: %d, id: %d\n",getName(),getDamage(),getId()); + } + public static void displayCounter() { + + System.out.printf("Counter: %d \n", counter); + } + + public int attack(player attacker, player prey) { + if (getDamage() >= prey.getHealthPoint()) { + prey.setLive(false); + prey.setHealthPoint(0); + System.out.printf("Player \"%s\" KILL player \"%s\" by %d damage using \"%s\"\n", attacker.getName(), prey.getName(), getDamage(), getName()); + return 1;//если убил, то возвращает 1 + } else { + prey.setHealthPoint(prey.getHealthPoint() - getDamage());// вычитаем из нынешнего HP вычитаем урон оружия. + System.out.printf("Player \"%s\" HURT player \"%s\" by %d damage using \"%s\"\n", attacker.getName(), prey.getName(), getDamage(), getName()); + return 0;// если ранил, то 2 + } + } + + @Override + public void rename(String name) { this.name = name; - this.range =range; + } + + @Override + public void remade(String name,int damage){//переопределяем функцию из интерфейса для использования protected функций + setDamage(damage); + setName(name); + } + + public int getDamage() { + return damage; + } + + protected void setDamage(int damage) { + this.damage = damage; } protected void setName(String name) { @@ -30,7 +69,7 @@ public String getName() { return name; } - public static int getId() { + public int getId() { return id; } From cdc97ab089dccab29e8646474ab187977faa666b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 13 Nov 2024 18:48:53 +0400 Subject: [PATCH 06/10] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=83=D1=81=D1=82=D1=8B=D1=85=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D1=87=D0=B5=D0=BA=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=86=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2.=20=D0=9F=D0=BE=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20gitignore=20javado?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + doc/Main.html | 173 ++++++ doc/allclasses-index.html | 115 ++++ doc/allpackages-index.html | 63 +++ doc/element-list | 1 + doc/entity.coords.html | 208 +++++++ doc/entity.html | 249 +++++++++ doc/gun.html | 304 ++++++++++ doc/help-doc.html | 170 ++++++ doc/index-files/index-1.html | 74 +++ doc/index-files/index-10.html | 65 +++ doc/index-files/index-2.html | 68 +++ doc/index-files/index-3.html | 76 +++ doc/index-files/index-4.html | 69 +++ doc/index-files/index-5.html | 113 ++++ doc/index-files/index-6.html | 83 +++ doc/index-files/index-7.html | 72 +++ doc/index-files/index-8.html | 82 +++ doc/index-files/index-9.html | 112 ++++ doc/index.html | 26 + doc/jquery-ui.overrides.css | 35 ++ doc/legal/COPYRIGHT | 1 + doc/legal/LICENSE | 1 + doc/legal/jquery.md | 72 +++ doc/legal/jqueryUI.md | 49 ++ doc/member-search-index.js | 1 + doc/modificate.html | 153 +++++ doc/module-search-index.js | 1 + doc/overview-tree.html | 88 +++ doc/package-search-index.js | 1 + doc/package-summary.html | 130 +++++ doc/package-tree.html | 88 +++ doc/player.html | 223 ++++++++ doc/resources/glass.png | Bin 0 -> 499 bytes doc/resources/x.png | Bin 0 -> 394 bytes doc/script-dir/jquery-3.6.1.min.js | 2 + doc/script-dir/jquery-ui.min.css | 6 + doc/script-dir/jquery-ui.min.js | 6 + doc/script.js | 132 +++++ doc/search.js | 354 ++++++++++++ doc/shooting.html | 151 +++++ doc/stylesheet.css | 866 +++++++++++++++++++++++++++++ doc/tag-search-index.js | 1 + doc/type-search-index.js | 1 + doc/weapon.html | 299 ++++++++++ src/Main.java | 34 +- src/entity.java | 118 ++-- src/gun.java | 61 +- src/modificate.java | 6 + src/player.java | 74 ++- src/shooting.java | 11 + src/weapon.java | 51 +- 52 files changed, 5026 insertions(+), 114 deletions(-) create mode 100644 doc/Main.html create mode 100644 doc/allclasses-index.html create mode 100644 doc/allpackages-index.html create mode 100644 doc/element-list create mode 100644 doc/entity.coords.html create mode 100644 doc/entity.html create mode 100644 doc/gun.html create mode 100644 doc/help-doc.html create mode 100644 doc/index-files/index-1.html create mode 100644 doc/index-files/index-10.html create mode 100644 doc/index-files/index-2.html create mode 100644 doc/index-files/index-3.html create mode 100644 doc/index-files/index-4.html create mode 100644 doc/index-files/index-5.html create mode 100644 doc/index-files/index-6.html create mode 100644 doc/index-files/index-7.html create mode 100644 doc/index-files/index-8.html create mode 100644 doc/index-files/index-9.html create mode 100644 doc/index.html create mode 100644 doc/jquery-ui.overrides.css create mode 100644 doc/legal/COPYRIGHT create mode 100644 doc/legal/LICENSE create mode 100644 doc/legal/jquery.md create mode 100644 doc/legal/jqueryUI.md create mode 100644 doc/member-search-index.js create mode 100644 doc/modificate.html create mode 100644 doc/module-search-index.js create mode 100644 doc/overview-tree.html create mode 100644 doc/package-search-index.js create mode 100644 doc/package-summary.html create mode 100644 doc/package-tree.html create mode 100644 doc/player.html create mode 100644 doc/resources/glass.png create mode 100644 doc/resources/x.png create mode 100644 doc/script-dir/jquery-3.6.1.min.js create mode 100644 doc/script-dir/jquery-ui.min.css create mode 100644 doc/script-dir/jquery-ui.min.js create mode 100644 doc/script.js create mode 100644 doc/search.js create mode 100644 doc/shooting.html create mode 100644 doc/stylesheet.css create mode 100644 doc/tag-search-index.js create mode 100644 doc/type-search-index.js create mode 100644 doc/weapon.html diff --git a/.gitignore b/.gitignore index f68d109..1a3879a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ ### IntelliJ IDEA ### +.idea/ out/ !**/src/main/**/out/ !**/src/test/**/out/ diff --git a/doc/Main.html b/doc/Main.html new file mode 100644 index 0000000..ef0c38c --- /dev/null +++ b/doc/Main.html @@ -0,0 +1,173 @@ + + + + +Main + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Class Main

+
+ +
+
+
public class Main +extends Object
+
Класс Main, который использует функции классов в проекте для демонстрации выполненного задания.
+ ✅ иррархия weapon -> gun -> smg получается 2 потомка
+ ✅ 2 интерфейса и каждый из них реализован(из shooting в gun, а из modificate в weapon)
+ ✅ абстрактный класс entity c абстрактной функцией printInfo()
+ ✅ КАЖДЫЙ класс содержит >2 полей
+ ✅ в каждом классе есть параметризированный конструктор
+ ✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private
+ ✅ статическое поле и метод в entity, counter и displayCounter()
+ ✅ методы в каждом классе
+ ✅ методы реализовывают какую-то сложную логику
+
+
+
    + +
  • +
    +

    Constructor Summary

    +
    Constructors
    +
    +
    Constructor
    +
    Description
    + +
     
    +
    +
    +
  • + +
  • +
    +

    Method Summary

    +
    +
    +
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    static void
    +
    main(String[] args)
    +
    +
    Это основной метод, использующий методы классов.
    +
    +
    +
    +
    +
    +

    Methods inherited from class java.lang.Object

    +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +
    +
  • +
+
+
+
    + +
  • +
    +

    Constructor Details

    +
      +
    • +
      +

      Main

      +
      public Main()
      +
      +
    • +
    +
    +
  • + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      main

      +
      public static void main(String[] args)
      +
      Это основной метод, использующий методы классов.
      +
      +
      Parameters:
      +
      args - Не используется.
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/allclasses-index.html b/doc/allclasses-index.html new file mode 100644 index 0000000..f0afae1 --- /dev/null +++ b/doc/allclasses-index.html @@ -0,0 +1,115 @@ + + + + +All Classes and Interfaces + + + + + + + + + + + + + + + +
+ +
+
+
+

All Classes and Interfaces

+
+
+
+
+
+
Class
+
Description
+ +
+
Класс Сущность + это класс родитель класса player
+
+ +
+
Класс огнестрельного оружия + добавляется размер магазина
+
+ +
+
Класс Main, который использует функции классов в проекте для демонстрации выполненного задания.
+ ✅ иррархия weapon -> gun -> smg получается 2 потомка
+ ✅ 2 интерфейса и каждый из них реализован(из shooting в gun, а из modificate в weapon)
+ ✅ абстрактный класс entity c абстрактной функцией printInfo()
+ ✅ КАЖДЫЙ класс содержит >2 полей
+ ✅ в каждом классе есть параметризированный конструктор
+ ✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private
+ ✅ статическое поле и метод в entity, counter и displayCounter()
+ ✅ методы в каждом классе
+ ✅ методы реализовывают какую-то сложную логику
+
+ +
+
Интерфейс для модификации класса оружия
+
+ +
+
Класс Игрок, является наследником класса entity +
+ Может использовать оружие
+
+ +
+
Интерфейс для взаимодействия с огнестрельным оружием
+
+ +
+
Класс пистолета пулемета
+
+ +
+
Класс оружия
+ Имеет методы нанесения урона и убийства объектов класса player
+
+
+
+
+
+
+
+ + diff --git a/doc/allpackages-index.html b/doc/allpackages-index.html new file mode 100644 index 0000000..f6ed426 --- /dev/null +++ b/doc/allpackages-index.html @@ -0,0 +1,63 @@ + + + + +All Packages + + + + + + + + + + + + + + + +
+ +
+
+
+

All Packages

+
+
Package Summary
+
+
Package
+
Description
+ +
 
+
+
+
+
+ + diff --git a/doc/element-list b/doc/element-list new file mode 100644 index 0000000..147af06 --- /dev/null +++ b/doc/element-list @@ -0,0 +1 @@ +unnamed package diff --git a/doc/entity.coords.html b/doc/entity.coords.html new file mode 100644 index 0000000..4313ef8 --- /dev/null +++ b/doc/entity.coords.html @@ -0,0 +1,208 @@ + + + + +entity.coords + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Class entity.coords

+
+
java.lang.Object +
entity.coords
+
+
+
+
Enclosing class:
+
entity
+
+
+
protected class entity.coords +extends Object
+
Инкапсулированный класс координат для определения расположения сущности в 2D пространстве.
+
+
+ +
+
+
    + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      changePos

      +
      public void changePos(int x, + int y)
      +
      Изменение координат
      +
      +
      Parameters:
      +
      x - ось X
      +
      y - ось Y
      +
      +
      +
    • +
    • +
      +

      getPosX

      +
      public int getPosX()
      +
      Гетер оси X
      +
      +
      Returns:
      +
      ось X
      +
      +
      +
    • +
    • +
      +

      setPosX

      +
      public void setPosX(int posX)
      +
      Сетер оси X
      +
      +
      Parameters:
      +
      posX - ось X
      +
      +
      +
    • +
    • +
      +

      getPosY

      +
      public int getPosY()
      +
      Гетер оси Y
      +
      +
      Returns:
      +
      ось Y
      +
      +
      +
    • +
    • +
      +

      setPosY

      +
      public void setPosY(int posY)
      +
      Сетер оси Y
      +
      +
      Parameters:
      +
      posY - ось Y
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/entity.html b/doc/entity.html new file mode 100644 index 0000000..cd56ea4 --- /dev/null +++ b/doc/entity.html @@ -0,0 +1,249 @@ + + + + +entity + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Class entity

+
+ +
+
+
Direct Known Subclasses:
+
player
+
+
+
public abstract class entity +extends Object
+
Класс Сущность + это класс родитель класса player
+
+
+
    + +
  • +
    +

    Nested Class Summary

    +
    Nested Classes
    +
    +
    Modifier and Type
    +
    Class
    +
    Description
    +
    protected class 
    + +
    +
    Инкапсулированный класс координат для определения расположения сущности в 2D пространстве.
    +
    +
    +
    +
  • + +
  • +
    +

    Method Summary

    +
    +
    +
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    static void
    + +
    +
    Статический метод отображения счетчика
    +
    +
    int
    + +
    +
    Гетер здоровья
    +
    +
    int
    + +
    +
    Гетер ID
    +
    + + +
    +
    Гетер имени
    +
    +
    abstract void
    + +
    +
    Абстактная функция, для вывода информации о классе.
    +
    +
    protected void
    +
    setHealthPoint(int healthPoint)
    +
    +
    Сетер кол-ва здоровья.
    + Protected для внутреннего использования
    +
    +
    void
    + +
    +
    Сетер имени
    +
    +
    +
    +
    +
    +

    Methods inherited from class java.lang.Object

    +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    +
    +
  • +
+
+
+
    + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      printInfo

      +
      public abstract void printInfo()
      +
      Абстактная функция, для вывода информации о классе.
      +
      +
    • +
    • +
      +

      getId

      +
      public int getId()
      +
      Гетер ID
      +
      +
      Returns:
      +
      id
      +
      +
      +
    • +
    • +
      +

      displayCounter

      +
      public static void displayCounter()
      +
      Статический метод отображения счетчика
      +
      +
    • +
    • +
      +

      getName

      +
      public String getName()
      +
      Гетер имени
      +
      +
      Returns:
      +
      имя
      +
      +
      +
    • +
    • +
      +

      setName

      +
      public void setName(String name)
      +
      Сетер имени
      +
      +
      Parameters:
      +
      name - имя
      +
      +
      +
    • +
    • +
      +

      getHealthPoint

      +
      public int getHealthPoint()
      +
      Гетер здоровья
      +
      +
      Returns:
      +
      кол-во здоровья
      +
      +
      +
    • +
    • +
      +

      setHealthPoint

      +
      protected void setHealthPoint(int healthPoint)
      +
      Сетер кол-ва здоровья.
      + Protected для внутреннего использования
      +
      +
      Parameters:
      +
      healthPoint - кол-во здоровья
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/gun.html b/doc/gun.html new file mode 100644 index 0000000..23c740c --- /dev/null +++ b/doc/gun.html @@ -0,0 +1,304 @@ + + + + +gun + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Class gun

+
+ +
+
+
All Implemented Interfaces:
+
modificate, shooting
+
+
+
Direct Known Subclasses:
+
smg
+
+
+
public class gun +extends weapon +implements shooting
+
Класс огнестрельного оружия + добавляется размер магазина
+
+
+ +
+
+
    + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      displayInfo

      +
      public void displayInfo()
      +
      Description copied from class: weapon
      +
      Вывод информации о классе
      +
      +
      Overrides:
      +
      displayInfo in class weapon
      +
      +
      +
    • +
    • +
      +

      attack

      +
      public int attack(player attacker, + player prey)
      +
      Description copied from class: weapon
      +
      Атака игрока оружием
      +
      +
      Overrides:
      +
      attack in class weapon
      +
      Parameters:
      +
      attacker - класс Player атакующий
      +
      prey - класс Player жертва
      +
      Returns:
      +
      "1" если убил или "0" если ранил
      +
      +
      +
    • +
    • +
      +

      shoot

      +
      public int shoot(player attacker, + player prey)
      +
      Description copied from interface: shooting
      +
      Выстрел
      +
      +
      Specified by:
      +
      shoot in interface shooting
      +
      Parameters:
      +
      attacker - атакующий
      +
      prey - жертва
      +
      Returns:
      +
      состояние попадания
      +
      +
      +
    • +
    • +
      +

      reload

      +
      public void reload()
      +
      Description copied from interface: shooting
      +
      перезарядка
      +
      +
      Specified by:
      +
      reload in interface shooting
      +
      +
      +
    • +
    • +
      +

      remade

      +
      public void remade(String name, + int damage, + int magazineSize)
      +
      Переделка объекта
      +
      +
      Parameters:
      +
      name - имя
      +
      damage - урон
      +
      magazineSize - размер магазина
      +
      +
      +
    • +
    • +
      +

      setAmmo

      +
      protected void setAmmo(int ammo)
      +
      Сетер патронов, используется для метода reload
      +
      +
      Parameters:
      +
      ammo - кол-во патронов
      +
      +
      +
    • +
    • +
      +

      getAmmo

      +
      public int getAmmo()
      +
      Гетер патронов
      +
      +
      Returns:
      +
      количество патронов
      +
      +
      +
    • +
    • +
      +

      setMagazineSize

      +
      protected void setMagazineSize(int magazineSize)
      +
      Сетер размера магаина, используется в методе remade
      +
      +
      Parameters:
      +
      magazineSize - размер магазина
      +
      +
      +
    • +
    • +
      +

      getMagazineSize

      +
      public int getMagazineSize()
      +
      Гетер размера магазина
      +
      +
      Returns:
      +
      размер магазина
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/help-doc.html b/doc/help-doc.html new file mode 100644 index 0000000..4149a38 --- /dev/null +++ b/doc/help-doc.html @@ -0,0 +1,170 @@ + + + + +API Help + + + + + + + + + + + + + + + +
+ +
+
+

JavaDoc Help

+ +
+
+

Navigation

+Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces + +
+
+
+

Kinds of Pages

+The following sections describe the different kinds of pages in this collection. +
+

Package

+

Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:

+
    +
  • Interfaces
  • +
  • Classes
  • +
  • Enum Classes
  • +
  • Exceptions
  • +
  • Errors
  • +
  • Annotation Interfaces
  • +
+
+
+

Class or Interface

+

Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.

+
    +
  • Class Inheritance Diagram
  • +
  • Direct Subclasses
  • +
  • All Known Subinterfaces
  • +
  • All Known Implementing Classes
  • +
  • Class or Interface Declaration
  • +
  • Class or Interface Description
  • +
+
+
    +
  • Nested Class Summary
  • +
  • Enum Constant Summary
  • +
  • Field Summary
  • +
  • Property Summary
  • +
  • Constructor Summary
  • +
  • Method Summary
  • +
  • Required Element Summary
  • +
  • Optional Element Summary
  • +
+
+
    +
  • Enum Constant Details
  • +
  • Field Details
  • +
  • Property Details
  • +
  • Constructor Details
  • +
  • Method Details
  • +
  • Element Details
  • +
+

Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.

+

The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

+
+
+

Other Files

+

Packages and modules may contain pages with additional information related to the declarations nearby.

+
+
+

Tree (Class Hierarchy)

+

There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

+
    +
  • When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
  • +
  • When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
  • +
+
+
+

All Packages

+

The All Packages page contains an alphabetic index of all packages contained in the documentation.

+
+
+

All Classes and Interfaces

+

The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.

+
+
+

Index

+

The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.

+
+
+
+This help file applies to API documentation generated by the standard doclet.
+
+
+ + diff --git a/doc/index-files/index-1.html b/doc/index-files/index-1.html new file mode 100644 index 0000000..6f8045b --- /dev/null +++ b/doc/index-files/index-1.html @@ -0,0 +1,74 @@ + + + + +A-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

A

+
+
attack(player, player) - Method in class gun
+
 
+
attack(player, player) - Method in class smg
+
+
Атака
+
+
attack(player, player) - Method in class weapon
+
+
Атака игрока оружием
+
+
attack(weapon, player) - Method in class player
+
+
Атака оружием
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-10.html b/doc/index-files/index-10.html new file mode 100644 index 0000000..b8a4dde --- /dev/null +++ b/doc/index-files/index-10.html @@ -0,0 +1,65 @@ + + + + +W-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

W

+
+
weapon - Class in Unnamed Package
+
+
Класс оружия
+ Имеет методы нанесения урона и убийства объектов класса player
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-2.html b/doc/index-files/index-2.html new file mode 100644 index 0000000..6dab6a2 --- /dev/null +++ b/doc/index-files/index-2.html @@ -0,0 +1,68 @@ + + + + +C-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

C

+
+
ChangeFireMode(String) - Method in class smg
+
+
Смена режима стрельбы
+
+
changePos(int, int) - Method in class entity.coords
+
+
Изменение координат
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-3.html b/doc/index-files/index-3.html new file mode 100644 index 0000000..dafb51a --- /dev/null +++ b/doc/index-files/index-3.html @@ -0,0 +1,76 @@ + + + + +D-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

D

+
+
displayCounter() - Static method in class entity
+
+
Статический метод отображения счетчика
+
+
displayCounter() - Static method in class weapon
+
+
Выводит состояние счетчика
+
+
displayInfo() - Method in class gun
+
 
+
displayInfo() - Method in class smg
+
 
+
displayInfo() - Method in class weapon
+
+
Вывод информации о классе
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-4.html b/doc/index-files/index-4.html new file mode 100644 index 0000000..1c3a9e9 --- /dev/null +++ b/doc/index-files/index-4.html @@ -0,0 +1,69 @@ + + + + +E-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

E

+
+
entity - Class in Unnamed Package
+
+
Класс Сущность + это класс родитель класса player
+
+
entity.coords - Class in Unnamed Package
+
+
Инкапсулированный класс координат для определения расположения сущности в 2D пространстве.
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-5.html b/doc/index-files/index-5.html new file mode 100644 index 0000000..e4fe987 --- /dev/null +++ b/doc/index-files/index-5.html @@ -0,0 +1,113 @@ + + + + +G-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

G

+
+
getAmmo() - Method in class gun
+
+
Гетер патронов
+
+
getDamage() - Method in class weapon
+
+
Гетер урона
+
+
getHealthPoint() - Method in class entity
+
+
Гетер здоровья
+
+
getId() - Method in class entity
+
+
Гетер ID
+
+
getId() - Method in class weapon
+
+
Гетер ID
+
+
getLive() - Method in class player
+
+
Гетер состояния здоровья
+
+
getMagazineSize() - Method in class gun
+
+
Гетер размера магазина
+
+
getName() - Method in class entity
+
+
Гетер имени
+
+
getName() - Method in class weapon
+
+
Гетер имени
+
+
getPos() - Method in class player
+
+
Гетер позиции
+
+
getPosX() - Method in class entity.coords
+
+
Гетер оси X
+
+
getPosY() - Method in class entity.coords
+
+
Гетер оси Y
+
+
gun - Class in Unnamed Package
+
+
Класс огнестрельного оружия + добавляется размер магазина
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-6.html b/doc/index-files/index-6.html new file mode 100644 index 0000000..bbdee83 --- /dev/null +++ b/doc/index-files/index-6.html @@ -0,0 +1,83 @@ + + + + +M-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

M

+
+
main(String[]) - Static method in class Main
+
+
Это основной метод, использующий методы классов.
+
+
Main - Class in Unnamed Package
+
+
Класс Main, который использует функции классов в проекте для демонстрации выполненного задания.
+ ✅ иррархия weapon -> gun -> smg получается 2 потомка
+ ✅ 2 интерфейса и каждый из них реализован(из shooting в gun, а из modificate в weapon)
+ ✅ абстрактный класс entity c абстрактной функцией printInfo()
+ ✅ КАЖДЫЙ класс содержит >2 полей
+ ✅ в каждом классе есть параметризированный конструктор
+ ✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private
+ ✅ статическое поле и метод в entity, counter и displayCounter()
+ ✅ методы в каждом классе
+ ✅ методы реализовывают какую-то сложную логику
+
+
Main() - Constructor for class Main
+
 
+
modificate - Interface in Unnamed Package
+
+
Интерфейс для модификации класса оружия
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-7.html b/doc/index-files/index-7.html new file mode 100644 index 0000000..1bb1bdc --- /dev/null +++ b/doc/index-files/index-7.html @@ -0,0 +1,72 @@ + + + + +P-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

P

+
+
player - Class in Unnamed Package
+
+
Класс Игрок, является наследником класса entity +
+ Может использовать оружие
+
+
printInfo() - Method in class entity
+
+
Абстактная функция, для вывода информации о классе.
+
+
printInfo() - Method in class player
+
 
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-8.html b/doc/index-files/index-8.html new file mode 100644 index 0000000..4065782 --- /dev/null +++ b/doc/index-files/index-8.html @@ -0,0 +1,82 @@ + + + + +R-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

R

+
+
reload() - Method in class gun
+
 
+
reload() - Method in interface shooting
+
+
перезарядка
+
+
remade(String, int) - Method in interface modificate
+
+
Переделка объекта
+
+
remade(String, int) - Method in class weapon
+
 
+
remade(String, int, int) - Method in class gun
+
+
Переделка объекта
+
+
rename(String) - Method in interface modificate
+
+
Переименовывание объекта
+
+
rename(String) - Method in class weapon
+
 
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index-files/index-9.html b/doc/index-files/index-9.html new file mode 100644 index 0000000..0b86141 --- /dev/null +++ b/doc/index-files/index-9.html @@ -0,0 +1,112 @@ + + + + +S-Index + + + + + + + + + + + + + + + +
+ +
+
+
+

Index

+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages +

S

+
+
setAmmo(int) - Method in class gun
+
+
Сетер патронов, используется для метода reload
+
+
setDamage(int) - Method in class weapon
+
+
Сетер урона
+ Защищенный, для использования в функции attack
+
+
setHealthPoint(int) - Method in class entity
+
+
Сетер кол-ва здоровья.
+ Protected для внутреннего использования
+
+
setLive(Boolean) - Method in class player
+
+
Сетер состояния здоровья
+
+
setMagazineSize(int) - Method in class gun
+
+
Сетер размера магаина, используется в методе remade
+
+
setName(String) - Method in class entity
+
+
Сетер имени
+
+
setName(String) - Method in class weapon
+
+
Сетер имени
+
+
setPosX(int) - Method in class entity.coords
+
+
Сетер оси X
+
+
setPosY(int) - Method in class entity.coords
+
+
Сетер оси Y
+
+
shoot(player, player) - Method in class gun
+
 
+
shoot(player, player) - Method in interface shooting
+
+
Выстрел
+
+
shooting - Interface in Unnamed Package
+
+
Интерфейс для взаимодействия с огнестрельным оружием
+
+
smg - Class in Unnamed Package
+
+
Класс пистолета пулемета
+
+
+A C D E G M P R S W 
All Classes and Interfaces|All Packages
+
+
+ + diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..93ad0d1 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,26 @@ + + + + +Generated Documentation (Untitled) + + + + + + + + + + + +
+ +

entity.html

+
+ + diff --git a/doc/jquery-ui.overrides.css b/doc/jquery-ui.overrides.css new file mode 100644 index 0000000..03c010b --- /dev/null +++ b/doc/jquery-ui.overrides.css @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + /* Overrides the color of selection used in jQuery UI */ + background: #F8981D; + border: 1px solid #F8981D; +} diff --git a/doc/legal/COPYRIGHT b/doc/legal/COPYRIGHT new file mode 100644 index 0000000..ca74fff --- /dev/null +++ b/doc/legal/COPYRIGHT @@ -0,0 +1 @@ +Please see ..\java.base\COPYRIGHT diff --git a/doc/legal/LICENSE b/doc/legal/LICENSE new file mode 100644 index 0000000..4ad9fe4 --- /dev/null +++ b/doc/legal/LICENSE @@ -0,0 +1 @@ +Please see ..\java.base\LICENSE diff --git a/doc/legal/jquery.md b/doc/legal/jquery.md new file mode 100644 index 0000000..d468b31 --- /dev/null +++ b/doc/legal/jquery.md @@ -0,0 +1,72 @@ +## jQuery v3.6.1 + +### jQuery License +``` +jQuery v 3.6.1 +Copyright OpenJS Foundation and other contributors, https://openjsf.org/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +****************************************** + +The jQuery JavaScript Library v3.6.1 also includes Sizzle.js + +Sizzle.js includes the following license: + +Copyright JS Foundation and other contributors, https://js.foundation/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/sizzle + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. + +********************* + +``` diff --git a/doc/legal/jqueryUI.md b/doc/legal/jqueryUI.md new file mode 100644 index 0000000..8bda9d7 --- /dev/null +++ b/doc/legal/jqueryUI.md @@ -0,0 +1,49 @@ +## jQuery UI v1.13.2 + +### jQuery UI License +``` +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery-ui + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code contained within the demos directory. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. + +``` diff --git a/doc/member-search-index.js b/doc/member-search-index.js new file mode 100644 index 0000000..7b2f22a --- /dev/null +++ b/doc/member-search-index.js @@ -0,0 +1 @@ +memberSearchIndex = [{"p":"","c":"gun","l":"attack(player, player)","u":"attack(player,player)"},{"p":"","c":"smg","l":"attack(player, player)","u":"attack(player,player)"},{"p":"","c":"weapon","l":"attack(player, player)","u":"attack(player,player)"},{"p":"","c":"player","l":"attack(weapon, player)","u":"attack(weapon,player)"},{"p":"","c":"smg","l":"ChangeFireMode(String)","u":"ChangeFireMode(java.lang.String)"},{"p":"","c":"entity.coords","l":"changePos(int, int)","u":"changePos(int,int)"},{"p":"","c":"entity","l":"displayCounter()"},{"p":"","c":"weapon","l":"displayCounter()"},{"p":"","c":"gun","l":"displayInfo()"},{"p":"","c":"smg","l":"displayInfo()"},{"p":"","c":"weapon","l":"displayInfo()"},{"p":"","c":"gun","l":"getAmmo()"},{"p":"","c":"weapon","l":"getDamage()"},{"p":"","c":"entity","l":"getHealthPoint()"},{"p":"","c":"entity","l":"getId()"},{"p":"","c":"weapon","l":"getId()"},{"p":"","c":"player","l":"getLive()"},{"p":"","c":"gun","l":"getMagazineSize()"},{"p":"","c":"entity","l":"getName()"},{"p":"","c":"weapon","l":"getName()"},{"p":"","c":"player","l":"getPos()"},{"p":"","c":"entity.coords","l":"getPosX()"},{"p":"","c":"entity.coords","l":"getPosY()"},{"p":"","c":"Main","l":"Main()","u":"%3Cinit%3E()"},{"p":"","c":"Main","l":"main(String[])","u":"main(java.lang.String[])"},{"p":"","c":"entity","l":"printInfo()"},{"p":"","c":"player","l":"printInfo()"},{"p":"","c":"gun","l":"reload()"},{"p":"","c":"shooting","l":"reload()"},{"p":"","c":"modificate","l":"remade(String, int)","u":"remade(java.lang.String,int)"},{"p":"","c":"weapon","l":"remade(String, int)","u":"remade(java.lang.String,int)"},{"p":"","c":"gun","l":"remade(String, int, int)","u":"remade(java.lang.String,int,int)"},{"p":"","c":"modificate","l":"rename(String)","u":"rename(java.lang.String)"},{"p":"","c":"weapon","l":"rename(String)","u":"rename(java.lang.String)"},{"p":"","c":"gun","l":"setAmmo(int)"},{"p":"","c":"weapon","l":"setDamage(int)"},{"p":"","c":"entity","l":"setHealthPoint(int)"},{"p":"","c":"player","l":"setLive(Boolean)","u":"setLive(java.lang.Boolean)"},{"p":"","c":"gun","l":"setMagazineSize(int)"},{"p":"","c":"entity","l":"setName(String)","u":"setName(java.lang.String)"},{"p":"","c":"weapon","l":"setName(String)","u":"setName(java.lang.String)"},{"p":"","c":"entity.coords","l":"setPosX(int)"},{"p":"","c":"entity.coords","l":"setPosY(int)"},{"p":"","c":"gun","l":"shoot(player, player)","u":"shoot(player,player)"},{"p":"","c":"shooting","l":"shoot(player, player)","u":"shoot(player,player)"}];updateSearchResults(); \ No newline at end of file diff --git a/doc/modificate.html b/doc/modificate.html new file mode 100644 index 0000000..2ca9e26 --- /dev/null +++ b/doc/modificate.html @@ -0,0 +1,153 @@ + + + + +modificate + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Interface modificate

+
+
+
+
All Known Implementing Classes:
+
gun, smg, weapon
+
+
+
public interface modificate
+
Интерфейс для модификации класса оружия
+
+
+
    + +
  • +
    +

    Method Summary

    +
    +
    +
    +
    +
    Modifier and Type
    +
    Method
    +
    Description
    +
    void
    +
    remade(String name, + int damage)
    +
    +
    Переделка объекта
    +
    +
    void
    +
    rename(String name)
    +
    +
    Переименовывание объекта
    +
    +
    +
    +
    +
    +
  • +
+
+
+
    + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      rename

      +
      void rename(String name)
      +
      Переименовывание объекта
      +
      +
      Parameters:
      +
      name - имя
      +
      +
      +
    • +
    • +
      +

      remade

      +
      void remade(String name, + int damage)
      +
      Переделка объекта
      +
      +
      Parameters:
      +
      name - имя
      +
      damage - урона
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/module-search-index.js b/doc/module-search-index.js new file mode 100644 index 0000000..0d59754 --- /dev/null +++ b/doc/module-search-index.js @@ -0,0 +1 @@ +moduleSearchIndex = [];updateSearchResults(); \ No newline at end of file diff --git a/doc/overview-tree.html b/doc/overview-tree.html new file mode 100644 index 0000000..dd0825c --- /dev/null +++ b/doc/overview-tree.html @@ -0,0 +1,88 @@ + + + + +Class Hierarchy + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For All Packages

+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+
+
+ + diff --git a/doc/package-search-index.js b/doc/package-search-index.js new file mode 100644 index 0000000..747229e --- /dev/null +++ b/doc/package-search-index.js @@ -0,0 +1 @@ +packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"}];updateSearchResults(); \ No newline at end of file diff --git a/doc/package-summary.html b/doc/package-summary.html new file mode 100644 index 0000000..aca6392 --- /dev/null +++ b/doc/package-summary.html @@ -0,0 +1,130 @@ + + + + +Unnamed Package + + + + + + + + + + + + + + + +
+ +
+
+
+

Unnamed Package

+
+
+
+
    +
  • +
    +
    +
    +
    +
    Class
    +
    Description
    + +
    +
    Класс Сущность + это класс родитель класса player
    +
    + +
    +
    Класс огнестрельного оружия + добавляется размер магазина
    +
    + +
    +
    Класс Main, который использует функции классов в проекте для демонстрации выполненного задания.
    + ✅ иррархия weapon -> gun -> smg получается 2 потомка
    + ✅ 2 интерфейса и каждый из них реализован(из shooting в gun, а из modificate в weapon)
    + ✅ абстрактный класс entity c абстрактной функцией printInfo()
    + ✅ КАЖДЫЙ класс содержит >2 полей
    + ✅ в каждом классе есть параметризированный конструктор
    + ✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private
    + ✅ статическое поле и метод в entity, counter и displayCounter()
    + ✅ методы в каждом классе
    + ✅ методы реализовывают какую-то сложную логику
    +
    + +
    +
    Интерфейс для модификации класса оружия
    +
    + +
    +
    Класс Игрок, является наследником класса entity +
    + Может использовать оружие
    +
    + +
    +
    Интерфейс для взаимодействия с огнестрельным оружием
    +
    + +
    +
    Класс пистолета пулемета
    +
    + +
    +
    Класс оружия
    + Имеет методы нанесения урона и убийства объектов класса player
    +
    +
    +
    +
    +
  • +
+
+
+
+
+ + diff --git a/doc/package-tree.html b/doc/package-tree.html new file mode 100644 index 0000000..16de4e3 --- /dev/null +++ b/doc/package-tree.html @@ -0,0 +1,88 @@ + + + + + Class Hierarchy + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Unnamed Package

+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+
+
+ + diff --git a/doc/player.html b/doc/player.html new file mode 100644 index 0000000..1b84ad3 --- /dev/null +++ b/doc/player.html @@ -0,0 +1,223 @@ + + + + +player + + + + + + + + + + + + + + + +
+ +
+
+ +
+

Class player

+
+ +
+
+
public class player +extends entity
+
Класс Игрок, является наследником класса entity +
+ Может использовать оружие
+
+
+ +
+
+
    + +
  • +
    +

    Method Details

    +
      +
    • +
      +

      getPos

      +
      public int[] getPos()
      +
      Гетер позиции
      +
      +
      Returns:
      +
      [posX, poxY]
      +
      +
      +
    • +
    • +
      +

      printInfo

      +
      public void printInfo()
      +
      Description copied from class: entity
      +
      Абстактная функция, для вывода информации о классе.
      +
      +
      Specified by:
      +
      printInfo in class entity
      +
      +
      +
    • +
    • +
      +

      attack

      +
      public int attack(weapon wp, + player prey)
      +
      Атака оружием
      +
      +
      Parameters:
      +
      wp - класс weapon оружие
      +
      prey - класс player жертва
      +
      Returns:
      +
      состояние атаки
      +
      +
      +
    • +
    • +
      +

      getLive

      +
      public Boolean getLive()
      +
      Гетер состояния здоровья
      +
      +
      Returns:
      +
      boolean статус здоровья
      +
      +
      +
    • +
    • +
      +

      setLive

      +
      public void setLive(Boolean live)
      +
      Сетер состояния здоровья
      +
      +
      Parameters:
      +
      live - состояние жизни
      +
      +
      +
    • +
    +
    +
  • +
+
+ +
+
+
+ + diff --git a/doc/resources/glass.png b/doc/resources/glass.png new file mode 100644 index 0000000000000000000000000000000000000000..a7f591f467a1c0c949bbc510156a0c1afb860a6e GIT binary patch literal 499 zcmVJoRsvExf%rEN>jUL}qZ_~k#FbE+Q;{`;0FZwVNX2n-^JoI; zP;4#$8DIy*Yk-P>VN(DUKmPse7mx+ExD4O|;?E5D0Z5($mjO3`*anwQU^s{ZDK#Lz zj>~{qyaIx5K!t%=G&2IJNzg!ChRpyLkO7}Ry!QaotAHAMpbB3AF(}|_f!G-oI|uK6 z`id_dumai5K%C3Y$;tKS_iqMPHg<*|-@e`liWLAggVM!zAP#@l;=c>S03;{#04Z~5 zN_+ss=Yg6*hTr59mzMwZ@+l~q!+?ft!fF66AXT#wWavHt30bZWFCK%!BNk}LN?0Hg z1VF_nfs`Lm^DjYZ1(1uD0u4CSIr)XAaqW6IT{!St5~1{i=i}zAy76p%_|w8rh@@c0Axr!ns=D-X+|*sY6!@wacG9%)Qn*O zl0sa739kT-&_?#oVxXF6tOnqTD)cZ}2vi$`ZU8RLAlo8=_z#*P3xI~i!lEh+Pdu-L zx{d*wgjtXbnGX_Yf@Tc7Q3YhLhPvc8noGJs2DA~1DySiA&6V{5JzFt ojAY1KXm~va;tU{v7C?Xj0BHw!K;2aXV*mgE07*qoM6N<$f;4TDA^-pY literal 0 HcmV?d00001 diff --git a/doc/script-dir/jquery-3.6.1.min.js b/doc/script-dir/jquery-3.6.1.min.js new file mode 100644 index 0000000..2c69bc9 --- /dev/null +++ b/doc/script-dir/jquery-3.6.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=x.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthC(E(s),E(n))?o.important="horizontal":o.important="vertical",c.using.call(this,t,o)}),l.offset(x.extend(u,{using:t}))})},x.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,l=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=x(t.target),i=x(x.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){x.contains(this.element[0],x.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=x(t.target).closest(".ui-menu-item"),i=x(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=x(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case x.ui.keyCode.PAGE_UP:this.previousPage(t);break;case x.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case x.ui.keyCode.HOME:this._move("first","first",t);break;case x.ui.keyCode.END:this._move("last","last",t);break;case x.ui.keyCode.UP:this.previous(t);break;case x.ui.keyCode.DOWN:this.next(t);break;case x.ui.keyCode.LEFT:this.collapse(t);break;case x.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case x.ui.keyCode.ENTER:case x.ui.keyCode.SPACE:this._activate(t);break;case x.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=x(this),e=t.prev(),i=x("").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=x(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!x.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(x.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(x.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=x("
    ").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){x(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(x("
    ").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==x.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=x("
    ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||x.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(x.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=x.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(x("
    ").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e))},100))}});x.ui.autocomplete}); \ No newline at end of file diff --git a/doc/script.js b/doc/script.js new file mode 100644 index 0000000..0765364 --- /dev/null +++ b/doc/script.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +var moduleSearchIndex; +var packageSearchIndex; +var typeSearchIndex; +var memberSearchIndex; +var tagSearchIndex; +function loadScripts(doc, tag) { + createElem(doc, tag, 'search.js'); + + createElem(doc, tag, 'module-search-index.js'); + createElem(doc, tag, 'package-search-index.js'); + createElem(doc, tag, 'type-search-index.js'); + createElem(doc, tag, 'member-search-index.js'); + createElem(doc, tag, 'tag-search-index.js'); +} + +function createElem(doc, tag, path) { + var script = doc.createElement(tag); + var scriptElement = doc.getElementsByTagName(tag)[0]; + script.src = pathtoroot + path; + scriptElement.parentNode.insertBefore(script, scriptElement); +} + +function show(tableId, selected, columns) { + if (tableId !== selected) { + document.querySelectorAll('div.' + tableId + ':not(.' + selected + ')') + .forEach(function(elem) { + elem.style.display = 'none'; + }); + } + document.querySelectorAll('div.' + selected) + .forEach(function(elem, index) { + elem.style.display = ''; + var isEvenRow = index % (columns * 2) < columns; + elem.classList.remove(isEvenRow ? oddRowColor : evenRowColor); + elem.classList.add(isEvenRow ? evenRowColor : oddRowColor); + }); + updateTabs(tableId, selected); +} + +function updateTabs(tableId, selected) { + document.querySelector('div#' + tableId +' .summary-table') + .setAttribute('aria-labelledby', selected); + document.querySelectorAll('button[id^="' + tableId + '"]') + .forEach(function(tab, index) { + if (selected === tab.id || (tableId === selected && index === 0)) { + tab.className = activeTableTab; + tab.setAttribute('aria-selected', true); + tab.setAttribute('tabindex',0); + } else { + tab.className = tableTab; + tab.setAttribute('aria-selected', false); + tab.setAttribute('tabindex',-1); + } + }); +} + +function switchTab(e) { + var selected = document.querySelector('[aria-selected=true]'); + if (selected) { + if ((e.keyCode === 37 || e.keyCode === 38) && selected.previousSibling) { + // left or up arrow key pressed: move focus to previous tab + selected.previousSibling.click(); + selected.previousSibling.focus(); + e.preventDefault(); + } else if ((e.keyCode === 39 || e.keyCode === 40) && selected.nextSibling) { + // right or down arrow key pressed: move focus to next tab + selected.nextSibling.click(); + selected.nextSibling.focus(); + e.preventDefault(); + } + } +} + +var updateSearchResults = function() {}; + +function indexFilesLoaded() { + return moduleSearchIndex + && packageSearchIndex + && typeSearchIndex + && memberSearchIndex + && tagSearchIndex; +} + +// Workaround for scroll position not being included in browser history (8249133) +document.addEventListener("DOMContentLoaded", function(e) { + var contentDiv = document.querySelector("div.flex-content"); + window.addEventListener("popstate", function(e) { + if (e.state !== null) { + contentDiv.scrollTop = e.state; + } + }); + window.addEventListener("hashchange", function(e) { + history.replaceState(contentDiv.scrollTop, document.title); + }); + contentDiv.addEventListener("scroll", function(e) { + var timeoutID; + if (!timeoutID) { + timeoutID = setTimeout(function() { + history.replaceState(contentDiv.scrollTop, document.title); + timeoutID = null; + }, 100); + } + }); + if (!location.hash) { + history.replaceState(contentDiv.scrollTop, document.title); + } +}); diff --git a/doc/search.js b/doc/search.js new file mode 100644 index 0000000..13aba85 --- /dev/null +++ b/doc/search.js @@ -0,0 +1,354 @@ +/* + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +var noResult = {l: "No results found"}; +var loading = {l: "Loading search index..."}; +var catModules = "Modules"; +var catPackages = "Packages"; +var catTypes = "Classes and Interfaces"; +var catMembers = "Members"; +var catSearchTags = "Search Tags"; +var highlight = "$&"; +var searchPattern = ""; +var fallbackPattern = ""; +var RANKING_THRESHOLD = 2; +var NO_MATCH = 0xffff; +var MIN_RESULTS = 3; +var MAX_RESULTS = 500; +var UNNAMED = ""; +function escapeHtml(str) { + return str.replace(//g, ">"); +} +function getHighlightedText(item, matcher, fallbackMatcher) { + var escapedItem = escapeHtml(item); + var highlighted = escapedItem.replace(matcher, highlight); + if (highlighted === escapedItem) { + highlighted = escapedItem.replace(fallbackMatcher, highlight) + } + return highlighted; +} +function getURLPrefix(ui) { + var urlPrefix=""; + var slash = "/"; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if (ui.item.category === catTypes || ui.item.category === catMembers) { + if (ui.item.m) { + urlPrefix = ui.item.m + slash; + } else { + $.each(packageSearchIndex, function(index, item) { + if (item.m && ui.item.p === item.l) { + urlPrefix = item.m + slash; + } + }); + } + } + return urlPrefix; +} +function createSearchPattern(term) { + var pattern = ""; + var isWordToken = false; + term.replace(/,\s*/g, ", ").trim().split(/\s+/).forEach(function(w, index) { + if (index > 0) { + // whitespace between identifiers is significant + pattern += (isWordToken && /^\w/.test(w)) ? "\\s+" : "\\s*"; + } + var tokens = w.split(/(?=[A-Z,.()<>[\/])/); + for (var i = 0; i < tokens.length; i++) { + var s = tokens[i]; + if (s === "") { + continue; + } + pattern += $.ui.autocomplete.escapeRegex(s); + isWordToken = /\w$/.test(s); + if (isWordToken) { + pattern += "([a-z0-9_$<>\\[\\]]*?)"; + } + } + }); + return pattern; +} +function createMatcher(pattern, flags) { + var isCamelCase = /[A-Z]/.test(pattern); + return new RegExp(pattern, flags + (isCamelCase ? "" : "i")); +} +var watermark = 'Search'; +$(function() { + var search = $("#search-input"); + var reset = $("#reset-button"); + search.val(''); + search.prop("disabled", false); + reset.prop("disabled", false); + search.val(watermark).addClass('watermark'); + search.blur(function() { + if ($(this).val().length === 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + search.on('click keydown paste', function() { + if ($(this).val() === watermark) { + $(this).val('').removeClass('watermark'); + } + }); + reset.click(function() { + search.val('').focus(); + }); + search.focus()[0].setSelectionRange(0, 0); +}); +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function(ul, items) { + var rMenu = this; + var currentCategory = ""; + rMenu.menu.bindings = $(); + $.each(items, function(index, item) { + var li; + if (item.category && item.category !== currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.l); + li.attr("class", "result-item"); + } else { + li.attr("aria-label", item.l); + li.attr("class", "result-item"); + } + }); + }, + _renderItem: function(ul, item) { + var label = ""; + var matcher = createMatcher(escapeHtml(searchPattern), "g"); + var fallbackMatcher = new RegExp(fallbackPattern, "gi") + if (item.category === catModules) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catPackages) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catTypes) { + label = (item.p && item.p !== UNNAMED) + ? getHighlightedText(item.p + "." + item.l, matcher, fallbackMatcher) + : getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catMembers) { + label = (item.p && item.p !== UNNAMED) + ? getHighlightedText(item.p + "." + item.c + "." + item.l, matcher, fallbackMatcher) + : getHighlightedText(item.c + "." + item.l, matcher, fallbackMatcher); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else { + label = item.l; + } + var li = $("
  • ").appendTo(ul); + var div = $("
    ").appendTo(li); + if (item.category === catSearchTags && item.h) { + if (item.d) { + div.html(label + " (" + item.h + ")
    " + + item.d + "
    "); + } else { + div.html(label + " (" + item.h + ")"); + } + } else { + if (item.m) { + div.html(item.m + "/" + label); + } else { + div.html(label); + } + } + return li; + } +}); +function rankMatch(match, category) { + if (!match) { + return NO_MATCH; + } + var index = match.index; + var input = match.input; + var leftBoundaryMatch = 2; + var periferalMatch = 0; + // make sure match is anchored on a left word boundary + if (index === 0 || /\W/.test(input[index - 1]) || "_" === input[index]) { + leftBoundaryMatch = 0; + } else if ("_" === input[index - 1] || (input[index] === input[index].toUpperCase() && !/^[A-Z0-9_$]+$/.test(input))) { + leftBoundaryMatch = 1; + } + var matchEnd = index + match[0].length; + var leftParen = input.indexOf("("); + var endOfName = leftParen > -1 ? leftParen : input.length; + // exclude peripheral matches + if (category !== catModules && category !== catSearchTags) { + var delim = category === catPackages ? "/" : "."; + if (leftParen > -1 && leftParen < index) { + periferalMatch += 2; + } else if (input.lastIndexOf(delim, endOfName) >= matchEnd) { + periferalMatch += 2; + } + } + var delta = match[0].length === endOfName ? 0 : 1; // rank full match higher than partial match + for (var i = 1; i < match.length; i++) { + // lower ranking if parts of the name are missing + if (match[i]) + delta += match[i].length; + } + if (category === catTypes) { + // lower ranking if a type name contains unmatched camel-case parts + if (/[A-Z]/.test(input.substring(matchEnd))) + delta += 5; + if (/[A-Z]/.test(input.substring(0, index))) + delta += 5; + } + return leftBoundaryMatch + periferalMatch + (delta / 200); + +} +function doSearch(request, response) { + var result = []; + searchPattern = createSearchPattern(request.term); + fallbackPattern = createSearchPattern(request.term.toLowerCase()); + if (searchPattern === "") { + return this.close(); + } + var camelCaseMatcher = createMatcher(searchPattern, ""); + var fallbackMatcher = new RegExp(fallbackPattern, "i"); + + function searchIndexWithMatcher(indexArray, matcher, category, nameFunc) { + if (indexArray) { + var newResults = []; + $.each(indexArray, function (i, item) { + item.category = category; + var ranking = rankMatch(matcher.exec(nameFunc(item)), category); + if (ranking < RANKING_THRESHOLD) { + newResults.push({ranking: ranking, item: item}); + } + return newResults.length <= MAX_RESULTS; + }); + return newResults.sort(function(e1, e2) { + return e1.ranking - e2.ranking; + }).map(function(e) { + return e.item; + }); + } + return []; + } + function searchIndex(indexArray, category, nameFunc) { + var primaryResults = searchIndexWithMatcher(indexArray, camelCaseMatcher, category, nameFunc); + result = result.concat(primaryResults); + if (primaryResults.length <= MIN_RESULTS && !camelCaseMatcher.ignoreCase) { + var secondaryResults = searchIndexWithMatcher(indexArray, fallbackMatcher, category, nameFunc); + result = result.concat(secondaryResults.filter(function (item) { + return primaryResults.indexOf(item) === -1; + })); + } + } + + searchIndex(moduleSearchIndex, catModules, function(item) { return item.l; }); + searchIndex(packageSearchIndex, catPackages, function(item) { + return (item.m && request.term.indexOf("/") > -1) + ? (item.m + "/" + item.l) : item.l; + }); + searchIndex(typeSearchIndex, catTypes, function(item) { + return request.term.indexOf(".") > -1 ? item.p + "." + item.l : item.l; + }); + searchIndex(memberSearchIndex, catMembers, function(item) { + return request.term.indexOf(".") > -1 + ? item.p + "." + item.c + "." + item.l : item.l; + }); + searchIndex(tagSearchIndex, catSearchTags, function(item) { return item.l; }); + + if (!indexFilesLoaded()) { + updateSearchResults = function() { + doSearch(request, response); + } + result.unshift(loading); + } else { + updateSearchResults = function() {}; + } + response(result); +} +$(function() { + $("#search-input").catcomplete({ + minLength: 1, + delay: 300, + source: doSearch, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $("#search-input").empty(); + } + }, + autoFocus: true, + focus: function(event, ui) { + return false; + }, + position: { + collision: "flip" + }, + select: function(event, ui) { + if (ui.item.category) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + url += "module-summary.html"; + } else if (ui.item.category === catPackages) { + if (ui.item.u) { + url = ui.item.u; + } else { + url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; + } + } else if (ui.item.category === catTypes) { + if (ui.item.u) { + url = ui.item.u; + } else if (ui.item.p === UNNAMED) { + url += ui.item.l + ".html"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; + } + } else if (ui.item.category === catMembers) { + if (ui.item.p === UNNAMED) { + url += ui.item.c + ".html" + "#"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; + } + if (ui.item.u) { + url += ui.item.u; + } else { + url += ui.item.l; + } + } else if (ui.item.category === catSearchTags) { + url += ui.item.u; + } + if (top !== window) { + parent.classFrame.location = pathtoroot + url; + } else { + window.location.href = pathtoroot + url; + } + $("#search-input").focus(); + } + } + }); +}); diff --git a/doc/shooting.html b/doc/shooting.html new file mode 100644 index 0000000..ef60769 --- /dev/null +++ b/doc/shooting.html @@ -0,0 +1,151 @@ + + + + +shooting + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +

    Interface shooting

    +
    +
    +
    +
    All Known Implementing Classes:
    +
    gun, smg
    +
    +
    +
    public interface shooting
    +
    Интерфейс для взаимодействия с огнестрельным оружием
    +
    +
    +
      + +
    • +
      +

      Method Summary

      +
      +
      +
      +
      +
      Modifier and Type
      +
      Method
      +
      Description
      +
      void
      + +
      +
      перезарядка
      +
      +
      int
      +
      shoot(player attacker, + player prey)
      +
      +
      Выстрел
      +
      +
      +
      +
      +
      +
    • +
    +
    +
    +
      + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        shoot

        +
        int shoot(player attacker, + player prey)
        +
        Выстрел
        +
        +
        Parameters:
        +
        attacker - атакующий
        +
        prey - жертва
        +
        Returns:
        +
        состояние попадания
        +
        +
        +
      • +
      • +
        +

        reload

        +
        void reload()
        +
        перезарядка
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/doc/stylesheet.css b/doc/stylesheet.css new file mode 100644 index 0000000..6dc5b36 --- /dev/null +++ b/doc/stylesheet.css @@ -0,0 +1,866 @@ +/* + * Javadoc style sheet + */ + +@import url('resources/fonts/dejavu.css'); + +/* + * Styles for individual HTML elements. + * + * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular + * HTML element throughout the page. + */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; + padding:0; + height:100%; + width:100%; +} +iframe { + margin:0; + padding:0; + height:100%; + width:100%; + overflow-y:scroll; + border:none; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a[href]:hover, a[href]:focus { + text-decoration:none; + color:#bb7a2a; +} +a[name] { + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; +} +h4 { + font-size:15px; +} +h5 { + font-size:14px; +} +h6 { + font-size:13px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; +} +:not(h1, h2, h3, h4, h5, h6) > code, +:not(h1, h2, h3, h4, h5, h6) > tt { + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +.summary-table dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +button { + font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size: 14px; +} +/* + * Styles for HTML generated by javadoc. + * + * These are style classes that are used by the standard doclet to generate HTML documentation. + */ + +/* + * Styles for document title and copyright. + */ +.clear { + clear:both; + height:0; + overflow:hidden; +} +.about-language { + float:right; + padding:0 21px 8px 8px; + font-size:11px; + margin-top:-9px; + height:2.9em; +} +.legal-copy { + margin-left:.5em; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* + * Styles for navigation bar. + */ +@media screen { + .flex-box { + position:fixed; + display:flex; + flex-direction:column; + height: 100%; + width: 100%; + } + .flex-header { + flex: 0 0 auto; + } + .flex-content { + flex: 1 1 auto; + overflow-y: auto; + } +} +.top-nav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + min-height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.sub-nav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.sub-nav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +.sub-nav .nav-list { + padding-top:5px; +} +ul.nav-list { + display:block; + margin:0 25px 0 0; + padding:0; +} +ul.sub-nav-list { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.nav-list li { + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +.sub-nav .nav-list-search { + float:right; + margin:0 0 0 0; + padding:5px 6px; + clear:none; +} +.nav-list-search label { + position:relative; + right:-16px; +} +ul.sub-nav-list li { + list-style:none; + float:left; + padding-top:10px; +} +.top-nav a:link, .top-nav a:active, .top-nav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.top-nav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.nav-bar-cell1-rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skip-nav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* + * Hide navigation links and search box in print layout + */ +@media print { + ul.nav-list, div.sub-nav { + display:none; + } +} +/* + * Styles for page header and footer. + */ +.title { + color:#2c4557; + margin:10px 0; +} +.sub-title { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* + * Styles for headings. + */ +body.class-declaration-page .summary h2, +body.class-declaration-page .details h2, +body.class-use-page h2, +body.module-declaration-page .block-list h2 { + font-style: italic; + padding:0; + margin:15px 0; +} +body.class-declaration-page .summary h3, +body.class-declaration-page .details h3, +body.class-declaration-page .summary .inherited-list h2 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +/* + * Styles for page layout containers. + */ +main { + clear:both; + padding:10px 20px; + position:relative; +} +dl.notes > dt { + font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +dl.notes > dd { + margin:5px 10px 10px 0; + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +dl.name-value > dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +dl.name-value > dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* + * Styles for lists. + */ +li.circle { + list-style:circle; +} +ul.horizontal li { + display:inline; + font-size:0.9em; +} +div.inheritance { + margin:0; + padding:0; +} +div.inheritance div.inheritance { + margin-left:2em; +} +ul.block-list, +ul.details-list, +ul.member-list, +ul.summary-list { + margin:10px 0 10px 0; + padding:0; +} +ul.block-list > li, +ul.details-list > li, +ul.member-list > li, +ul.summary-list > li { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +.summary-table dl, .summary-table dl dt, .summary-table dl dd { + margin-top:0; + margin-bottom:1px; +} +ul.see-list, ul.see-list-long { + padding-left: 0; + list-style: none; +} +ul.see-list li { + display: inline; +} +ul.see-list li:not(:last-child):after, +ul.see-list-long li:not(:last-child):after { + content: ", "; + white-space: pre-wrap; +} +/* + * Styles for tables. + */ +.summary-table, .details-table { + width:100%; + border-spacing:0; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; + padding:0; +} +.caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0; + padding-top:10px; + padding-left:1px; + margin:0; + white-space:pre; +} +.caption a:link, .caption a:visited { + color:#1f389c; +} +.caption a:hover, +.caption a:active { + color:#FFFFFF; +} +.caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +div.table-tabs { + padding:10px 0 0 1px; + margin:0; +} +div.table-tabs > button { + border: none; + cursor: pointer; + padding: 5px 12px 7px 12px; + font-weight: bold; + margin-right: 3px; +} +div.table-tabs > button.active-table-tab { + background: #F8981D; + color: #253441; +} +div.table-tabs > button.table-tab { + background: #4D7A97; + color: #FFFFFF; +} +.two-column-summary { + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); +} +.three-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, auto); +} +.four-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%, auto); +} +@media screen and (max-width: 600px) { + .two-column-summary { + display: grid; + grid-template-columns: 1fr; + } +} +@media screen and (max-width: 800px) { + .three-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(25%, auto); + } + .three-column-summary .col-last { + grid-column-end: span 2; + } +} +@media screen and (max-width: 1000px) { + .four-column-summary { + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); + } +} +.summary-table > div, .details-table > div { + text-align:left; + padding: 8px 3px 3px 7px; +} +.col-first, .col-second, .col-last, .col-constructor-name, .col-summary-item-name { + vertical-align:top; + padding-right:0; + padding-top:8px; + padding-bottom:3px; +} +.table-header { + background:#dee3e9; + font-weight: bold; +} +.col-first, .col-first { + font-size:13px; +} +.col-second, .col-second, .col-last, .col-constructor-name, .col-summary-item-name, .col-last { + font-size:13px; +} +.col-first, .col-second, .col-constructor-name { + vertical-align:top; + overflow: auto; +} +.col-last { + white-space:normal; +} +.col-first a:link, .col-first a:visited, +.col-second a:link, .col-second a:visited, +.col-first a:link, .col-first a:visited, +.col-second a:link, .col-second a:visited, +.col-constructor-name a:link, .col-constructor-name a:visited, +.col-summary-item-name a:link, .col-summary-item-name a:visited, +.constant-values-container a:link, .constant-values-container a:visited, +.all-classes-container a:link, .all-classes-container a:visited, +.all-packages-container a:link, .all-packages-container a:visited { + font-weight:bold; +} +.table-sub-heading-color { + background-color:#EEEEFF; +} +.even-row-color, .even-row-color .table-header { + background-color:#FFFFFF; +} +.odd-row-color, .odd-row-color .table-header { + background-color:#EEEEEF; +} +/* + * Styles for contents. + */ +.deprecated-content { + margin:0; + padding:10px 0; +} +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +.col-last div { + padding-top:0; +} +.col-last a { + padding-bottom:3px; +} +.module-signature, +.package-signature, +.type-signature, +.member-signature { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + margin:14px 0; + white-space: pre-wrap; +} +.module-signature, +.package-signature, +.type-signature { + margin-top: 0; +} +.member-signature .type-parameters-long, +.member-signature .parameters, +.member-signature .exceptions { + display: inline-block; + vertical-align: top; + white-space: pre; +} +.member-signature .type-parameters { + white-space: normal; +} +/* + * Styles for formatting effect. + */ +.source-line-no { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:0 10px 5px 0; + color:#474747; +} +.deprecated-label, .descfrm-type-label, .implementation-label, .member-name-label, .member-name-link, +.module-label-in-package, .module-label-in-type, .override-specify-label, .package-label-in-type, +.package-hierarchy-label, .type-name-label, .type-name-link, .search-tag-link, .preview-label { + font-weight:bold; +} +.deprecation-comment, .help-footnote, .preview-comment { + font-style:italic; +} +.deprecation-block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +.preview-block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +div.block div.deprecation-comment { + font-style:normal; +} +/* + * Styles specific to HTML5 elements. + */ +main, nav, header, footer, section { + display:block; +} +/* + * Styles for javadoc search. + */ +.ui-autocomplete-category { + font-weight:bold; + font-size:15px; + padding:7px 0 7px 3px; + background-color:#4D7A97; + color:#FFFFFF; +} +.ui-autocomplete { + max-height:85%; + max-width:65%; + overflow-y:scroll; + overflow-x:scroll; + white-space:nowrap; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} +ul.ui-autocomplete { + position:fixed; + z-index:999999; + background-color: #FFFFFF; +} +ul.ui-autocomplete li { + float:left; + clear:both; + width:100%; +} +.ui-autocomplete .result-item { + font-size: inherit; +} +.ui-autocomplete .result-highlight { + font-weight:bold; +} +#search-input { + background-image:url('resources/glass.png'); + background-size:13px; + background-repeat:no-repeat; + background-position:2px 3px; + padding-left:20px; + position:relative; + right:-18px; + width:400px; +} +#reset-button { + background-color: rgb(255,255,255); + background-image:url('resources/x.png'); + background-position:center; + background-repeat:no-repeat; + background-size:12px; + border:0 none; + width:16px; + height:16px; + position:relative; + left:-4px; + top:-4px; + font-size:0px; +} +.watermark { + color:#545454; +} +.search-tag-desc-result { + font-style:italic; + font-size:11px; +} +.search-tag-holder-result { + font-style:italic; + font-size:12px; +} +.search-tag-result:target { + background-color:yellow; +} +.module-graph span { + display:none; + position:absolute; +} +.module-graph:hover span { + display:block; + margin: -100px 0 0 100px; + z-index: 1; +} +.inherited-list { + margin: 10px 0 10px 0; +} +section.class-description { + line-height: 1.4; +} +.summary section[class$="-summary"], .details section[class$="-details"], +.class-uses .detail, .serialized-class-details { + padding: 0px 20px 5px 10px; + border: 1px solid #ededed; + background-color: #f8f8f8; +} +.inherited-list, section[class$="-details"] .detail { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +.vertical-separator { + padding: 0 5px; +} +ul.help-section-list { + margin: 0; +} +ul.help-subtoc > li { + display: inline-block; + padding-right: 5px; + font-size: smaller; +} +ul.help-subtoc > li::before { + content: "\2022" ; + padding-right:2px; +} +span.help-note { + font-style: italic; +} +/* + * Indicator icon for external links. + */ +main a[href*="://"]::after { + content:""; + display:inline-block; + background-image:url('data:image/svg+xml; utf8, \ + \ + \ + '); + background-size:100% 100%; + width:7px; + height:7px; + margin-left:2px; + margin-bottom:4px; +} +main a[href*="://"]:hover::after, +main a[href*="://"]:focus::after { + background-image:url('data:image/svg+xml; utf8, \ + \ + \ + '); +} + +/* + * Styles for user-provided tables. + * + * borderless: + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. + * + * plain: + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. + * + * striped: + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. + */ + +table.borderless, +table.plain, +table.striped { + margin-top: 10px; + margin-bottom: 10px; +} +table.borderless > caption, +table.plain > caption, +table.striped > caption { + font-weight: bold; + font-size: smaller; +} +table.borderless th, table.borderless td, +table.plain th, table.plain td, +table.striped th, table.striped td { + padding: 2px 5px; +} +table.borderless, +table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, +table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { + border: none; +} +table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { + background-color: transparent; +} +table.plain { + border-collapse: collapse; + border: 1px solid black; +} +table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { + background-color: transparent; +} +table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, +table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { + border: 1px solid black; +} +table.striped { + border-collapse: collapse; + border: 1px solid black; +} +table.striped > thead { + background-color: #E3E3E3; +} +table.striped > thead > tr > th, table.striped > thead > tr > td { + border: 1px solid black; +} +table.striped > tbody > tr:nth-child(even) { + background-color: #EEE +} +table.striped > tbody > tr:nth-child(odd) { + background-color: #FFF +} +table.striped > tbody > tr > th, table.striped > tbody > tr > td { + border-left: 1px solid black; + border-right: 1px solid black; +} +table.striped > tbody > tr > th { + font-weight: normal; +} +/** + * Tweak font sizes and paddings for small screens. + */ +@media screen and (max-width: 1050px) { + #search-input { + width: 300px; + } +} +@media screen and (max-width: 800px) { + #search-input { + width: 200px; + } + .top-nav, + .bottom-nav { + font-size: 11px; + padding-top: 6px; + } + .sub-nav { + font-size: 11px; + } + .about-language { + padding-right: 16px; + } + ul.nav-list li, + .sub-nav .nav-list-search { + padding: 6px; + } + ul.sub-nav-list li { + padding-top: 5px; + } + main { + padding: 10px; + } + .summary section[class$="-summary"], .details section[class$="-details"], + .class-uses .detail, .serialized-class-details { + padding: 0 8px 5px 8px; + } + body { + -webkit-text-size-adjust: none; + } +} +@media screen and (max-width: 500px) { + #search-input { + width: 150px; + } + .top-nav, + .bottom-nav { + font-size: 10px; + } + .sub-nav { + font-size: 10px; + } + .about-language { + font-size: 10px; + padding-right: 12px; + } +} diff --git a/doc/tag-search-index.js b/doc/tag-search-index.js new file mode 100644 index 0000000..0367dae --- /dev/null +++ b/doc/tag-search-index.js @@ -0,0 +1 @@ +tagSearchIndex = [];updateSearchResults(); \ No newline at end of file diff --git a/doc/type-search-index.js b/doc/type-search-index.js new file mode 100644 index 0000000..20fc1c9 --- /dev/null +++ b/doc/type-search-index.js @@ -0,0 +1 @@ +typeSearchIndex = [{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"","l":"entity.coords"},{"p":"","l":"entity"},{"p":"","l":"gun"},{"p":"","l":"Main"},{"p":"","l":"modificate"},{"p":"","l":"player"},{"p":"","l":"shooting"},{"p":"","l":"smg"},{"p":"","l":"weapon"}];updateSearchResults(); \ No newline at end of file diff --git a/doc/weapon.html b/doc/weapon.html new file mode 100644 index 0000000..345322a --- /dev/null +++ b/doc/weapon.html @@ -0,0 +1,299 @@ + + + + +weapon + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +

    Class weapon

    +
    + +
    +
    +
    All Implemented Interfaces:
    +
    modificate
    +
    +
    +
    Direct Known Subclasses:
    +
    gun
    +
    +
    +
    public class weapon +extends Object +implements modificate
    +
    Класс оружия
    + Имеет методы нанесения урона и убийства объектов класса player
    +
    +
    +
      + +
    • +
      +

      Method Summary

      +
      +
      +
      +
      +
      Modifier and Type
      +
      Method
      +
      Description
      +
      int
      +
      attack(player attacker, + player prey)
      +
      +
      Атака игрока оружием
      +
      +
      static void
      + +
      +
      Выводит состояние счетчика
      +
      +
      void
      + +
      +
      Вывод информации о классе
      +
      +
      int
      + +
      +
      Гетер урона
      +
      +
      int
      + +
      +
      Гетер ID
      +
      + + +
      +
      Гетер имени
      +
      +
      void
      +
      remade(String name, + int damage)
      +
      +
      Переделка объекта
      +
      +
      void
      +
      rename(String name)
      +
      +
      Переименовывание объекта
      +
      +
      protected void
      +
      setDamage(int damage)
      +
      +
      Сетер урона
      + Защищенный, для использования в функции attack
      +
      +
      protected void
      + +
      +
      Сетер имени
      +
      +
      +
      +
      +
      +

      Methods inherited from class java.lang.Object

      +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      +
      +
    • +
    +
    +
    +
      + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        displayInfo

        +
        public void displayInfo()
        +
        Вывод информации о классе
        +
        +
      • +
      • +
        +

        displayCounter

        +
        public static void displayCounter()
        +
        Выводит состояние счетчика
        +
        +
      • +
      • +
        +

        attack

        +
        public int attack(player attacker, + player prey)
        +
        Атака игрока оружием
        +
        +
        Parameters:
        +
        attacker - класс Player атакующий
        +
        prey - класс Player жертва
        +
        Returns:
        +
        "1" если убил или "0" если ранил
        +
        +
        +
      • +
      • +
        +

        rename

        +
        public void rename(String name)
        +
        Description copied from interface: modificate
        +
        Переименовывание объекта
        +
        +
        Specified by:
        +
        rename in interface modificate
        +
        Parameters:
        +
        name - имя
        +
        +
        +
      • +
      • +
        +

        remade

        +
        public void remade(String name, + int damage)
        +
        Description copied from interface: modificate
        +
        Переделка объекта
        +
        +
        Specified by:
        +
        remade in interface modificate
        +
        Parameters:
        +
        name - имя
        +
        damage - урона
        +
        +
        +
      • +
      • +
        +

        getDamage

        +
        public int getDamage()
        +
        Гетер урона
        +
        +
        Returns:
        +
        кол-во уроа
        +
        +
        +
      • +
      • +
        +

        setDamage

        +
        protected void setDamage(int damage)
        +
        Сетер урона
        + Защищенный, для использования в функции attack
        +
        +
        Parameters:
        +
        damage - урон
        +
        +
        +
      • +
      • +
        +

        setName

        +
        protected void setName(String name)
        +
        Сетер имени
        +
        +
        Parameters:
        +
        name - имя
        +
        +
        +
      • +
      • +
        +

        getName

        +
        public String getName()
        +
        Гетер имени
        +
        +
        Returns:
        +
        имя
        +
        +
        +
      • +
      • +
        +

        getId

        +
        public int getId()
        +
        Гетер ID
        +
        +
        Returns:
        +
        ID
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/src/Main.java b/src/Main.java index ddd4c52..8aa3742 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,15 +1,22 @@ +/** + * Класс Main, который использует функции классов в проекте для демонстрации выполненного задания.
    + * ✅ иррархия weapon -> gun -> smg получается 2 потомка
    + * ✅ 2 интерфейса и каждый из них реализован(из shooting в gun, а из modificate в weapon)
    + * ✅ абстрактный класс entity c абстрактной функцией printInfo()
    + * ✅ КАЖДЫЙ класс содержит >2 полей
    + * ✅ в каждом классе есть параметризированный конструктор
    + * ✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private
    + * ✅ статическое поле и метод в entity, counter и displayCounter()
    + * ✅ методы в каждом классе
    + * ✅ методы реализовывают какую-то сложную логику
    + */ public class Main { + /** + * Это основной метод, использующий методы классов. + * @param args Не используется. + */ public static void main(String[] args) { - /*✅ иррархия weapon -> gun -> smg получается 2 потомка - //✅ 2 интерфейса и каждый из них реализован(shooting в gun, а modificate в weapon) - //✅ абстрактный класс entity c абстрактной функцией printInfo() - //✅ КАЖДЫЙ класс содержит >2 полей - //✅ в каждом классе есть параметризированный конструктор - //✅ реализация инкапсуляции в entity, класс coords, где сеттеры posX posY являются private - //✅ статическое поле и метод в entity, counter и displayCounter() - //✅ методы в каждом классе - //✅ методы реализовывают какую-то сложную логику - */ + // у нас есть игрок и оружие player Bob = new player("Bob"); @@ -29,7 +36,7 @@ public static void main(String[] args) { Bob.printInfo(); BigBob.printInfo(); - System.out.println("Сущности созданны и получена информация о них\n"); + System.out.println("Сущности созданы и получена информация о них\n"); Bob.attack(pistol, BigBob); BigBob.printInfo(); @@ -50,11 +57,10 @@ public static void main(String[] args) { System.out.println(); } - + p90.ChangeFireMode("semi"); Bob.attack(p90, BigBob); BigBob.printInfo(); System.out.println("О нееет! Bob расстреливает BigBob'a!\n"); - } -} \ No newline at end of file +} diff --git a/src/entity.java b/src/entity.java index 1c99e71..389fe38 100644 --- a/src/entity.java +++ b/src/entity.java @@ -1,41 +1,71 @@ +/** + * Класс Сущность + * это класс родитель класса player + */ public abstract class entity { - private String name = "Entity"; - private int healthPoint = 100; - + /**Имя сущности*/ + private String name; + /**Здоровье*/ + private int healthPoint; + /**Счетчик*/ static int counter = 1; + /**Индификатор*/ private int id = counter; entity.coords cord = new entity.coords(); + /**Конструктор по умолчанию*/ entity() { } - + /**Конструктор + * @param name имя сущности. + * @return ничего. + */ entity(String name) { - this.name = name; - this.healthPoint = healthPoint; + this(name,100,0,0); } - + /**Конструктор + * @param healthPoint кол-во здоровья. + * @return ничего. + */ entity(int healthPoint) { - this.healthPoint = healthPoint; + this("Entity",healthPoint,0,0); } - + /**Конструктор + * @param name имя сущности. + * @param healthPoint кол-во здоровья. + * @return ничего. + */ entity(String name, int healthPoint) { - this.name = name; - this.healthPoint = healthPoint; - this.healthPoint = healthPoint; + this(name,healthPoint,0,0); } + /**Конструктор + * @param posX координаты по оси X. + * @param posY координаты по оси Y. + * @return ничего. + */ entity(int posX, int posY) { - cord.setPosX(posX); - cord.setPosY(posY); + this("Entity",100,posX,posY); } + /**Конструктор + * @param name имя сущности. + * @param posX координаты по оси X. + * @param posY координаты по оси Y. + * @return ничего. + */ entity(String name, int posX, int posY) { - this.name = name; - cord.setPosX(posX); - cord.setPosY(posY); + this(name,100,posX,posY); } + /**Конструктор + * @param name имя сущности. + * @param healthPoint кол-во здоровья. + * @param posX координаты по оси X. + * @param posY координаты по оси Y. + * @return ничего. + */ entity(String name, int healthPoint, int posX, int posY) { this.name = name; this.healthPoint = healthPoint; @@ -43,67 +73,85 @@ public abstract class entity { cord.setPosY(posY); } - //ИНКАПСУЛИРОВАННЫЙ класс координат + /**Инкапсулированный класс координат для определения расположения сущности в 2D пространстве. + * */ protected class coords { private int posY; private int posX; - + /**Конструктор по умолчанию*/ coords() { - this.posX = 0; - this.posY = 0; + this(0,0); } - + /**Конструктор + * @param x координаты по оси X. + * @param y координаты по оси Y.*/ coords(int x, int y) { this.posX = x; this.posY = y; } + + /** + * Изменение координат + * @param x ось X + * @param y ось Y + */ public void changePos(int x,int y){ setPosX(x); setPosY(y); } + /**Гетер оси X + * @return ось X*/ public int getPosX() { return posX; } - - private void setPosX(int posX) { + /**Сетер оси X + * @param posX ось X*/ + public void setPosX(int posX) { this.posX = posX; } + /**Гетер оси Y + * @return ось Y*/ public int getPosY() { return posY; } - - private void setPosY(int posY) { + /**Сетер оси Y + * @param posY ось Y*/ + public void setPosY(int posY) { this.posY = posY; } } - //Абстрактная функция + /**Абстактная функция, для вывода информации о классе.*/ public abstract void printInfo(); - + /**Гетер ID + * @return id */ public int getId() { return id; } - + /**Статический метод отображения счетчика*/ public static void displayCounter() { - System.out.printf("Counter: %d \n", counter); } - + /**Гетер имени + * @return имя*/ public String getName() { return name; } - + /**Сетер имени + * @param name имя*/ public void setName(String name) { this.name = name; } - + /**Гетер здоровья + * @return кол-во здоровья*/ public int getHealthPoint() { return healthPoint; } - + /**Сетер кол-ва здоровья.
    + * Protected для внутреннего использования + * @param healthPoint кол-во здоровья*/ protected void setHealthPoint(int healthPoint) { this.healthPoint = healthPoint; } - } diff --git a/src/gun.java b/src/gun.java index da70929..528afb8 100644 --- a/src/gun.java +++ b/src/gun.java @@ -1,45 +1,64 @@ -public class gun extends weapon implements shooting { +/**Класс огнестрельного оружия + * добавляется размер магазина*/ +public class gun extends weapon implements shooting { + /**Размер магазина*/ private int magazineSize = 1; + /**Патронов в оружии*/ private int ammo = 1; + /**Конструктор по умолчанию*/ gun(){ super("Gun"); } + /**Конструктор + * @param name имя*/ gun(String name) { super(name); } - + /**Конструктор + * @param name имя + * @param damage урон*/ gun(String name, int damage) { super(name, damage); } - + /**Конструктор + * @param name имя + * @param damage урон + * @param magazineSize размер магазина*/ gun(String name, int damage, int magazineSize) { super(name); setDamage(damage); this.magazineSize = magazineSize; this.ammo = magazineSize; } + @Override public void displayInfo(){ System.out.printf("Name: %s, Damage: %d, id: %d, MagSize:%d, Ammo: %d\n",getName(),getDamage(),getId(),getMagazineSize(),getAmmo()); } + @Override public int attack(player attacker, player prey) { //переопределяем функцию из класса родителя различие в выводе в else - if (((getDamage() >= prey.getHealthPoint()) & getAmmo()>0) | prey.getLive()==false) { + if (((getDamage() >= prey.getHealthPoint()) & getAmmo()>0) | prey.getLive() == false) { setAmmo(getAmmo()-1);//прозводим выстрел prey.setLive(false); prey.setHealthPoint(0); - System.out.printf("Player \"%s\" KILL player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); + System.out.printf("Player \"%s\" KILL player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", + attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); return 1;//если убил, то возвращает 1 - } else if ((getDamage() < prey.getHealthPoint()) & getAmmo()>0){ + } + + else if ((getDamage() < prey.getHealthPoint()) & getAmmo()>0){ setAmmo(getAmmo()-1); prey.setHealthPoint(prey.getHealthPoint() - getDamage()); - System.out.printf("Player \"%s\" SHOOT player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); - return 0;// если ранил, то 2 + System.out.printf("Player \"%s\" SHOOT player \"%s\"(%dhp) by %d damage using \"%s\"(%d/%d)\n", + attacker.getName(), prey.getName(), prey.getHealthPoint(), getDamage(), getName(),getAmmo(),getMagazineSize()); + return 0;// если ранил, то 0 } + else { System.out.println("NoAmmo!"); - return 2; //если осечка, то 0 + return 2; //если осечка, то 2 } } @@ -54,14 +73,19 @@ public void reload() {//переопределяем функцию из инт System.out.printf("%s reload!\n",getName()); } - - public void remade(String name,int damage,int magazineSize){// переделка класса используя protected функции + /**Переделка объекта + * @param name имя + * @param damage урон + * @param magazineSize размер магазина + */ + public void remade(String name,int damage,int magazineSize){ setDamage(damage); setName(name); setMagazineSize(magazineSize); } - - protected void setAmmo(int ammo) {// используется только для перезарядки(reload) + /**Сетер патронов, используется для метода reload + * @param ammo кол-во патронов*/ + protected void setAmmo(int ammo) { if (ammo>0 & ammo<=getMagazineSize()) { this.ammo = ammo; } @@ -69,18 +93,21 @@ protected void setAmmo(int ammo) {// используется только дл this.ammo = 0; } } - + /**Гетер патронов + * @return количество патронов*/ public int getAmmo() { return ammo; } - + /**Сетер размера магаина, используется в методе remade + * @param magazineSize размер магазина*/ protected void setMagazineSize(int magazineSize) { // используется для remade if (magazineSize > 0) { this.magazineSize = magazineSize; } } - - protected int getMagazineSize() { + /**Гетер размера магазина + * @return размер магазина*/ + public int getMagazineSize() { return magazineSize; } } diff --git a/src/modificate.java b/src/modificate.java index fc10946..8117386 100644 --- a/src/modificate.java +++ b/src/modificate.java @@ -1,4 +1,10 @@ +/**Интерфейс для модификации класса оружия*/ public interface modificate { + /**Переименовывание объекта + * @param name имя*/ public void rename(String name); + /**Переделка объекта + * @param name имя + * @param damage урона*/ public void remade(String name,int damage); } diff --git a/src/player.java b/src/player.java index a880988..1ecb4d0 100644 --- a/src/player.java +++ b/src/player.java @@ -1,57 +1,73 @@ +/**Класс Игрок, является наследником класса entity + *
    + * Может использовать оружие */ + public class player extends entity { // наследуемся от абстрактного класса entity + /**Является ли игрок живым*/ private Boolean isLive = true; // состояние жизни у игрока - + /**Конструктор по молчанию*/ player() { super("Player"); } - + /**Конструктор + * @param name имя*/ player(String name) { - super(name); + super(name,100,0,0); } - + /**Конструктор + * @param name имя + * @param posX ось X + * @param posY ось Y + * */ player(String name, int posX, int posY) { - super(name); + super(name,100,posX,posY); } - + /**Конструктор + * @param name имя + * @param healthPoint кол-во здоровья + * */ player(String name, int healthPoint) { - super(healthPoint); - setName(name); + super(name,healthPoint,0,0); } - - public void setPos(int x, int y) { - cord.changePos(x,y); + /**Конструктор + * @param name bvz + * @param healthPoint кол-во здоровья + * @param posX ось X + * @param posY ось Y + * */ + player(String name, int healthPoint, int posX, int posY) { + super(name,healthPoint,posX,posY); } - + /**Гетер позиции + * @return [posX, poxY]*/ public int[] getPos() { - int posX = cord.getPosX(); - int posY = cord.getPosY(); - int[] arr = {posX, posY}; - System.out.printf("player \"%s\" has posX: %d | posY: %d\n", getName(), posX, posY); - return arr; - } - - protected void setHealthPoint(int healthPoint) { - super.setHealthPoint(healthPoint); + int[] arrPos = {cord.getPosX(), cord.getPosY()}; + System.out.printf("player \"%s\" has posX: %d | posY: %d\n", getName(), arrPos[0], arrPos[1]); + return arrPos; } @Override public void printInfo() { // переопределяем функцию из абстрактного класса - System.out.printf("Player \"%s\", posX: %d, posY: %d, Hp: %d, is live: %s\n", getName(), cord.getPosX(), cord.getPosY(), getHealthPoint(), getLive()); - // в стоит ли дальше использовать в подобных функицях get'ры и set'ры этого же класса? Отпишите пожалуйста! + System.out.printf("Player \"%s\", posX: %d, posY: %d, Hp: %d, is live: %s\n", + getName(), cord.getPosX(), cord.getPosY(), getHealthPoint(), getLive()); } - + /**Атака оружием + * @param wp класс weapon оружие + * @param prey класс player жертва + * @return состояние атаки*/ public int attack(weapon wp, player prey) { //атакуем жертву(prey) используя оружие(wp) return wp.attack(this, prey); } - + /**Гетер состояния здоровья + *@return boolean статус здоровья*/ public Boolean getLive() { - return isLive; + return this.isLive; } - + /**Сетер состояния здоровья + * @param live состояние жизни*/ public void setLive(Boolean live) { - isLive = live; + this.isLive = live; } - } diff --git a/src/shooting.java b/src/shooting.java index 73e3ecd..94be2ce 100644 --- a/src/shooting.java +++ b/src/shooting.java @@ -1,4 +1,15 @@ +/**Интерфейс для взаимодействия с огнестрельным оружием*/ public interface shooting { + /** + * Выстрел + * @param attacker атакующий + * @param prey жертва + * @return состояние попадания + */ public int shoot(player attacker, player prey); + + /** + * перезарядка + * */ public void reload(); } diff --git a/src/weapon.java b/src/weapon.java index db9ea67..bbd75c6 100644 --- a/src/weapon.java +++ b/src/weapon.java @@ -1,34 +1,42 @@ +/**Класс оружия
    + * Имеет методы нанесения урона и убийства объектов класса player*/ + public class weapon implements modificate { - // это класс оружия - // оно способно наносить урон игроку (player) - private String name = "weapon"; - private int damage = 1; + private String name; + private int damage; static int counter = 1; private int id = counter; - + /**Конструктор по умолчанию*/ weapon() { - this.id = counter++; + this("Weapon"); } - + /**Конструктор + * @param name имя*/ weapon(String name) { - this.id = counter++; - this.name = name; + this(name,1); } - + /**Конструктор + * @param name имя + * @param damage урон*/ weapon(String name, int damage) { this.id = counter++; this.name = name; this.damage = damage; } + /**Вывод информации о классе*/ public void displayInfo(){ System.out.printf("Name: %s, Damage: %d, id: %d\n",getName(),getDamage(),getId()); } + /**Выводит состояние счетчика*/ public static void displayCounter() { System.out.printf("Counter: %d \n", counter); } - + /**Атака игрока оружием + * @param attacker класс Player атакующий + * @param prey класс Player жертва + * @return "1" если убил или "0" если ранил*/ public int attack(player attacker, player prey) { if (getDamage() >= prey.getHealthPoint()) { prey.setLive(false); @@ -38,7 +46,7 @@ public int attack(player attacker, player prey) { } else { prey.setHealthPoint(prey.getHealthPoint() - getDamage());// вычитаем из нынешнего HP вычитаем урон оружия. System.out.printf("Player \"%s\" HURT player \"%s\" by %d damage using \"%s\"\n", attacker.getName(), prey.getName(), getDamage(), getName()); - return 0;// если ранил, то 2 + return 0;// если ранил, то 0 } } @@ -52,25 +60,30 @@ public void remade(String name,int damage){//переопределяем фун setDamage(damage); setName(name); } - + /**Гетер урона + * @return кол-во уроа*/ public int getDamage() { return damage; } - + /**Сетер урона
    + * Защищенный, для использования в функции attack + * @param damage урон*/ protected void setDamage(int damage) { this.damage = damage; } - + /**Сетер имени + * @param name имя*/ protected void setName(String name) { this.name = name; } - + /**Гетер имени + * @return имя*/ public String getName() { return name; } - + /**Гетер ID + * @return ID*/ public int getId() { return id; } - -} \ No newline at end of file +} From b39234677fbe85546607027e68e58d99835fcfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 13 Nov 2024 18:49:00 +0400 Subject: [PATCH 07/10] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=83=D1=81=D1=82=D1=8B=D1=85=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D1=87=D0=B5=D0=BA=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=86=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2.=20=D0=9F=D0=BE=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20gitignore=20javado?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 4 ++ doc/smg.html | 191 +++++++++++++++++++++++++++++++++++++++++++++++++ src/smg.java | 61 +++++++++++++--- 3 files changed, 246 insertions(+), 10 deletions(-) create mode 100644 doc/smg.html diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..6f1e1b8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,9 @@ + + diff --git a/doc/smg.html b/doc/smg.html new file mode 100644 index 0000000..0ce1b20 --- /dev/null +++ b/doc/smg.html @@ -0,0 +1,191 @@ + + + + +smg + + + + + + + + + + + + + + + +
    + +
    +
    + +
    +

    Class smg

    +
    + +
    +
    +
    All Implemented Interfaces:
    +
    modificate, shooting
    +
    +
    +
    public class smg +extends gun
    +
    Класс пистолета пулемета
    +
    +
    + +
    +
    +
      + +
    • +
      +

      Method Details

      +
        +
      • +
        +

        ChangeFireMode

        +
        public void ChangeFireMode(String strFireMode)
        +
        Смена режима стрельбы
        +
        +
        Parameters:
        +
        strFireMode - режим стрельбы "semi" / "auto"
        +
        +
        +
      • +
      • +
        +

        displayInfo

        +
        public void displayInfo()
        +
        Description copied from class: weapon
        +
        Вывод информации о классе
        +
        +
        Overrides:
        +
        displayInfo in class gun
        +
        +
        +
      • +
      • +
        +

        attack

        +
        public int attack(player attacker, + player prey)
        +
        Атака
        +
        +
        Overrides:
        +
        attack in class gun
        +
        Parameters:
        +
        attacker - класс Player атакующий
        +
        prey - класс Player жертва
        +
        Returns:
        +
        состояние атаки из gun
        +
        +
        +
      • +
      +
      +
    • +
    +
    + +
    +
    +
    + + diff --git a/src/smg.java b/src/smg.java index b45beb4..efdda2b 100644 --- a/src/smg.java +++ b/src/smg.java @@ -1,27 +1,39 @@ +/**Класс пистолета пулемета*/ + public class smg extends gun { mode fireMode = mode.AUTO; + /**Enum для определения режима стрельбы*/ enum mode { SEMI, AUTO } - + /**Конструктор по умолчанию*/ smg() { super("Smg"); } + /**Конструктор + * @param name имя*/ smg(String name) { super(name); } - + /**Конструктор + * @param name имя + * @param damage урон*/ smg(String name, int damage) { super(name, damage); } - + /**Конструктор + * @param name имя + * @param damage урон + * @param magazineSize размер магазина*/ smg(String name, int damage, int magazineSize) { super(name, damage, magazineSize); } - + /**Конструктор + * @param name имя + * @param strFireMode режим стрельбы "semi" / "auto"*/ smg(String name, String strFireMode) { super(name); switch (strFireMode) { @@ -29,22 +41,44 @@ enum mode { case "auto": this.fireMode = mode.AUTO; break; } } - + /**Конструктор + * @param name имя + * @param damage урон + * @param strFireMode режим стрельбы "semi" / "auto"*/ smg(String name, int damage, String strFireMode) { super(name, damage); switch (strFireMode) { case "semi": this.fireMode = mode.SEMI; break; case "auto": this.fireMode = mode.AUTO; break; + default: this.fireMode = mode.AUTO; break; } } - + /**Конструктор + * @param name имя + * @param damage урон + * @param magazineSize размер магазина + * @param strFireMode режим стрельбы "semi" / "auto"*/ smg(String name, int damage, int magazineSize, String strFireMode) { super(name, damage,magazineSize); switch (strFireMode) { case "semi": this.fireMode = mode.SEMI; break; case "auto": this.fireMode = mode.AUTO; break; + default: this.fireMode = mode.AUTO; break; + } + } + + /** + * Смена режима стрельбы + * @param strFireMode режим стрельбы "semi" / "auto" + */ + public void ChangeFireMode(String strFireMode){ + switch (strFireMode) { + case "semi": this.fireMode = mode.SEMI; break; + case "auto": this.fireMode = mode.AUTO; break; + default: this.fireMode = mode.AUTO; break; } } + @Override public void displayInfo(){ String mode=""; @@ -52,21 +86,28 @@ public void displayInfo(){ case SEMI: mode = "semi"; break; case AUTO: mode = "auto"; break; } - System.out.printf("Name: %s, Damage: %d, id: %d, MagSize:%d, Ammo: %d, Mode: %s\n",getName(),getDamage(),getId(),getMagazineSize(),getAmmo(),mode); + System.out.printf("Name: %s, Damage: %d, id: %d, MagSize:%d, Ammo: %d, Mode: %s\n", + getName(),getDamage(),getId(),getMagazineSize(),getAmmo(),mode); } + + /** + * Атака + * @param attacker класс Player атакующий + * @param prey класс Player жертва + * @return состояние атаки из gun + */ + @Override public int attack(player attacker, player prey) {//переопределяем функцию из интерфейса switch (fireMode) { case SEMI: return attack(attacker, prey); case AUTO: int temp = 0; - while (temp == 0){// стреляем пока не кончатся патроны, или не умрет цель + while (temp == 0){// стреляем пока наносим урон temp = super.attack(attacker, prey); } return temp; - default: return attack(attacker, prey); } } - } From d38bc639c53b6046820cabca1a8b01cd067c7e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=9A=D1=83=D0=B7?= =?UTF-8?q?=D0=BD=D0=B5=D1=86=D0=BE=D0=B2?= Date: Wed, 13 Nov 2024 18:54:04 +0400 Subject: [PATCH 08/10] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=87=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=83=D1=81=D1=82=D1=8B=D1=85=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=BE=D1=87=D0=B5=D0=BA=20=D0=B2=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=86=D0=B5=20=D0=BA=D0=BE=D0=B4=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2.=20=D0=98=D0=A1=D0=9F?= =?UTF-8?q?=D0=A0=D0=90=D0=92=D0=9B=D0=95=D0=9D=D0=98=D0=95=20gitignore=20?= =?UTF-8?q?javadoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1a3879a..872f2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ ### IntelliJ IDEA ### -.idea/ +.idea out/ !**/src/main/**/out/ !**/src/test/**/out/ From 7394081335e63f13a2fcf0538ac599b1475feec9 Mon Sep 17 00:00:00 2001 From: dezonnov1 <138213121+dezonnov1@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:55:47 +0400 Subject: [PATCH 09/10] Delete .idea directory --- .idea/.gitignore | 3 -- .idea/misc.xml | 10 ---- .idea/modules.xml | 8 --- .idea/uiDesigner.xml | 124 ------------------------------------------- .idea/vcs.xml | 6 --- 5 files changed, 151 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 6f1e1b8..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 65e8411..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 4104d1a6693f4e1130c815c7f159bef26af74788 Mon Sep 17 00:00:00 2001 From: dezonnov1 <138213121+dezonnov1@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:25:43 +0400 Subject: [PATCH 10/10] Update .gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 872f2f8..ea3a58a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ ### IntelliJ IDEA ### -.idea +.idea/ out/ !**/src/main/**/out/ !**/src/test/**/out/ @@ -27,4 +27,4 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store