@Secured("IS_AUTHENTICATED_ANONYMOUSLY")
public HeroDTO createNewHero(Gender gender, String belief, String profession,
RaceDTO raceDTO, Byte strength, Byte dexterity, Byte constitution,
Byte intelligence, Byte wisdom, Byte charisma)
{
Race race = DTOFactory.createRace(raceDTO);
if(race == null || race.getStrength() == null || race.getDexterity() == null ||
race.getConstitution() == null || race.getIntelligence() == null ||
race.getWisdom() == null || race.getCharisma() == null)
return null;
Hero h = new EntityBuilder<Hero>(Hero.class)
.withProperty("Gender", gender)
.withProperty("Biography", "")
.withProperty("Belief", belief)
.withProperty("Profession", profession)
.withProperty("Race", race)
.withProperty("Strength", (byte)(strength + race.getStrength()))
.withProperty("Dexterity", (byte)(dexterity + race.getDexterity()))
.withProperty("Constitution", (byte)(constitution + race.getConstitution()))
.withProperty("Intelligence", (byte)(intelligence + race.getIntelligence()))
.withProperty("Wisdom", (byte)(wisdom + race.getWisdom()))
.withProperty("Charisma", (byte)(charisma+ race.getCharisma()))
.Build();
if(!isValid(h)) return null;
return DTOFactory.createHeroDTO(h);
}