RuneHive-Game
Loading...
Searching...
No Matches
ForceMovement.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.mob.player;
2
3import com.runehive.game.world.entity.mob.Direction;
4import com.runehive.game.world.position.Position;
5
6public class ForceMovement {
7 private final Position start;
8 private final Position end;
9 private final int speed;
10 private final int reverseSpeed;
11 private final int direction;
12
14 this.start = start;
15 this.end = end;
16 this.speed = speed;
17 this.reverseSpeed = reverseSpeed;
18 switch (direction) {
19 case NORTH:
20 this.direction = 0;
21 break;
22 case EAST:
23 this.direction = 1;
24 break;
25 case SOUTH:
26 this.direction = 2;
27 break;
28 case WEST:
29 this.direction = 3;
30 break;
31 default:
32 throw new IllegalArgumentException(String.format("Invalid force movement direction=%s", direction.name()));
33 }
34 }
35
36 public Position getStart() {
37 return start;
38 }
39
40 public Position getEnd() {
41 return end;
42 }
43
44 public int getSpeed() {
45 return speed;
46 }
47
48 public int getReverseSpeed() {
49 return reverseSpeed;
50 }
51
52 public int getDirection() {
53 return direction;
54 }
55
56}
ForceMovement(Position start, Position end, int speed, int reverseSpeed, Direction direction)
Represents a single tile on the game world.
Definition Position.java:14
Represents the enumerated directions an entity can walk or face.