public static void SetFriendRewarded(int id, int gems) { var item = data.privateData.friends.Find(x => x.id == id); if (item == null) { item = new ProfileData.FriendData(); item.id = id; data.privateData.friends.Add(item); } item.rewarded = gems; SaveLocal(); }
public static bool IsFriendRewarded(int id, int level) { if (level < GlobalConfig.Friends.minRewardLevel) { return(false); } var item = data.privateData.friends.Find(x => x.id == id); if (item == null) { item = new ProfileData.FriendData(); item.id = id; data.privateData.friends.Add(item); } return(item.rewarded > 0); }