private bool getConBool(GoddessAstrolabeConditions gacinfo) { if (gacinfo == null) { return(false); } if (gacinfo.type == PremiseType.LEVEL) { return(UserManager.Instance.self.getUserLevel() >= StringKit.toInt(gacinfo.num)); } else if (gacinfo.type == PremiseType.VIP_LEVEL) { return(UserManager.Instance.self.getVipLevel() >= StringKit.toInt(gacinfo.num)); } else if (gacinfo.type == PremiseType.FRIENDS_NUM) { return(FriendsManagerment.Instance.getFriendAmount() >= StringKit.toInt(gacinfo.num)); } else if (gacinfo.type == PremiseType.STAR) { return(GoddessAstrolabeManagerment.Instance.getStarScore() >= StringKit.toInt(gacinfo.num)); } else if (gacinfo.type == PremiseType.RMB) { return(UserManager.Instance.self.getRMB() >= StringKit.toInt(gacinfo.num)); } return(false); }
//返回带颜色的需求描述 private string getConStr(GoddessAstrolabeConditions gacinfo) { if (gacinfo.type == PremiseType.LEVEL) { if (UserManager.Instance.self.getUserLevel() >= StringKit.toInt(gacinfo.num)) { return(Colors.GREEN + gacinfo.desc); } else { return(Colors.RED + gacinfo.desc); } } else if (gacinfo.type == PremiseType.VIP_LEVEL) { if (UserManager.Instance.self.getVipLevel() >= StringKit.toInt(gacinfo.num)) { return(Colors.GREEN + gacinfo.desc); } else { return(Colors.RED + gacinfo.desc); } } else if (gacinfo.type == PremiseType.FRIENDS_NUM) { if (FriendsManagerment.Instance.getFriendAmount() >= StringKit.toInt(gacinfo.num)) { return(Colors.GREEN + gacinfo.desc); } else { return(Colors.RED + gacinfo.desc); } } else if (gacinfo.type == PremiseType.STAR) { int num = GoddessAstrolabeManagerment.Instance.getStarScore(); if (num >= StringKit.toInt(gacinfo.num)) { return(Colors.GREEN + num + "/" + gacinfo.num); } else { return(Colors.RED + num + "/" + gacinfo.num); } } else if (gacinfo.type == PremiseType.RMB) { if (UserManager.Instance.self.getRMB() >= StringKit.toInt(gacinfo.num)) { return(Colors.GREEN + gacinfo.desc); } else { return(Colors.RED + gacinfo.desc); } } return(gacinfo.desc); }
//解析消耗条件 private void parseConditions(string str) { string[] strByLv = str.Split('#'); int maxLv = strByLv.Length; conditions = new GoddessAstrolabeConditions[maxLv]; for (int i = 0; i < maxLv; i++) { GoddessAstrolabeConditions cs = new GoddessAstrolabeConditions(strByLv[i]); conditions[i] = cs; } }