-- Provide iteration sorting modifiers

Cheer.Sorted = setmetatable({}, {

	-- Allow increasing sort modifiers
	__add = function (Self, SortingField)
		return { Type = 'Sort', Field = SortingField, Direction = 'Increasing' };
	end;

	-- Allow decreasing sort modifiers
	__sub = function (Self, SortingField)
		return { Type = 'Sort', Field = SortingField, Direction = 'Decreasing' };
	end;

});

setmetatable(Cheer, {

	-- Enable syntactic sugar for loading components
	__call = function (Cheer, ...)

		local ArgCount = #{...};

		-- Direct loading
		if ArgCount == 1 then
			return Cheer.LoadComponent(...);

		-- Template instance loading
		elseif ArgCount == 2 then
			return Cheer.FromTemplate(...);
		end;

	end;

});

return Cheer;
