Search in sources :

Example 6 with DC_UnitModel

use of eidolons.entity.obj.unit.DC_UnitModel in project Eidolons by IDemiurge.

the class StructureResetter method resetFacing.

public void resetFacing() {
    FACING_DIRECTION facing = null;
    if (facing != null) {
        setProperty(PROPS.FACING_DIRECTION, facing.getName());
    } else {
        String name = getProperty(PROPS.FACING_DIRECTION);
        facing = (new EnumMaster<FACING_DIRECTION>().retrieveEnumConst(FACING_DIRECTION.class, name));
        if (facing == null) {
            if (getEntity().getDirection() != null) {
                FacingMaster.getFacingFromDirection(getEntity().getDirection());
            } else if (getRef().getObj(KEYS.SUMMONER) != null) {
                facing = ((DC_UnitModel) getRef().getObj(KEYS.SUMMONER)).getFacing();
            } else {
                facing = FacingMaster.getRandomFacing();
            }
        }
    }
    getEntity().setFacing(facing);
// getEntity().setFacing(facing);
}
Also used : FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) DC_UnitModel(eidolons.entity.obj.unit.DC_UnitModel)

Example 7 with DC_UnitModel

use of eidolons.entity.obj.unit.DC_UnitModel in project Eidolons by IDemiurge.

the class UnitResetter method resetFacing.

public void resetFacing() {
    FACING_DIRECTION facing = null;
    if (facing != null) {
        setProperty(PROPS.FACING_DIRECTION, facing.getName());
    } else {
        String name = getProperty(PROPS.FACING_DIRECTION);
        facing = (new EnumMaster<FACING_DIRECTION>().retrieveEnumConst(FACING_DIRECTION.class, name));
        if (facing == null) {
            if (getEntity().getDirection() != null) {
                FacingMaster.getFacingFromDirection(getEntity().getDirection());
            } else if (getRef().getObj(KEYS.SUMMONER) != null) {
                facing = ((DC_UnitModel) getRef().getObj(KEYS.SUMMONER)).getFacing();
            } else {
                facing = FacingMaster.getRandomFacing();
            }
        }
    }
    getEntity().setFacing(facing);
}
Also used : FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) DC_UnitModel(eidolons.entity.obj.unit.DC_UnitModel)

Aggregations

DC_UnitModel (eidolons.entity.obj.unit.DC_UnitModel)7 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)3 Obj (main.entity.obj.Obj)2 Coordinates (main.game.bf.Coordinates)2 DC_HeroSlotItem (eidolons.entity.item.DC_HeroSlotItem)1 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 DC_Cell (eidolons.entity.obj.DC_Cell)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 FACING_SINGLE (main.content.enums.entity.UnitEnums.FACING_SINGLE)1 BfObj (main.entity.obj.BfObj)1 DIRECTION (main.game.bf.Coordinates.DIRECTION)1 Path (main.game.bf.pathing.Path)1