示例#1
0
    protected override void Execute(List <GameEntity> entities)
    {
        IntVector2 pos = IntVector2.DefaultValue();

        foreach (GameEntity entity in entities)
        {
            pos = entity.move.target;

            for (int x = pos.x - 1; x <= pos.x + 1; x++)
            {
                for (int y = pos.y - 1; y <= pos.y + 1; y++)
                {
                    try
                    {
                        Contexts.sharedInstance.game.GetEntitiesWithMove(new IntVector2(x, y))
                        .SingleEntity()
                        .isDestroyed = true;
                    }
                    catch (Exception)
                    {
                        continue;
                    }
                }
            }
        }
    }