dev.robocode.tankroyale.botapi.mapper.InitialPositionMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robocode-tankroyale-bot-api Show documentation
Show all versions of robocode-tankroyale-bot-api Show documentation
Robocode Tank Royale Bot API for Java
package dev.robocode.tankroyale.botapi.mapper;
import dev.robocode.tankroyale.botapi.InitialPosition;
/**
* Utility class for mapping an initial starting position.
*/
public final class InitialPositionMapper {
// Hide constructor to prevent instantiation
private InitialPositionMapper() {
}
public static dev.robocode.tankroyale.schema.InitialPosition map(final InitialPosition source) {
if (source == null) return null;
var initialPosition = new dev.robocode.tankroyale.schema.InitialPosition();
initialPosition.setX(source.getX());
initialPosition.setY(source.getY());
initialPosition.setDirection(source.getDirection());
return initialPosition;
}
}