示例#1
0
        public void init(string _unitName, string _path)
        {
            unitName = _unitName;
            //outputMessage = _outputMessage;
            //getQQNick = _getQQNick;
            path = _path;

            users = new Dictionary <long, BTCUser>();
            // read users
            // wallet
            var lines = FileHelper.readLines(path + walletf);

            foreach (var line in lines)
            {
                BTCWallet wallet = new BTCWallet(line);
                if (wallet.uid > 0)
                {
                    // success
                    if (!users.ContainsKey(wallet.uid))
                    {
                        users[wallet.uid] = new BTCUser(wallet.uid);
                    }
                    users[wallet.uid]._wallet = wallet;
                }
            }
            // benefit
            lines = FileHelper.readLines(path + benefitf);
            foreach (var line in lines)
            {
                BTCBenefit benefit = new BTCBenefit(line);
                if (benefit.uid > 0)
                {
                    // success
                    if (!users.ContainsKey(benefit.uid))
                    {
                        users[benefit.uid] = new BTCUser(benefit.uid);
                    }
                    users[benefit.uid]._benefit = benefit;
                }
            }
        }
示例#2
0
        //public BTCUser()
        //{
        //    qq = -1;
        //    wallet = new BTCWallet();
        //    benefit = new BTCBenefit();
        //}

        public BTCUser(long _qq)
        {
            qq       = _qq;
            _wallet  = new BTCWallet(qq);
            _benefit = new BTCBenefit(qq);
        }