
cc.Class({
    extends: cc.Component,

    properties: {

        listItemAddress: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

        amount: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

    
        
        otherUserItem: {
            default: null,
            serializable: false,
        },
    },

    setInfo(context) {
        let { item } = context;
        this.otherUserItem = item;
        this.listItemAddress.string = item.address;
        this.amount.string = 0;
    },

    /**
     * 进入其他用户的农场偷菜
     */
    onEnterOtherFarm() {
        GlobalD.GameData.OtherUserInfo = this.otherUserItem;
        if (GlobalD.GameData.OtherUserInfo.length <= 0) {
            console.log('没有用户', GlobalD.GameData.OtherUserInfo);
        }
        GlobalD.GameData.getOtherUserLandList(GlobalD.GameData.OtherUserInfo.userId);
        
    }


});
