Final
This commit is contained in:
parent
383636534e
commit
461a402dc8
@ -1,207 +1,211 @@
|
||||
import com.company.Singletone;
|
||||
import com.company.cars.Car;
|
||||
import com.company.cars.UniverseCarFactory;
|
||||
import com.company.cosmicbody.Earth;
|
||||
import com.company.cosmicbody.Planet;
|
||||
import com.company.cosmicbody.SolarSystem;
|
||||
import com.company.cosmicbody.Star;
|
||||
import com.company.creature.Creature;
|
||||
import com.company.creature.MarineMammals;
|
||||
import com.company.creature.Mucha;
|
||||
import com.company.creature.clovecina.Clovek;
|
||||
import com.company.creature.clovecina.Muz;
|
||||
import com.company.creature.clovecina.Zena;
|
||||
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;
|
||||
import tools.MessageReader;
|
||||
import tools.MessageWriter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Universe i_xander_i = new Universe();
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
PlanetaryNebula Orion = new PlanetaryNebula("Orion",5, 18000,200,200,200);
|
||||
PlanetaryNebula Buba = new PlanetaryNebula("Buba", 8, 2300, 12,59,94);
|
||||
PlanetaryNebula Phonk = new PlanetaryNebula("Phonk", 20, 100000, 0,0,0);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Planet Mercury = new Planet("Mercury", 1333, 6083, 0);
|
||||
Planet Venus = new Planet("Venus", 4867, 938, 12.1);
|
||||
Planet Earth = new Planet("Earth", 100000, 108321);
|
||||
Earth motherEarth = new Earth("Earth2", 100000, 108321);
|
||||
Planet Mars = new Planet("Mars", 641, 16318, 9.81);
|
||||
Planet Jupiter = new Planet("Jupiter", 3, 71313, 20.89);
|
||||
Planet Saturn = new Planet("Saturn", 1000, 108408, 95.8);
|
||||
Planet Uranus = new Planet("Uranus", 1000, 202156, 255.55);
|
||||
Planet Neptune = new Planet("Neptune", 7050, 620654, 0);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Star sun = new Star("Sun", 1.392, 1.40927, 1499726.85);
|
||||
sun.on();
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
SolarSystem solarSystem = new SolarSystem();
|
||||
solarSystem.addBody(Mercury);
|
||||
solarSystem.addBody(Venus);
|
||||
solarSystem.addBody(Earth);
|
||||
solarSystem.addBody(Mars);
|
||||
solarSystem.addBody(Jupiter);
|
||||
solarSystem.addBody(Saturn);
|
||||
solarSystem.addBody(Uranus);
|
||||
solarSystem.addBody(Neptune);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Galaxy milkyWay = new Galaxy("Milky Way");
|
||||
milkyWay.addSustava(solarSystem);
|
||||
|
||||
Galaxy Hryshchenko = new Galaxy("Hryshchenko");
|
||||
Hryshchenko.addSustava(solarSystem);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
milkyWay.sendMessage(Hryshchenko, "Hi, I'm you friend");
|
||||
Hryshchenko.sendMessage(milkyWay, "Hi.");
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
/* Creature Ara = new Bird("Blu", 60, 0.4, "Blu-ara");
|
||||
Ara.move(10, 10, 20);
|
||||
Creature Ara1 = new Bird("Jewel", 55, 0.4, "Blu-ara");
|
||||
Ara1.move(20,60,90);
|
||||
Creature Toucan = new Bird("Rafael", 65, 0.75, "Toco toucan");
|
||||
Toucan.move(60,23,95);
|
||||
Creature Cardinal = new Bird("Pedro", 20, 0.09, "Red-crested cardinal");
|
||||
Cardinal.move(98,65,32);
|
||||
Creature Canary = new Bird("Nico", 20.5, 0.05, "Domestic canary");
|
||||
Canary.move(87,56,26);
|
||||
Creature Cockatoo = new Bird("Nigel", 55, 0.97, "Sulphur-crested cockatoo");
|
||||
Cockatoo.move(95,45,12);
|
||||
Creature Toucan1 = new Bird("Eva", 53, 0.4, "Keel-billed toucan");
|
||||
Toucan1.move(78,64,23);*/
|
||||
|
||||
/* System.out.println("\n");
|
||||
|
||||
Creature Clownfish = new Fish("Oscar" , 10, 0.02, "Bluestreak cleaner wrasse");
|
||||
Clownfish.move(2000,9000,3000);
|
||||
Creature Shark = new Fish("Lenny" , 12000, 561, "Tiger shark");
|
||||
Shark.move(6000,6258,82214);
|
||||
Creature Angelfish = new Fish("Angie" , 15, 0.06, "Angelfish");
|
||||
Angelfish.move(8452,1235,7536);
|
||||
Creature Porcupinefish = new Fish("Sykes" , 91, 0.1, "Porcupinefish");
|
||||
Porcupinefish.move(5628,7874,5632);
|
||||
Creature Lionfish = new Fish("Lola" , 45.7, 0.26, "Red lionfish");
|
||||
Lionfish.move(6203,8954,8443);*/
|
||||
|
||||
Kapor vianocnykapor = new Kapor(50);
|
||||
Date dNow = new Date();
|
||||
vianocnykapor.born(dNow);
|
||||
motherEarth.addCreature(vianocnykapor);
|
||||
vianocnykapor.move(10,10,0);
|
||||
vianocnykapor.die(dNow);
|
||||
|
||||
motherEarth.addCreature(new Nemo());
|
||||
motherEarth.addCreature(new Eagle());
|
||||
|
||||
Mucha vinnamuska = new Mucha();
|
||||
motherEarth.addCreature(vinnamuska);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Creature Bear = new MarineMammals();
|
||||
Bear.move(56,9,0);
|
||||
Creature Otter = new MarineMammals("Nora", 115.1, 3.6, "marine otter", true);
|
||||
Otter.move(20,8,2);
|
||||
Creature Walrus = new MarineMammals("Pupik", 4.4, 1700, "Walrus", true);
|
||||
Walrus.move(35,58,8);
|
||||
Creature Seals = new MarineMammals("Duska", 117.2, 45, "True seals", true);
|
||||
Seals.move(9526,856,258);
|
||||
|
||||
motherEarth.addCreature(Otter);
|
||||
motherEarth.addCreature(Bear);
|
||||
motherEarth.addCreature(Walrus);
|
||||
motherEarth.addCreature(Seals);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
/*for(int i = 0; i < 2000; i++){
|
||||
motherEarth.addCreature(new Bird());
|
||||
motherEarth.addCreature(new Fish());
|
||||
}
|
||||
|
||||
Creature[] array = motherEarth.getArrayCreature();
|
||||
for(int i = 0; i < 2000; i++){
|
||||
array[i].move(10,10,0);
|
||||
}*/
|
||||
|
||||
Muz prvyMuz = new Muz(null, null,34, "Adam", "Prvy");
|
||||
Zena prvaZena = new Zena(null, null,34, "Eva", "Prva");
|
||||
System.out.println(prvyMuz);
|
||||
System.out.println(prvaZena);
|
||||
|
||||
motherEarth.addCreature(prvyMuz);
|
||||
motherEarth.addCreature(prvaZena);
|
||||
|
||||
Clovek prvedieta = prvaZena.splodit(prvyMuz);
|
||||
prvedieta.born(dNow);
|
||||
prvedieta.setName("Kain");
|
||||
|
||||
Clovek druhedieta = prvaZena.splodit(prvyMuz);
|
||||
druhedieta.born(dNow);
|
||||
druhedieta.setName("Abel");
|
||||
|
||||
System.out.println(prvedieta);
|
||||
System.out.println(druhedieta);
|
||||
|
||||
MessageReader AdamovReader = new MessageReader();
|
||||
AdamovReader.obtainFilename(args);
|
||||
AdamovReader.openAndRead();
|
||||
AdamovReader.processMessage();
|
||||
|
||||
MessageWriter AdamovWriter = new MessageWriter(motherEarth.getArrayCreature());
|
||||
AdamovWriter.WriteMessage();
|
||||
|
||||
Singletone singletone = Singletone.getInstance();
|
||||
singletone.takeUniverse(i_xander_i);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
UniverseCarFactory myFactory = new UniverseCarFactory("BMW");
|
||||
|
||||
Car mvp = myFactory.produce("MVP");
|
||||
Car suv = myFactory.produce("SUV");
|
||||
Car sport = myFactory.produce("Sportcar");
|
||||
Car little = myFactory.produce("Littlecar");
|
||||
|
||||
System.out.println(mvp);
|
||||
System.out.println(suv);
|
||||
System.out.println(sport);
|
||||
System.out.println(little);
|
||||
|
||||
ArrayList<Car> warehouse = new ArrayList<Car>();
|
||||
UniverseCarFactory Mercedes = new UniverseCarFactory("Mercedes");
|
||||
UniverseCarFactory BMW = new UniverseCarFactory("BMW");
|
||||
|
||||
for(int i =0; i<1000; i++ ){
|
||||
Car mercedes = Mercedes.produce("Littlecar");
|
||||
Car bmw = BMW.produce("Sportcar");
|
||||
warehouse.add(mercedes);
|
||||
warehouse.add(bmw);
|
||||
}
|
||||
|
||||
i_xander_i.stopUniverse();
|
||||
}
|
||||
import com.company.Singletone;
|
||||
import com.company.cars.Car;
|
||||
import com.company.cars.UniverseCarFactory;
|
||||
import com.company.cosmicbody.Earth;
|
||||
import com.company.cosmicbody.Planet;
|
||||
import com.company.cosmicbody.SolarSystem;
|
||||
import com.company.cosmicbody.Star;
|
||||
import com.company.creature.Creature;
|
||||
import com.company.creature.MarineMammals;
|
||||
import com.company.creature.Mucha;
|
||||
import com.company.creature.clovecina.Clovek;
|
||||
import com.company.creature.clovecina.Muz;
|
||||
import com.company.creature.clovecina.Zena;
|
||||
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;
|
||||
import tools.MessageReader;
|
||||
import tools.MessageWriter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Universe i_xander_i = new Universe();
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
PlanetaryNebula Orion = new PlanetaryNebula("Orion",5, 18000,200,200,200);
|
||||
PlanetaryNebula Buba = new PlanetaryNebula("Buba", 8, 2300, 12,59,94);
|
||||
PlanetaryNebula Phonk = new PlanetaryNebula("Phonk", 20, 100000, 0,0,0);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Planet Mercury = new Planet("Mercury", 1333, 6083, 0);
|
||||
Planet Venus = new Planet("Venus", 4867, 938, 12.1);
|
||||
Planet Earth = new Planet("Earth", 100000, 108321);
|
||||
Earth motherEarth = new Earth("Earth2", 100000, 108321);
|
||||
Planet Mars = new Planet("Mars", 641, 16318, 9.81);
|
||||
Planet Jupiter = new Planet("Jupiter", 3, 71313, 20.89);
|
||||
Planet Saturn = new Planet("Saturn", 1000, 108408, 95.8);
|
||||
Planet Uranus = new Planet("Uranus", 1000, 202156, 255.55);
|
||||
Planet Neptune = new Planet("Neptune", 7050, 620654, 0);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Star sun = new Star("Sun", 1.392, 1.40927, 1499726.85);
|
||||
sun.on();
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
SolarSystem solarSystem = new SolarSystem();
|
||||
solarSystem.addBody(Mercury);
|
||||
solarSystem.addBody(Venus);
|
||||
solarSystem.addBody(Earth);
|
||||
solarSystem.addBody(Mars);
|
||||
solarSystem.addBody(Jupiter);
|
||||
solarSystem.addBody(Saturn);
|
||||
solarSystem.addBody(Uranus);
|
||||
solarSystem.addBody(Neptune);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Galaxy milkyWay = new Galaxy("Milky Way");
|
||||
milkyWay.addSustava(solarSystem);
|
||||
|
||||
Galaxy Hryshchenko = new Galaxy("Hryshchenko");
|
||||
Hryshchenko.addSustava(solarSystem);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
milkyWay.sendMessage(Hryshchenko, "Hi, I'm you friend");
|
||||
Hryshchenko.sendMessage(milkyWay, "Hi.");
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
/* Creature Ara = new Bird("Blu", 60, 0.4, "Blu-ara");
|
||||
Ara.move(10, 10, 20);
|
||||
Creature Ara1 = new Bird("Jewel", 55, 0.4, "Blu-ara");
|
||||
Ara1.move(20,60,90);
|
||||
Creature Toucan = new Bird("Rafael", 65, 0.75, "Toco toucan");
|
||||
Toucan.move(60,23,95);
|
||||
Creature Cardinal = new Bird("Pedro", 20, 0.09, "Red-crested cardinal");
|
||||
Cardinal.move(98,65,32);
|
||||
Creature Canary = new Bird("Nico", 20.5, 0.05, "Domestic canary");
|
||||
Canary.move(87,56,26);
|
||||
Creature Cockatoo = new Bird("Nigel", 55, 0.97, "Sulphur-crested cockatoo");
|
||||
Cockatoo.move(95,45,12);
|
||||
Creature Toucan1 = new Bird("Eva", 53, 0.4, "Keel-billed toucan");
|
||||
Toucan1.move(78,64,23);*/
|
||||
|
||||
/* System.out.println("\n");
|
||||
|
||||
Creature Clownfish = new Fish("Oscar" , 10, 0.02, "Bluestreak cleaner wrasse");
|
||||
Clownfish.move(2000,9000,3000);
|
||||
Creature Shark = new Fish("Lenny" , 12000, 561, "Tiger shark");
|
||||
Shark.move(6000,6258,82214);
|
||||
Creature Angelfish = new Fish("Angie" , 15, 0.06, "Angelfish");
|
||||
Angelfish.move(8452,1235,7536);
|
||||
Creature Porcupinefish = new Fish("Sykes" , 91, 0.1, "Porcupinefish");
|
||||
Porcupinefish.move(5628,7874,5632);
|
||||
Creature Lionfish = new Fish("Lola" , 45.7, 0.26, "Red lionfish");
|
||||
Lionfish.move(6203,8954,8443);*/
|
||||
|
||||
Kapor vianocnykapor = new Kapor(50);
|
||||
Date dNow = new Date();
|
||||
vianocnykapor.born(dNow);
|
||||
motherEarth.addCreature(vianocnykapor);
|
||||
vianocnykapor.move(10,10,0);
|
||||
vianocnykapor.die(dNow);
|
||||
|
||||
motherEarth.addCreature(new Nemo());
|
||||
motherEarth.addCreature(new Eagle());
|
||||
|
||||
Mucha vinnamuska = new Mucha();
|
||||
motherEarth.addCreature(vinnamuska);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Creature Bear = new MarineMammals();
|
||||
Bear.move(56,9,0);
|
||||
Creature Otter = new MarineMammals("Nora", 115.1, 3.6, "marine otter", true);
|
||||
Otter.move(20,8,2);
|
||||
Creature Walrus = new MarineMammals("Pupik", 4.4, 1700, "Walrus", true);
|
||||
Walrus.move(35,58,8);
|
||||
Creature Seals = new MarineMammals("Duska", 117.2, 45, "True seals", true);
|
||||
Seals.move(9526,856,258);
|
||||
|
||||
motherEarth.addCreature(Otter);
|
||||
motherEarth.addCreature(Bear);
|
||||
motherEarth.addCreature(Walrus);
|
||||
motherEarth.addCreature(Seals);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
/*for(int i = 0; i < 2000; i++){
|
||||
motherEarth.addCreature(new Bird());
|
||||
motherEarth.addCreature(new Fish());
|
||||
}
|
||||
|
||||
Creature[] array = motherEarth.getArrayCreature();
|
||||
for(int i = 0; i < 2000; i++){
|
||||
array[i].move(10,10,0);
|
||||
}*/
|
||||
|
||||
Muz prvyMuz = new Muz(null, null,34, "Adam", "Prvy");
|
||||
Zena prvaZena = new Zena(null, null,34, "Eva", "Prva");
|
||||
System.out.println(prvyMuz);
|
||||
System.out.println(prvaZena);
|
||||
|
||||
motherEarth.addCreature(prvyMuz);
|
||||
motherEarth.addCreature(prvaZena);
|
||||
|
||||
Clovek prvedieta = prvaZena.splodit(prvyMuz);
|
||||
prvedieta.born(dNow);
|
||||
prvedieta.setName("Kain");
|
||||
|
||||
Clovek druhedieta = prvaZena.splodit(prvyMuz);
|
||||
druhedieta.born(dNow);
|
||||
druhedieta.setName("Abel");
|
||||
|
||||
System.out.println(prvedieta);
|
||||
System.out.println(druhedieta);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
MessageReader AdamovReader = new MessageReader();
|
||||
AdamovReader.obtainFilename(args);
|
||||
AdamovReader.openAndRead();
|
||||
AdamovReader.processMessage();
|
||||
|
||||
MessageWriter AdamovWriter = new MessageWriter(motherEarth.getArrayCreature());
|
||||
AdamovWriter.WriteMessage();
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
Singletone singletone = Singletone.getInstance();
|
||||
singletone.takeUniverse(i_xander_i);
|
||||
|
||||
System.out.println("\n");
|
||||
|
||||
UniverseCarFactory myFactory = new UniverseCarFactory("BMW");
|
||||
|
||||
Car mvp = myFactory.produce("MVP");
|
||||
Car suv = myFactory.produce("SUV");
|
||||
Car sport = myFactory.produce("Sportcar");
|
||||
Car little = myFactory.produce("Littlecar");
|
||||
|
||||
System.out.println(mvp);
|
||||
System.out.println(suv);
|
||||
System.out.println(sport);
|
||||
System.out.println(little);
|
||||
|
||||
ArrayList<Car> warehouse = new ArrayList<Car>();
|
||||
UniverseCarFactory Mercedes = new UniverseCarFactory("Mercedes");
|
||||
UniverseCarFactory BMW = new UniverseCarFactory("BMW");
|
||||
|
||||
for(int i =0; i<1000; i++ ){
|
||||
Car mercedes = Mercedes.produce("Littlecar");
|
||||
Car bmw = BMW.produce("Sportcar");
|
||||
warehouse.add(mercedes);
|
||||
warehouse.add(bmw);
|
||||
}
|
||||
|
||||
i_xander_i.stopUniverse();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user