All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dc.riot.lol.rx.model.game.PlayerPosition Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package org.dc.riot.lol.rx.model.game;

/**
 * Player position used by the {@link RawStatsDto}.
 * 
 * @author Dc
 * @since 1.0.0
 */
public enum PlayerPosition {
    TOP(1), MIDDLE(2), JUNGLE(3), BOT(4);

    private final int code;
    PlayerPosition(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }
    
    @Override
    public String toString() {
    	return String.valueOf(code);
    }

    public static PlayerPosition from(int code) {
        for (PlayerPosition pp : PlayerPosition.values()) {
            if (pp.code == code) {
                return pp;
            }
        }

        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy