Search in sources :

Example 1 with ALLEGIENCE

use of main.system.data.PlayerData.ALLEGIENCE in project Eidolons by IDemiurge.

the class PlayerManager method initPlayerFromString.

public DC_Player initPlayerFromString(String data) {
    PlayerData dataUnit = new PlayerData(data);
    ALLEGIENCE allegience = new EnumMaster<ALLEGIENCE>().retrieveEnumConst(ALLEGIENCE.class, dataUnit.getValue(PLAYER_VALUE.ALLEGIENCE));
    if (allegience == null) {
        allegience = ALLEGIENCE.NEUTRAL;
    }
    FLAG_COLOR color = new EnumMaster<FLAG_COLOR>().retrieveEnumConst(FLAG_COLOR.class, dataUnit.getValue(PLAYER_VALUE.COLOR));
    if (color == null) {
        color = getRandomColorFlag();
    }
    DC_Player player = new DC_Player(dataUnit.getValue(PLAYER_VALUE.NAME), color, dataUnit.getValue(PLAYER_VALUE.EMBLEM), dataUnit.getValue(PLAYER_VALUE.PORTRAIT), allegience);
    player.setMainHeroName(dataUnit.getValue(PLAYER_VALUE.MAIN_HERO));
    return player;
}
Also used : ALLEGIENCE(main.system.data.PlayerData.ALLEGIENCE) PlayerData(main.system.data.PlayerData) FLAG_COLOR(main.system.graphics.ColorManager.FLAG_COLOR)

Aggregations

PlayerData (main.system.data.PlayerData)1 ALLEGIENCE (main.system.data.PlayerData.ALLEGIENCE)1 FLAG_COLOR (main.system.graphics.ColorManager.FLAG_COLOR)1