public static PlayerStrongholdAttribute ConvertToPlayerstrongholdAttribute(PlayerStrongHoldGrowUpAttribute info) { PlayerStrongholdAttribute playerStrongholdAttribute = new PlayerStrongholdAttribute(); playerStrongholdAttribute.strongholdIndex = info.strongholdIndex; playerStrongholdAttribute.medalLevel = info.playerStrongholdMedalLevel; playerStrongholdAttribute.strongholdNickName = info.strongholdNickName; playerStrongholdAttribute.strongholdPosition = info.strongholdPosition; playerStrongholdAttribute.coupons = info.coupons; return(playerStrongholdAttribute); }
private IEnumerator GetCurrentLocationRangeOtherData(string _url, WWWForm _wForm, System.Action <List <PlayerStrongholdAttribute>, List <BusinessStrongholdAttribute> > callback) { AndaUIManager.Instance.OpenWaitBoard(true); WWW postData = new WWW(_url, _wForm); yield return(postData); AndaUIManager.Instance.OpenWaitBoard(false); if (postData.error != null) { Debug.Log(postData.error); } else { var data = JsonMapper.ToObject <Region>(postData.text); List <PlayerStrongHoldGrowUpAttribute> tmpPlayerStronghold = data.resRegion.PlayerStrongHoldlist; List <BusinessStrongholdGrowUpAttribute> tmpBusinessStronghold = data.resRegion.BusinessStrongHoldlist; List <PlayerStrongholdAttribute> playerStrongholds = new List <PlayerStrongholdAttribute>(); List <BusinessStrongholdAttribute> businessStrongholds = new List <BusinessStrongholdAttribute>(); foreach (var go in tmpPlayerStronghold) { PlayerStrongholdAttribute psa = ConvertTool.ConvertToPlayerstrongholdAttribute(go); //Debug.Log("go.strongholdGloryValue" + go.strongholdGloryValue); playerStrongholds.Add(psa); } foreach (var go in tmpBusinessStronghold) { BusinessStrongholdAttribute bsa = ConvertTool.ConvertToBussinessStrongholdAttribute(go); bsa.strongholdID = 30005; businessStrongholds.Add(bsa); } callback(playerStrongholds, businessStrongholds); } }