简单地总结下双十一对“老婆”的评价

简单地总结下双十一对“老婆”的评价
强烈推介IDEA2021.1.3破解激活,IntelliJ IDEA 注册码,2021.1.3IDEA 激活码  

大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说简单地总结下双十一对“老婆”的评价,希望能够帮助大家进步!!!

双十一,一天就要收n条邮件,都是各种优惠券促销什么的,另外听到最多的就是要按住“老婆”,以免发生悲剧。

有些人要请假回家看住老婆,有的打算在那天上班前输错三次支付宝密码。当然,还有更多......

是我还年轻,我无法理解的了。我想,就算结婚了也懒得管钱吧,多麻烦的事情啊。

花了几分钟,就简单地记录下大家对“老婆”的描述,大致上就是这么个意思:

    public class Money
    {
        public double Amount { get; private set; }
    }

    public interface IHusband
    {
        double AllMoney { get;}

        Money TakeMoneyFrom(double amount);
    }

    public abstract class WomanBase
    {
        public WomanBase()
        {
            var timer = new Random(this.MaxBurnMoneyCycleInMilliSeconds);
            var burnMoneyThread = new Thread(new ThreadStart(() =>
            {
                while (true)
                {
                    Thread.Sleep(timer.Next());
                    BurnMoney();
                }
            }));
        }

        public int MaxBurnMoneyCycleInMilliSeconds = int.MaxValue;

        public abstract void BurnMoney();
    }

    public class Wife : WomanBase
    {
        IHusband _husband;
        public IHusband Husband
        {
            get
            {
                return _husband;
            }
            private set
            {
                _husband = value;
            }
        }

        public bool Marry(IHusband newHusband)
        {
            if (Husband != null && Husband.AllMoney > 0
                || newHusband.AllMoney > Husband.AllMoney)
            {
                Husband = newHusband;
                return true;
            }

            return false;
        }

        public void Divorce()
        {
            throw new Exception();
        }

        public void Divorce(Money aLotOfMoney)
        {
            Husband = null;
        }

        public override void BurnMoney()
        {
            var random = new Random(Convert.ToInt32(Husband.AllMoney));
            var money = Husband.TakeMoneyFrom(random.Next());
            money = null;
            GC.Collect();
        }
    }

事实上有那么恐怖吗?

那就顺便赚个外快吧,双十一推出最新业务:在当天凌晨代错误输入老婆支付宝账号、网银密码三次,不成功不要钱,反正也没有剩下的了吧。

 

转载于:https://www.cnblogs.com/indream/p/3412741.html

本文来源weixin_30595035,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/29684

发表评论