contract GameUtil {
    uint256 ethWei = 1 ether;

    // 获取会员等级
    function getMemberLevel(uint256 value) public view returns(uint256){
        if(value>=1*ethWei && value<=5*ethWei){
            return 1;
        }if(value>=6*ethWei && value<=10*ethWei){
            return 2;
        }if(value>=11*ethWei && value<=15*ethWei){
            return 3;
        }
        return 0;
    }

    //获取节点等级
    function getNodeLevel(uint256 value) public view returns(uint256){
        if(value >0 && value<=6*ethWei){
            return 1;
        }if(value >0 &&  value<=11*ethWei){
            return 2;
        }if(value >0 && value>11*ethWei){
            return 3;
        }
    }

    //获取会员等级奖励 /1000
    function getMemberReward(uint256 level) public  pure returns(uint256){
        if(level == 1){
            return 5;
        }if(level == 2){
            return 7;
        }if(level == 3) {
            return 10;
        }
        return 0;
    }

    //获取会员等级系数   /10
    function getHystrixReward(uint256 level) public pure returns(uint256){
        if(level == 1){
            return 3;
        }if(level == 2){
            return 6;
        }if(level == 3) {
            return 10;
        }return 0;
    }

    //获取节点奖励   /100
    function getNodeReward(uint256 nodeLevel,uint256 level,bool superReward) public pure returns(uint256){
        if(nodeLevel == 1 && level == 1){
            return 50;
        }if(nodeLevel == 2 && level == 1){
            return 70;
        }if(nodeLevel == 2 && level == 2){
            return 50;
        }if(nodeLevel == 3) {
            if(level == 1){
                return 100;
            }if(level == 2){
                return 70;
            }if(level == 3){
                return 50;
            }if(level >= 4 && level <= 10){
                return 10;
            }if(level >= 11 && level <= 20){
                return 5;
            }if(level >= 21){
                if(superReward == true){
                    return 10;
                }
                else{
                    return 1;
                }
            }
        } return 0;
    }

    function compareStr (string memory _str,string memory str) public pure returns(bool) {
         bool checkResult = false;
        if(keccak256(abi.encodePacked(_str)) == keccak256(abi.encodePacked(str))) {
            checkResult = true;
        }
        return checkResult;
    }
}
function getNodeReward(uint256 nodeLevel,uint256 level,bool superReward) public pure returns(uint256){
        if(nodeLevel == 1 && level == 1){
            return 50;
        }if(nodeLevel == 2 && level == 1){
            return 70;
        }if(nodeLevel == 2 && level == 2){
            return 50;
        }if(nodeLevel == 3) {
            if(level == 1){
                return 100;
            }if(level == 2){
                return 70;
            }if(level == 3){
                return 50;
            }if(level >= 4 && level <= 10){
                return 10;
            }if(level >= 11 && level <= 20){
                return 5;
            }if(level >= 21){
                if(superReward == true){
                    return 10;
                }
                else{
                    return 1;
                }
            }
        } return 0;
    }
//获取节点奖励   /100