Facebook
From Whipped Mousedeer, 7 Years ago, written in Plain Text.
This paste is a reply to Galaxy from Crimson Pig - go back
Embed
Viewing differences between Galaxy and Re: Galaxy
\npackage javaapplication1;

import java.util.Random;


public class Galaxy extends Statek {
    public Galaxy(String mNazwa, int stan) {
        super(mNazwa, stan);
    }
    
    public void wyswietl(){
        String stany = stan == 1 ? "Sprawny" : "Niesprawny";
        System.out.println("Galaxy " + mNazwa);
        System.out.println("Stan: " + stany);
    }
    
    
    
    public void bronsie(Statek oponent){
        if(this.stan == 1){
            System.out.println(this.getClass().getSimpleName() + mNazwa + "Broni sie");
            Random r = new Random();
            int wynik = r.nextInt(2);
            oponent.ustawStan(0);
        }
    }
}