65 lines
2.2 KiB
Java
65 lines
2.2 KiB
Java
package com.company;
|
|
|
|
import com.company.cosmicbody.Planet;
|
|
import com.company.cosmicbody.SolarSystem;
|
|
import com.company.cosmicbody.Star;
|
|
import com.company.universe.Galaxy;
|
|
import com.company.universe.PlanetaryNebula;
|
|
import com.company.universe.Universe;
|
|
|
|
public class Main {
|
|
|
|
public static void main(String[] args) {
|
|
Universe myuniverse = 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);
|
|
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");
|
|
|
|
myuniverse.stopUniverse();
|
|
}
|
|
} |