-- Bundled by luabundle {"version":"1.6.0"}
local __bundle_require, __bundle_loaded, __bundle_register, __bundle_modules = (function(superRequire)
	local loadingPlaceholder = {[{}] = true}

	local register
	local modules = {}

	local require
	local loaded = {}

	register = function(name, body)
		if not modules[name] then
			modules[name] = body
		end
	end

	require = function(name)
		local loadedModule = loaded[name]

		if loadedModule then
			if loadedModule == loadingPlaceholder then
				return nil
			end
		else
			if not modules[name] then
				if not superRequire then
					local identifier = type(name) == 'string' and '\"' .. name .. '\"' or tostring(name)
					error('Tried to require ' .. identifier .. ', but no such module has been registered')
				else
					return superRequire(name)
				end
			end

			loaded[name] = loadingPlaceholder
			loadedModule = modules[name](require, loaded, register, modules)
			loaded[name] = loadedModule
		end

		return loadedModule
	end

	return require, loaded, register, modules
end)(nil)
__bundle_register("__root", function(require, _LOADED, __bundle_register, __bundle_modules)
require("util/DeckCutter")
end)
__bundle_register("util/DeckCutter", function(require, _LOADED, __bundle_register, __bundle_modules)
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Whimsical.
--- DateTime: 2020-09-26 5:50 p.m.
---

---@param index number
---@param player_color string
function onScriptingButtonDown(index, player_color)
  if not (index>=1 and index<=3) then return end

  local count = index * 3

  ---@type Player
  local player = Player[player_color]
  local object = player:getHoverObject()


  if (not object) then return end
  if (object.tag~="Deck") then return end
  if (count >= object:getQuantity()) then return end

  for _ =1, count do
    local target_position = object:positionToWorld(Vector(0, 0, -3.5))

    object:takeObject {
      index = 0,
      position = target_position,
      smooth = false
    }
  end
end
end)
return __bundle_require("__root")