Example #1
0
        public void Deserialize(FriendPresentWishList.Json[] jsons)
        {
            if (jsons == null)
            {
                throw new InvalidJSONException();
            }
            this.Clear();
            for (int index = 0; index < jsons.Length; ++index)
            {
                FriendPresentWishList.Json json = jsons[index];
                if (json != null)
                {
                    if (json.priority > 0 && json.priority <= this.m_Array.Length)
                    {
                        FriendPresentItemParam presentItemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParam(json.iname);

                        if (presentItemParam != null)
                        {
                            this.m_Array[json.priority - 1] = presentItemParam;
                        }
                    }
                    else
                    {
                        DebugUtility.LogError(string.Format("ウィッシュリスト優先の範囲は 1 ~ {0} まで > {1}", (object)this.m_Array.Length, (object)json.priority));
                    }
                }
            }
        }
        public void Bind(FriendPresentItemParam present, bool checkTimeLimit)
        {
            if (present == null)
            {
                present = FriendPresentItemParam.DefaultParam;
                if (present == null)
                {
                    Debug.LogError((object)"フレンドプレゼントのデフォルトパラメータが存在しません!");
                    return;
                }
            }
            if (checkTimeLimit && !present.IsValid(Network.GetServerTime()))
            {
                present = FriendPresentItemParam.DefaultParam;
            }
            this.m_Present = present;
            if (this.m_Present.item == null)
            {
                return;
            }
            this.m_ItemData = MonoSingleton <GameManager> .Instance.Player.Items.Find((Predicate <ItemData>)(prop => prop.ItemID == present.item.iname));

            if (this.m_ItemData != null)
            {
                return;
            }
            this.m_ItemData = new ItemData();
            this.m_ItemData.Setup(0L, this.m_Present.item, 0);
        }
            private RewardData ReceiveDataToRewardData(FlowNode_ReqPresentList.Api_PresentListExec.JsonItem receiveData)
            {
                FriendPresentItemParam presentItemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParam(receiveData.iname);

                if (presentItemParam == null)
                {
                    return((RewardData)null);
                }
                RewardData rewardData = new RewardData();

                rewardData.Exp        = 0;
                rewardData.Coin       = 0;
                rewardData.Gold       = 0;
                rewardData.Stamina    = 0;
                rewardData.MultiCoin  = 0;
                rewardData.KakeraCoin = 0;
                if (presentItemParam.IsItem())
                {
                    rewardData.AddReward(presentItemParam.item, presentItemParam.num * receiveData.num);
                }
                else
                {
                    rewardData.Gold = presentItemParam.zeny * receiveData.num;
                }
                return(rewardData);
            }
 public void Setup(FriendData friend)
 {
     this.m_Friend = friend;
     if (string.IsNullOrEmpty(friend.Wish))
     {
         this.m_Present = FriendPresentItemParam.DefaultParam;
     }
     else
     {
         this.m_Present = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParam(friend.Wish);
     }
 }
            public Api_PresentListGave(FlowNode_ReqPresentList node, GameObject gobj)
                : base(node)
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)gobj, (UnityEngine.Object)null))
                {
                    return;
                }
                ContentNode component = (ContentNode)gobj.GetComponent <ContentNode>();

                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                FriendPresentRootWindow.ReceiveContent.ItemSource.ItemParam itemParam = component.GetParam <FriendPresentRootWindow.ReceiveContent.ItemSource.ItemParam>();
                if (itemParam == null)
                {
                    return;
                }
                this.m_Param = itemParam.present;
            }
 public void InitializeWantList()
 {
     this.ReleaseWantList();
     if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_WantController, (UnityEngine.Object)null))
     {
         return;
     }
     this.m_WantSource = new FriendPresentRootWindow.WantContent.ItemSource();
     for (int index = 0; index < 3; ++index)
     {
         FriendPresentItemParam friendPresentWish = MonoSingleton <GameManager> .Instance.Player.FriendPresentWishList[index];
         if (friendPresentWish != null)
         {
             this.m_WantSource.Add(new FriendPresentRootWindow.WantContent.ItemSource.ItemParam(friendPresentWish));
         }
         else
         {
             this.m_WantSource.Add(new FriendPresentRootWindow.WantContent.ItemSource.ItemParam((FriendPresentItemParam)null));
         }
     }
     this.m_WantController.Initialize((ContentSource)this.m_WantSource, Vector2.get_zero());
 }
Example #7
0
 public void Deserialize(JSON_FriendPresentItemParam json, MasterParam master = null)
 {
     if (json == null)
     {
         throw new InvalidJSONException();
     }
     this.m_Id   = json.iname;
     this.m_Name = json.name;
     this.m_Expr = json.expr;
     if (!string.IsNullOrEmpty(json.item))
     {
         this.m_Item = MonoSingleton <GameManager> .Instance.GetItemParam(json.item);
     }
     this.m_Num  = json.num;
     this.m_Zeny = json.zeny;
     try
     {
         if (!string.IsNullOrEmpty(json.begin_at))
         {
             this.m_BeginAt = TimeManager.GetUnixSec(DateTime.Parse(json.begin_at));
         }
         if (!string.IsNullOrEmpty(json.end_at))
         {
             this.m_EndAt = TimeManager.GetUnixSec(DateTime.Parse(json.end_at));
         }
         if (!(this.m_Id == "FP_DEFAULT"))
         {
             return;
         }
         FriendPresentItemParam.DefaultParam = this;
     }
     catch (Exception ex)
     {
         DebugUtility.LogError(ex.ToString());
     }
 }
 public void Clear()
 {
     this.m_Present  = (FriendPresentItemParam)null;
     this.m_ItemData = (ItemData)null;
 }
 public ItemParam(FriendPresentItemParam present)
 {
     this.m_Accessor.Setup(present);
 }
 public void Setup(FriendPresentItemParam present)
 {
     this.m_Present = present;
 }