Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package animal;
- import java.util.Random;
- public class Animal {
- protected final static Random RANDOM;
- protected String signal;
- protected boolean alive;
- protected Position position;
- static{
- RANDOM = new Random();
- }
- public Animal(String signal, Position position) {
- this.signal = signal;
- this.position = position;
- alive = true;
- }
- public String getSignal() {
- return signal;
- }
- public boolean isAlive() {
- return alive;
- }
- public Position getPosition() {
- return position;
- }
- public void move(){
- }
- public void eat(Animal food){
- food.alive = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement