added lab16 ex1
This commit is contained in:
30
src/lab16_composite/ex1/Player.java
Normal file
30
src/lab16_composite/ex1/Player.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package lab16_composite.ex1;
|
||||
|
||||
public class Player implements Entity {
|
||||
private int number;
|
||||
|
||||
public Player(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[Player " + number + "]";
|
||||
}
|
||||
|
||||
public void cry() {
|
||||
System.out.println(this + " ouin ouin");
|
||||
}
|
||||
|
||||
public void enterField() {
|
||||
System.out.println(this + " let's go !");
|
||||
}
|
||||
|
||||
public void simulateInjury() {
|
||||
System.out.println(this + " ouch !");
|
||||
}
|
||||
|
||||
public void shoot() {
|
||||
System.out.println(this + " encara Messi...");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user