Example #1
0
        public static State <Wife> Instance()
        {
            if (instance == null)
            {
                instance = new DoHousework();
            }

            return(instance);
        }
Example #2
0
 public override void Execute(Wife pWife)
 {
     Console.WriteLine(String.Format("\n{0}: zzzz...",
                                     EntityManager.Instance().GetNameOfEntity(pWife.ID)));
     if (pWife.HusbandIsNotSleeping())
     {
         pWife.ChangeState(DoHousework.Instance());
     }
 }
Example #3
0
        public override void Execute(Wife pWife)
        {
            int maxSpend = pWife.GoldInBank;

            if (maxSpend > 10)
            {
                maxSpend = 10;
            }

            int iGoldSpent = 1 + pWife.rand.Next(maxSpend);

            Console.WriteLine(String.Format("\n{0}: Какое миленькое платьице! И всего за {1} золота! Я беру его",
                                            EntityManager.Instance().GetNameOfEntity(pWife.ID), iGoldSpent));
            pWife.SpendGold(iGoldSpent);
            pWife.ChangeState(DoHousework.Instance());
        }
Example #4
0
        public override void Execute(Wife pWife)
        {
            int maxSpend = pWife.GoldInBank;

            if (maxSpend > 5)
            {
                maxSpend = 5;
            }

            int iGoldSpent = 1 + pWife.rand.Next(maxSpend);

            Console.WriteLine(String.Format("\n{0}: Накупила кучу всяких вкусностей на {1} золота",
                                            EntityManager.Instance().GetNameOfEntity(pWife.ID), iGoldSpent));

            pWife.SpendGold(iGoldSpent);
            pWife.ChangeState(DoHousework.Instance());
        }
Example #5
0
        public override bool OnMessage(Wife pWife, Telegram msg)
        {
            switch (msg.Msg)
            {
            case (int)message_type.Msg_StewReady:
            {
                Debugger.Instance().WriteLine(String.Format("\nMessage received by {0} at time: {1}", EntityManager.Instance().GetNameOfEntity(pWife.ID),
                                                            Clock.Instance().GetCurrentTime()));
                Console.WriteLine("\n{0}: Стейк готов! Пойдем кушать!", EntityManager.Instance().GetNameOfEntity(pWife.ID));

                //let hubby know the stew is ready
                MessageDispatcher.Instance().DispatchMessage(SEND_MSG_IMMEDIATELY,
                                                             pWife.ID,
                                                             pWife.HusbandsId,
                                                             (int)message_type.Msg_StewReady,
                                                             null);
                pWife.ChangeState(DoHousework.Instance());
                pWife.SetCooking(false);
                return(true);
            }
            }

            return(false);
        }
Example #6
0
 public override void Execute(Wife pWife)
 {
     Console.WriteLine(String.Format("\n{0}: Ахххх! Какая красота!",
                                     EntityManager.Instance().GetNameOfEntity(pWife.ID)));
     pWife.ChangeState(DoHousework.Instance());
 }