// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java
// public class StateDead extends State
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDead(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// 
//     @Override
//     public void enter()
//     {
//         super.enter();
// 
//         model.getFeature(Layerable.class)
//              .setLayer(Integer.valueOf(Constant.LAYER_CORPSE), Integer.valueOf(Constant.LAYER_CORPSE));
//     }
// }
// 
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDeadGold.java
// public final class StateDeadGold extends StateDead
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDeadGold(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// }
// 
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDeadWood.java
// public final class StateDeadWood extends StateDead
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDeadWood(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// }


import com.b3dgs.lionengine.AnimState;
import com.b3dgs.lionengine.Media;
import com.b3dgs.lionengine.Medias;
import com.b3dgs.lionengine.Tick;
import com.b3dgs.lionengine.Updatable;
import com.b3dgs.lionengine.game.feature.Animatable;
import com.b3dgs.lionengine.game.feature.FeatureGet;
import com.b3dgs.lionengine.game.feature.FeatureInterface;
import com.b3dgs.lionengine.game.feature.FeatureModel;
import com.b3dgs.lionengine.game.feature.Identifiable;
import com.b3dgs.lionengine.game.feature.Recyclable;
import com.b3dgs.lionengine.game.feature.Routine;
import com.b3dgs.lionengine.game.feature.Services;
import com.b3dgs.lionengine.game.feature.Setup;
import com.b3dgs.lionengine.game.feature.Spawner;
import com.b3dgs.lionengine.game.feature.Transformable;
import com.b3dgs.lionengine.game.feature.state.StateHandler;
import com.b3dgs.lionengine.game.feature.tile.map.pathfinding.Pathfindable;
import com.b3dgs.warcraft.object.state.StateDead;
import com.b3dgs.warcraft.object.state.StateDeadGold;
import com.b3dgs.warcraft.object.state.StateDeadWood;

        {
            tick.update(extrp);
            if (tick.elapsed(delay))
            {
                spawner.spawn(media, transformable)
                       .getFeature(Effect.class)
                       .start(transformable.getWidth(), transformable.getHeight());
                pathfindable.clearPath();
                identifiable.destroy();
            }
        };
        checkDead = extrp ->
        {
            if (!tick.isStarted() && animatable.is(AnimState.FINISHED) && isDead())
            {
                tick.start();
                check = checkCorpse;
            }
        };
    }

    /**
     * Check if dead.
     * 
     * @return <code>true</code> if dead, <code>false</code> else.
     */
    private boolean isDead()
    {
        return stateHandler.isState(StateDead.class)
               || stateHandler.isState(StateDeadGold.class)

// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDead.java
// public class StateDead extends State
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDead(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// 
//     @Override
//     public void enter()
//     {
//         super.enter();
// 
//         model.getFeature(Layerable.class)
//              .setLayer(Integer.valueOf(Constant.LAYER_CORPSE), Integer.valueOf(Constant.LAYER_CORPSE));
//     }
// }
// 
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDeadGold.java
// public final class StateDeadGold extends StateDead
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDeadGold(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// }
// 
// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/state/StateDeadWood.java
// public final class StateDeadWood extends StateDead
// {
//     /**
//      * Create the state.
//      * 
//      * @param model The model reference.
//      * @param animation The animation reference.
//      */
//     StateDeadWood(EntityModel model, Animation animation)
//     {
//         super(model, animation);
//     }
// }


// Path: warcraft-game/src/main/java/com/b3dgs/warcraft/object/feature/Decayable.java
import com.b3dgs.lionengine.AnimState;
import com.b3dgs.lionengine.Media;
import com.b3dgs.lionengine.Medias;
import com.b3dgs.lionengine.Tick;
import com.b3dgs.lionengine.Updatable;
import com.b3dgs.lionengine.game.feature.Animatable;
import com.b3dgs.lionengine.game.feature.FeatureGet;
import com.b3dgs.lionengine.game.feature.FeatureInterface;
import com.b3dgs.lionengine.game.feature.FeatureModel;
import com.b3dgs.lionengine.game.feature.Identifiable;
import com.b3dgs.lionengine.game.feature.Recyclable;
import com.b3dgs.lionengine.game.feature.Routine;
import com.b3dgs.lionengine.game.feature.Services;
import com.b3dgs.lionengine.game.feature.Setup;
import com.b3dgs.lionengine.game.feature.Spawner;
import com.b3dgs.lionengine.game.feature.Transformable;
import com.b3dgs.lionengine.game.feature.state.StateHandler;
import com.b3dgs.lionengine.game.feature.tile.map.pathfinding.Pathfindable;
import com.b3dgs.warcraft.object.state.StateDead;
import com.b3dgs.warcraft.object.state.StateDeadGold;
import com.b3dgs.warcraft.object.state.StateDeadWood;

        {
            tick.update(extrp);
            if (tick.elapsed(delay))
            {
                spawner.spawn(media, transformable)
                       .getFeature(Effect.class)
                       .start(transformable.getWidth(), transformable.getHeight());
                pathfindable.clearPath();
                identifiable.destroy();
            }
        };
        checkDead = extrp ->
        {
            if (!tick.isStarted() && animatable.is(AnimState.FINISHED) && isDead())
            {
                tick.start();
                check = checkCorpse;
            }
        };
    }

    /**
     * Check if dead.
     * 
     * @return <code>true</code> if dead, <code>false</code> else.
     */
    private boolean isDead()
    {
        return stateHandler.isState(StateDead.class)
               || stateHandler.isState(StateDeadGold.class)

               || stateHandler.isState(StateDeadWood.class);
