-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIWorldMap.java
More file actions
56 lines (51 loc) · 1.37 KB
/
IWorldMap.java
File metadata and controls
56 lines (51 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package agh.cs.lab2;
/**
* Interface responsible for interacting with the map of the world.
*
* @author apohllo
*
*/
public interface IWorldMap {
/**
* Indicates if any object can move to the given position.
*
* @param position
* The position checked for the movement possibility.
* @return True if the object can move to that position.
*/
boolean canMoveTo(Position position);
/**
* Add a car the map.
*
* @param car
* The car to add.
* @return True if the car was added.
*/
boolean add(Car car);
/**
* Move the cars on the map according to the provided move directions. Every
* n-th direction should be sent the n-th car on the map.
*
* @param directions
* Array of move directions.
*/
void run(MoveDirection[] directions);
/**
* Returns true if given position on the map is occupied. Should not be
* confused with canMove since there might be empty positions where the car
* cannot move.
*
* @param position
* Position to check.
* @return True if the position is occupied.
*/
boolean isOccupied(Position position);
/**
* Return object at given position.
*
* @param position
* The position of the object.
* @return Object or null if the position is not occupied.
*/
Object objectAt(Position position);
}