Skip to content

Commit

Permalink
Updated model files from local runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasily committed Nov 19, 2015
1 parent 4b7619c commit 54a4d78
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
13 changes: 11 additions & 2 deletions plugins/model/Car.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Car extends RectangularUnit {
private final double enginePower;
private final double wheelTurn;

private final int nextWaypointIndex;
private final int nextWaypointX;
private final int nextWaypointY;

Expand All @@ -35,8 +36,8 @@ public Car(
double width, double height, long playerId, int teammateIndex, boolean teammate, CarType type,
int projectileCount, int nitroChargeCount, int oilCanisterCount, int remainingProjectileCooldownTicks,
int remainingNitroCooldownTicks, int remainingOilCooldownTicks, int remainingNitroTicks,
int remainingOiledTicks, double durability, double enginePower, double wheelTurn, int nextWaypointX,
int nextWaypointY, boolean finishedTrack) {
int remainingOiledTicks, double durability, double enginePower, double wheelTurn, int nextWaypointIndex,
int nextWaypointX, int nextWaypointY, boolean finishedTrack) {
super(id, mass, x, y, speedX, speedY, angle, angularSpeed, width, height);

this.playerId = playerId;
Expand All @@ -54,6 +55,7 @@ public Car(
this.durability = durability;
this.enginePower = enginePower;
this.wheelTurn = wheelTurn;
this.nextWaypointIndex = nextWaypointIndex;
this.nextWaypointX = nextWaypointX;
this.nextWaypointY = nextWaypointY;
this.finishedTrack = finishedTrack;
Expand Down Expand Up @@ -169,6 +171,13 @@ public double getWheelTurn() {
return wheelTurn;
}

/**
* @return Возвращает индекс следующего ключевого тайла в массиве {@code world.waypoints}.
*/
public int getNextWaypointIndex() {
return nextWaypointIndex;
}

/**
* @return Возвращает компоненту X позиции следующего ключевого тайла.
* Конвертировать позицию в точные координаты можно, используя значение {@code game.trackTileSize}.
Expand Down
7 changes: 6 additions & 1 deletion plugins/model/TileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,10 @@ public enum TileType {
/**
* Тайл, выполняющий роль сочленения четырёх других тайлов: со всех сторон от данного тайла.
*/
CROSSROADS
CROSSROADS,

/**
* Тип тайла пока не известен.
*/
UNKNOWN
}
4 changes: 2 additions & 2 deletions plugins/model/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final double getX() {
}

/**
* @return Возвращает Y-координату центра объекта. Ось ординат направлена свеху вниз.
* @return Возвращает Y-координату центра объекта. Ось ординат направлена сверху вниз.
*/
public final double getY() {
return y;
Expand All @@ -63,7 +63,7 @@ public final double getSpeedX() {
}

/**
* @return Возвращает Y-составляющую скорости объекта. Ось ординат направлена свеху вниз.
* @return Возвращает Y-составляющую скорости объекта. Ось ординат направлена сверху вниз.
*/
public final double getSpeedY() {
return speedY;
Expand Down

0 comments on commit 54a4d78

Please sign in to comment.