this isn't supposed to be hard na
package com.codegym.task.task23.task2312;
public class Room {
//creating description for the snake and room
private int width;
private int height;
private static Snake snake;
private Mouse mouse;
public static Room game;
public int getWidth(){
return width;
}
public int getHeight(){
return height;
}
public Snake getSnake(){
return snake;
}
public Mouse getMouse(){
return mouse;
}
public void setWidth(int width){
this.width = width;
}
public void setHeight(int height){
this.height = height;
}
public void setSnake(Snake snake){
this.snake = snake;
}
public void setMouse(Mouse mouse){
this.mouse = mouse;
}
public Room(int width,int height, Snake snake){
this.width = width;
this.height = height;
this.snake = snake;
}
public void run(){
}
public void print(){
}
public void createMouse(){
//You must write and implement the createMouse() method in the Room class.
//This method should just create a new mouse with random coordinates in the room.
int x = (int)(Math.random()* width);
int y = (int)(Math.random()* height);
setMouse(new Mouse(x,y));
}
public void eatMouse(){
createMouse();
}
public void sleep(){
}
public static void main(String[] args) {
Snake snakes = new Snake(0,0);
game = new Room(10,10,snakes);
game.getSnake().setDirection(SnakeDirection.DOWN); //setting the direction of the snake
//calling methods on the room object
game.createMouse();
game.run();
}
}