use of main.system.data.PlayerData 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;
}
Aggregations