1 package org.catacomb.be;
2
3
4
5 public class Placement {
6
7 Position position;
8 Direction direction;
9 double time;
10
11
12
13 public Placement(double x, double y, double vx, double vy, double t) {
14 position = new Position(x, y);
15 direction = new Direction(vx, vy);
16 time = t;
17 }
18
19 public Placement(Position p, Direction d, double t) {
20 position = new Position(p);
21 direction = new Direction(d);
22 time = t;
23 }
24
25 public Placement(Position p, Direction d) {
26 position = new Position(p);
27 direction = new Direction(d);
28 }
29
30 public Placement(double[] pxy, double[] hxy, double t) {
31 this(pxy[0], pxy[1], hxy[0], hxy[1], t);
32 }
33
34 public Position getPosition() {
35 return position;
36 }
37
38 public Direction getDirection() {
39 return direction;
40 }
41
42 public double getTime() {
43 return time;
44 }
45
46 @SuppressWarnings("boxing")
47 public String toString() {
48 return String.format("pos %.3g %.3g dir %.3g %.3g",
49 position.getX(), position.getY(),
50 direction.getXCpt(), direction.getYCpt());
51 }
52
53 }