Examples of Race


Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @Secured("ROLE_SUPERVISOR")
    public RaceDTO createNewRace(String name, String description, Byte strength,
            Byte dexterity, Byte constitution, Byte intelligence, Byte wisdom,
            Byte charisma)
    {
        Race r =  new EntityBuilder<Race>(Race.class)
                .withProperty("Name", name)
                .withProperty("Description", description)
                .withProperty("Strength", (byte)(strength))
                .withProperty("Dexterity", (byte)(dexterity))
                .withProperty("Constitution", (byte)(constitution))
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @Transactional(readOnly=true)
    @Secured("IS_AUTHENTICATED_ANONYMOUSLY")
    public RaceDTO getById(Long id)
    {
        Race h = dao.getById(id);
        return (h!=null)?DTOFactory.createRaceDTO(h):null;
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @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);
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        return skill;
    }

    public static Race createRace(RaceDTO raceDTO){
        Race race = new Race();

        race.setCharisma(raceDTO.charisma);
        race.setConstitution(raceDTO.constitution);
        race.setDescription(raceDTO.description);
        race.setDexterity(raceDTO.dexterity);
        race.setId(raceDTO.id);
        race.setIntelligence(raceDTO.intelligence);
        race.setName(raceDTO.name);
        race.setStrength(raceDTO.strength);
        race.setWisdom(raceDTO.wisdom);

        return race;
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        assertTrue(races.contains(race)&&races.contains(race2));
    }

    @Test
    public void testDelete(){
        Race race = new Race();
        race.setName("Ogloj");
        race.setDescription("Velky cerv");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);

        raceDAO.create(race);
        List<Race> races = raceDAO.getAll();
        Long raceId = race.getId();

        raceDAO.delete(race);
        assertNull(raceDAO.getById(raceId));
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        hero.setCharisma(new Byte("4"));
        hero.setName("Cohen the Barbarian");
        hero.setGender(Gender.MALE);
        hero.setProfession("Warrior");

        Race race = new Race();
        race.setName("jarda");
        race.setDescription("linux core developer");
        race.setCharisma(Byte.MIN_VALUE);
        race.setConstitution(Byte.MIN_VALUE);
        race.setDexterity(Byte.MIN_VALUE);
        race.setIntelligence(Byte.MIN_VALUE);
        race.setStrength(Byte.MIN_VALUE);
        race.setWisdom(Byte.MIN_VALUE);
        raceDao.create(race);

        hero.setRace(race);//TODO
        hero.setConstitution(new Byte("8"));
        hero.setDexterity(new Byte("7"));
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    @Autowired
    private SkillDAO skillDao;

    public Squad getSquad(){

        Race race = getRace();
        raceDao.create(race);

        Skill skill = getSkill();
        skillDao.create(skill);
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        List<Squad> deletedSquads = squadDAO.getAll();
        assertTrue(deletedSquads.isEmpty());
    }

    public Race getRace(){
        Race race = new Race();
        race.setName("SimpleRace");
        race.setDescription("Descript");
        race.setStrength(new Byte("61"));
        race.setDexterity(new Byte("61"));
        race.setConstitution(new Byte("15"));
        race.setIntelligence(new Byte("51"));
        race.setWisdom(new Byte("41"));
        race.setCharisma(new Byte("14"));
        return race;
    }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

    }

    @Test
    public void testGetAll(){
        squad = getSquad();
        Race race = getRace();
        raceDao.create(race);

        Skill skill = getSkill();
        skillDao.create(skill);
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.entities.Race

        assertTrue(squads.contains(anotherSquad));
    }

    @Test
    public void testAddMember(){
        Race race = getRace();
        Squad squadS = getSquad();
        Skill skill = getSkill();
        Hero leader = getHero(race, skill);

        raceDao.create(race);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.