HCPlacingMenu = {};
HCPlacingMenu.currentSquare = nil;
HCPlacingMenu.barricade = nil;

function HCPlacingMenu.doPlacingMenu(player, context, worldobjects)
	if getSpecificPlayer(player):getInventory():contains("HCLogbarrier") then
		context:addOption("Place Barrier", worldobjects, HCPlacingMenu.onPlaceBarricade, player);
	end

	if getSpecificPlayer(player):getInventory():contains("HCStonepillar") then
		context:addOption("Place Stone Pillar", worldobjects, HCPlacingMenu.onPlacePillar, player);
	end
end

function HCPlacingMenu.onPlaceBarricade(worldobjects, player)
	local bo = HCBarricade:new(getSpecificPlayer(player), 0);
	bo.player = player;
	getCell():setDrag(bo, player);
end

function HCPlacingMenu.onPlacePillar(worldobjects, player)
	local bo = HCStonePillar:new(getSpecificPlayer(player), 0);
	bo.player = player;
	getCell():setDrag(bo, player);
end

Events.OnFillWorldObjectContextMenu.Add(HCPlacingMenu.doPlacingMenu);
