This commit is contained in:
Oleksandr Hryshchenko 2022-12-04 22:19:51 +01:00
parent 7eed6569c4
commit f0cf085391
31 changed files with 431 additions and 12 deletions

View File

@ -0,0 +1,10 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="80" name="Java" />
</Languages>
</inspection_tool>
</profile>
</component>

View File

@ -10,8 +10,8 @@
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Interface" />
<option value="Enum" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
@ -96,6 +96,11 @@
&quot;settings.editor.selected.configurable&quot;: &quot;inlay.hints&quot;
}
}</component>
<component name="RecentsManager">
<key name="CreateClassDialog.RecentsKey">
<recent name="com.company.creature.cicavce" />
</key>
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="com.company.Main" />
@ -147,7 +152,12 @@
<workItem from="1669198101589" duration="513000" />
<workItem from="1669283031999" duration="278000" />
<workItem from="1669296857490" duration="9973000" />
<workItem from="1669746866999" duration="7685000" />
<workItem from="1669746866999" duration="8976000" />
<workItem from="1669795842995" duration="3581000" />
<workItem from="1669814532578" duration="3739000" />
<workItem from="1669892181459" duration="312000" />
<workItem from="1669892510192" duration="1371000" />
<workItem from="1670185537472" duration="3079000" />
</task>
<servers />
</component>
@ -170,4 +180,14 @@
<path value="$PROJECT_DIR$/svet" />
</ignored-roots>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<breakpoint enabled="true" type="java-exception">
<properties class="java.lang.ClassCastException" package="java.lang" />
<option name="timeStamp" value="1" />
</breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@ -7,9 +7,9 @@ import com.company.cosmicbody.Star;
import com.company.creature.Creature;
import com.company.creature.MarineMammals;
import com.company.creature.Mucha;
import com.company.creature.birds.Eagle;
import com.company.creature.fish.Kapor;
import com.company.creature.fish.Nemo;
import com.company.creature.stavovce.stavovcediely.birds.Eagle;
import com.company.creature.stavovce.stavovcediely.fish.Kapor;
import com.company.creature.stavovce.stavovcediely.fish.Nemo;
import com.company.universe.Galaxy;
import com.company.universe.PlanetaryNebula;
import com.company.universe.Universe;
@ -101,18 +101,15 @@ public class Main {
Kapor vianocnykapor = new Kapor(50);
Date dNow = new Date();
vianocnykapor.born(dNow);
Earth earth = new Earth();
earth.addCreature(vianocnykapor);
motherEarth.addCreature(vianocnykapor);
vianocnykapor.move(10,10,0);
vianocnykapor.die(dNow);
earth.addCreature(new Nemo());
earth.addCreature(new Eagle());
motherEarth.addCreature(new Nemo());
motherEarth.addCreature(new Eagle());
Mucha vinnamuska = new Mucha();
earth.addCreature(vinnamuska);
motherEarth.addCreature(vinnamuska);
System.out.println("\n");

View File

@ -0,0 +1,27 @@
package com.company.creature.cicavce;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
public abstract class Cicavec extends Stavovec implements cicable{
private float temperature;
@Override
public void create_sustavy() {
sustavy[0] = new ObehovaSustavaStavovec(TypSustavy.OBEHOVA);
sustavy[1] = new OpovovaSustavaStavovec(TypSustavy.OPOROVA);
sustavy[2] = new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA);
sustavy[3] = new PohybovaSustavaStavovec(TypSustavy.POHYBOVA);
sustavy[4] = new DychaciaSustavaStavovec(TypSustavy.DUCHACIA);
sustavy[5] = new TraviacaSustavaStavovec(TypSustavy.TRAVIACA);
sustavy[6] = new RozmnovaciaSustavaStavovec(TypSustavy.ROZMNOZOVACIA);
sustavy[7] = new NervovaSustavaStavovec_Default(TypSustavy.NEROVA);
}
public Cicavec(int pocet_stavcov) {
super(pocet_stavcov);
this.temperature = 36;
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.cicavce;
public class Materske_mlieko {
}

View File

@ -0,0 +1,6 @@
package com.company.creature.cicavce;
public interface cicable {
public void cicat (Cicavec mama);
public void cicat(Materske_mlieko mliecko);
}

View File

@ -0,0 +1,13 @@
package com.company.creature.stavovce.stavovcediely;
public class Chrbtica {
private Stavec[] stavce;
public Chrbtica(int pocet_stavcov) {
this.stavce = new Stavec[pocet_stavcov];
}
public Chrbtica() {
this.stavce = new Stavec[11];
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely;
public class Stavec {
}

View File

@ -0,0 +1,49 @@
package com.company.creature.stavovce.stavovcediely;
import com.company.creature.Creature;
import com.company.creature.stavovce.stavovcediely.sustavy.*;
import java.util.Date;
public class Stavovec extends Creature {
protected Chrbtica chrbtica;
protected Sustava[] sustavy;
public Stavovec(int pocet_stavcov){
chrbtica = new Chrbtica(pocet_stavcov);
//create_sustavy();
}
protected void create_sustavy(){
sustavy = new Sustava[8];
sustavy[0] = new ObehovaSustavaStavovec(TypSustavy.OBEHOVA);
sustavy[1] = new OpovovaSustavaStavovec(TypSustavy.OPOROVA);
sustavy[2] = new VylucovaciaSustavaStavovec(TypSustavy.VYLUCOVACIA);
sustavy[3] = new PohybovaSustavaStavovec(TypSustavy.POHYBOVA);
sustavy[4] = new DychaciaSustavaStavovec(TypSustavy.DUCHACIA);
sustavy[5] = new TraviacaSustavaStavovec(TypSustavy.TRAVIACA);
sustavy[6] = new RozmnovaciaSustavaStavovec(TypSustavy.ROZMNOZOVACIA);
sustavy[7] = new NervovaSustavaStavovec_Default(TypSustavy.NEROVA);
}
public Sustava[] getSustavy() {
return sustavy;
}
@Override
public void born(Date DayOfBirth) {
}
@Override
public void move(int directionX, int directionY, int directionZ) {
}
@Override
public void die(Date DayOfDie) {
}
}

View File

@ -0,0 +1,52 @@
package com.company.creature.stavovce.stavovcediely.birds;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import java.util.Date;
public abstract class Bird extends Stavovec {
private String name;
private double height;
private double weight;
private String type;
public Bird(int pocet_stavcov){
super(pocet_stavcov);
}
public Bird(String name, double height, double weight, String type, int pocet_stavcov) {
super(pocet_stavcov);
this.name = name;
this.height = height;
this.weight = weight;
this.type = type;
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
public Bird() {
super(11);
this.name = "Loloska";
this.height = 100;
this.weight = 10;
this.type = "parrot";
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
System.out.println("I fly. Because I'm bird");
}
@Override
public void born(Date DayOfBirth) {
super.DayOfBirth = DayOfBirth;
System.out.println("I was born " + super.DayOfBirth.toString());
}
@Override
public void die(Date DayOfDie) {
super.DayOfDie = DayOfDie;
System.out.println("I was die " + super.DayOfDie.toString());
}
}

View File

@ -0,0 +1,14 @@
package com.company.creature.stavovce.stavovcediely.birds;
public class Eagle extends Bird{
public Eagle(int pocet_stavcov) {
super(pocet_stavcov);
}
public Eagle(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Eagle() {
}
}

View File

@ -0,0 +1,51 @@
package com.company.creature.stavovce.stavovcediely.fish;
import com.company.creature.stavovce.stavovcediely.Stavovec;
import java.util.Date;
public abstract class Fish extends Stavovec {
private String name;
private double height;
private double weight;
private String type;
public Fish(int pocet_stavcov){
super(pocet_stavcov);
}
public Fish(String name, double height, double weight, String type, int pocet_stavcov) {
super(pocet_stavcov);
this.name = name;
this.height = height;
this.weight = weight;
this.type = type;
System.out.println("Fish is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
public Fish() {
super(11);
this.name = "Svoupy";
this.height = 15;
this.weight = 0.2;
this.type = "Golden fish";
System.out.println("Bird is: " + name + " has been created. Parameters: " + height + "cm, " + weight + "kg. Type - " + type);
}
@Override
public void move(int directionX, int directionY, int directionZ) {
System.out.println("I swim. Because I'm a fish");
}
@Override
public void born(Date DayOfBirth) {
super.DayOfBirth = DayOfBirth;
System.out.println("I was born " + super.DayOfBirth.toString());
}
@Override
public void die(Date DayOfDie) {
super.DayOfDie = DayOfDie;
System.out.println("I was die " + super.DayOfDie.toString());
}
}

View File

@ -0,0 +1,15 @@
package com.company.creature.stavovce.stavovcediely.fish;
public class Kapor extends Fish{
public Kapor(int pocet_stavcov) {
super(pocet_stavcov);
}
public Kapor(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Kapor() {
}
}

View File

@ -0,0 +1,14 @@
package com.company.creature.stavovce.stavovcediely.fish;
public class Nemo extends Fish{
public Nemo(int pocet_stavcov) {
super(pocet_stavcov);
}
public Nemo(String name, double height, double weight, String type, int pocet_stavcov) {
super(name, height, weight, type, pocet_stavcov);
}
public Nemo() {
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class DychaciaSustavaStavovec extends Sustava{
public DychaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class NervovaSustavaStavovec_Default extends Sustava{
public NervovaSustavaStavovec_Default(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class ObehovaSustavaStavovec extends Sustava{
public ObehovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class OpovovaSustavaStavovec extends Sustava{
public OpovovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class PohybovaSustavaStavovec extends Sustava{
public PohybovaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class RozmnovaciaSustavaStavovec extends Sustava {
public RozmnovaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,13 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public abstract class Sustava {
TypSustavy typSustavy;
public Sustava(TypSustavy typSustavy) {
this.typSustavy = typSustavy;
}
public void setTypSustavy(TypSustavy typSustavy) {
this.typSustavy = typSustavy;
}
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class TraviacaSustavaStavovec extends Sustava{
public TraviacaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,12 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public enum TypSustavy {
OPOROVA,
OBEHOVA,
VYLUCOVACIA,
POHYBOVA,
DUCHACIA,
TRAVIACA,
ROZMNOZOVACIA,
NEROVA
}

View File

@ -0,0 +1,7 @@
package com.company.creature.stavovce.stavovcediely.sustavy;
public class VylucovaciaSustavaStavovec extends Sustava{
public VylucovaciaSustavaStavovec(TypSustavy typSustavy) {
super(typSustavy);
}
}

View File

@ -0,0 +1,11 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class CNS {
private Mozog mozog;
private Miecha miecha;
public CNS() {
mozog = new Mozog();
miecha = new Miecha();
}
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Miecha {
private Neuron[] NeuronovaSiet;
public Miecha() {
this.NeuronovaSiet = new Neuron[500];
}
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Mozog {
private Neuron[] NeuronovaSiet;
public Mozog(){
this.NeuronovaSiet = new Neuron[500];
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Nerv {
}

View File

@ -0,0 +1,16 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
import com.company.creature.stavovce.stavovcediely.sustavy.NervovaSustavaStavovec_Default;
import com.company.creature.stavovce.stavovcediely.sustavy.TypSustavy;
public class NervovaSustavaCicavec extends NervovaSustavaStavovec_Default {
private CNS cns;
private PNS pns;
public NervovaSustavaCicavec(TypSustavy typSustavy) {
super(typSustavy);
cns = new CNS();
pns = new PNS();
}
}

View File

@ -0,0 +1,4 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class Neuron {
}

View File

@ -0,0 +1,9 @@
package com.company.creature.stavovce.stavovcediely.sustavy.nervova;
public class PNS {
private Nerv[] nervy;
public PNS(){
nervy = new Nerv[100];
}
}