function GameStateExists(state)
    return game_state.state:HasState(state)
end

function HasGameState(state, value)
    local is_state_exists = game_state.state:HasState(state)
    return is_state_exists and (not value or game_state.state:GetState(state):HasValue(value))
end

function AddGameState(state, value)
    game_state.state:AddState(state, value)
end

function GetGameState(state)
    return game_state.state:GetState(state)
end

function SetGameState(state, value)
    game_state.state:SetState(state, value)
end

function RemoveGameState(state, value)
    if not value then
        if GameStateExists(state) then
            game_state.state:RemoveState(state)
        end
    else
        if HasGameState(state, value) then
            game_state.state:RemoveState(state, value)
        end            
    end
end

function GameStateClear()
    if GetGameManager():GetCurrPlayer() then
        local state = GetGameManager():GetCurrPlayer():GetGameState()
        state:Clear();                
    end
end

