Пример #1
0
        public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
        {
            var nextAction = SelectHighPriorityMessage(msgList);

            if (nextAction.IsREACH())
            {
                return context.OnReach(nextAction.actor);

            }
            else if (nextAction.IsANKAN())
            {
                return context.OnAnkan(nextAction.actor, nextAction.consumed);
            }
            else if (nextAction.IsKAKAN())
            {
                return context.OnKakan(nextAction.actor, nextAction.pai, nextAction.consumed);
            }
            else if (nextAction.IsHORA())
            {
                return context.OnHora(nextAction.actor, nextAction.target, nextAction.pai);
            }
            else if (nextAction.IsDAHAI())
            {
                return context.OnDahai(nextAction.actor, nextAction.pai, nextAction.tsumogiri);
            }
            else
            {
                // it is error if this line executed;
               Debug.Assert(false);
               return false;
            }
        }
Пример #2
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     var nextAction = SelectHighPriorityMessage(msgList);
     return context.OnDahai(nextAction.actor, nextAction.pai, nextAction.tsumogiri);
 }
Пример #3
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     return context.OnEndKyoku();
 }
Пример #4
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msg)
 {
     return context.OnTsumo();
 }
Пример #5
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     if (msgList.Exists(e => e.IsHORA()))
     {
         var nextAction = msgList.First(e => e.IsHORA());
         return context.OnHora(nextAction.actor, nextAction.target, nextAction.pai);
     }
     else
     {
         return context.OnReachAccept();
     }
 }
Пример #6
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     var nextAction = msgList.First(e => e.IsDAHAI());
     return context.OnReachDahai(nextAction.actor, nextAction.pai, nextAction.tsumogiri);
 }
Пример #7
0
        public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
        {
            var nextAction = SelectHighPriorityMessage(msgList);

            if (nextAction.IsNONE())
            {
                return context.OnTsumo();
            }
            else if (nextAction.IsPON())
            {
                return context.OnPon(nextAction.actor, nextAction.target, nextAction.pai, nextAction.consumed);
            }
            else if (nextAction.IsCHI())
            {
                return context.OnChi(nextAction.actor, nextAction.target, nextAction.pai, nextAction.consumed);
            }
            else if (nextAction.IsDAIMINKAN())
            {
                return context.OnDaiminkan(nextAction.actor, nextAction.target, nextAction.pai, nextAction.consumed);
            }
            else
            {
                Debug.Assert(false);
                return false;  // If this line executed, It is Error ;
            }
        }
Пример #8
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     return context.OnOpenDora();
 }
Пример #9
0
        public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
        {
            var nextAction = SelectHighPriorityMessage(msgList);

            if (nextAction.IsNONE())
            {
                return context.OnOpenDora();
            }
            else if (nextAction.IsHORA())
            {
                return context.OnHora(nextAction.actor, nextAction.target, nextAction.pai);
            }
            else
            {
                Debug.Assert(false);
                return false;  // If this line executed, It is Error ;
            }
        }
Пример #10
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     if (context.OnCheckIsEndGame())
     {
         return context.OnEndGame();
     }
     else
     {
         return context.OnStartKyoku();
     }
 }
Пример #11
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     Debug.Assert(false);
     return false;
 }