include("data/scripts/Scenes/Level/BoardEH.lua")

class 'z032' (BoardEH)

function z032:__init(board)
    BoardEH.__init(self, board)
end

function z032:Deinit()
	BoardEH.Deinit(self)
end

function z032:OnLoaded()
    BoardEH.OnLoaded(self)

	--self.board:LockRows(0, 0)

	local function show_hint()
		if not self.is_in_preview_mode then
			self.hint = Hint(13, 8, "Hint", L("032_DOUBLE_BACK"), Vector(400., 60.), Vector(350., 350.))
			local ss = CreateSceneSprite(Texture("data/graphics/Level/Match3/Backs/Back1"), Rect(50, 0, 50, 50))
			ss:GetVisualObject():SetHotSpot(Vector(25, 25))
			self.hint:AddObject(ss, 10., Hint.left_side)
			self.hint:SetVisible(true, 0.2)
		end
	end
	self.timer:Add(show_hint, self.board.show_time)
end

function z032:MakePreview(start_button, cancel_button, auto_button, help_button)
    BoardEH.MakePreview(self, start_button, cancel_button, auto_button, help_button)
end

function z032:OnRebuildBorder()
    BoardEH.OnRebuildBorder(self)
end

function z032:Update(dt)
    BoardEH.Update(self, dt)
end

function z032:OnLevelWinConditionFinish(level, condition, v1, v2)
    BoardEH.OnLevelWinConditionFinish(self, level, condition, v1, v2)
end

function z032:OnAllWinConditionsFinish()
    BoardEH.OnAllWinConditionsFinish(self)
end

function z032:AddToAcidOrbsArrayIfNeeded(cell)
    BoardEH.AddToAcidOrbsArrayIfNeeded(self, cell)
end

function z032:OnInputEvent(event)
    BoardEH.OnInputEvent(self, event)
end

function z032:OnResize(m, n)
    BoardEH.OnResize(self, m, n)
end

function z032:OnSelectCell(coord, anchor)
    BoardEH.OnSelectCell(self, coord, anchor)
end

function z032:OnDeselectCell()
    BoardEH.OnDeselectCell(self)
end

function z032:InterchangeCellsRequest(c1, c2)
    return BoardEH.InterchangeCellsRequest(self, c1, c2)
end

function z032:TestChipFallDownPossibility(coord)
    return BoardEH.TestChipFallDownPossibility(self, coord)
end

function z032:ProceedMatchRequest(match)
	return BoardEH.ProceedMatchRequest(self, match)
end

function z032:OnProceedMatch(match, falling_chips)
    BoardEH.OnProceedMatch(self, match, falling_chips)
end

function z032:OnCellMatch(coord)
    BoardEH.OnCellMatch(self, coord)
end

function z032:OnChipMoveFinish(coord)
    BoardEH.OnChipMoveFinish(self, coord)
end

function z032:OnReshuffleFinish()
    BoardEH.OnReshuffleFinish(self)
end

function z032:OnCellNewChip(coord)
    BoardEH.OnCellNewChip(self, coord)
end

function z032:OnCellFree(coord)
    BoardEH.OnCellFree(self, coord)
end

function z032:OnCellJobsStart(coord)
    BoardEH.OnCellJobsStart(self, coord)
end

function z032:OnCellJobsFinish(coord)
    BoardEH.OnCellJobsFinish(self, coord)
end

function z032:OnAddCell(cell, coord)
    BoardEH.OnAddCell(self, cell, coord)
end

function z032:OnRemoveCell(coord)
    BoardEH.OnRemoveCell(self, coord)
end

function z032:OnHint()
    BoardEH.OnHint(self)
end

function z032:OnObjectMouseEnter(obj, pos)
    BoardEH.OnObjectMouseEnter(self, obj, pos)
end

function z032:OnObjectMouseLeave(obj, pos)
    BoardEH.OnObjectMouseLeave(self, obj, pos)
end

function z032:OnObjectMouseMove(obj)
    BoardEH.OnObjectMouseMove(self, obj)
end

function z032:OnObjectMouseDown(obj, key, pos)
    BoardEH.OnObjectMouseDown(self, obj, key, pos)

    if self.hint and self.hint:IsVisible() and not self.hint:IsChangingState() then
        self.hint:SetVisible(false, 0.3)
		--self.board:UnlockRows(0, 0)
	end
end

function z032:OnObjectMouseUp(obj, key, pos)
    BoardEH.OnObjectMouseUp(self, obj, key, pos)
end

function z032:IsAllObjectsFound()
    return true and BoardEH.IsAllObjectsFound(self)
end

function z032:GetNObjectsToFind()
    return BoardEH.GetNObjectsToFind(self)
end

function z032:OnLevelResultShown(level_result)
    BoardEH.OnLevelResultShown(self, level_result)
end