InputSystem.PrepareMove C# (CSharp) Method

PrepareMove() private method

private PrepareMove ( Entity, player, ICollection entitiesInSpot ) : bool
player Entity,
entitiesInSpot ICollection
return bool
    bool PrepareMove(Entity player, ICollection<Entity> entitiesInSpot)
    {
        if (entitiesInSpot.ContainsComponent(ComponentIds.AIMove))
        {
            // enemy there, can't do anything
            return false;
        }

        // handle walls
        Entity wall = null;
        if (entitiesInSpot.ContainsComponent(ComponentIds.Destructible, out wall))
        {
            wall.DamageDestructible();
            pool.PlayAudio(player.audioAttackSource);

            if (player.hasView)
            {
                player.AddAnimation(Animation.playerChop);
            }
            // nothing to do now that we've chopped
            return false;
        }

        // otherwise we can move
        return true;
    }