双十一,一天就要收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(); } }
事实上有那么恐怖吗?
那就顺便赚个外快吧,双十一推出最新业务:在当天凌晨代错误输入老婆支付宝账号、网银密码三次,不成功不要钱,反正也没有剩下的了吧。