Beispiel #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;
            }
        }
Beispiel #2
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     var nextAction = SelectHighPriorityMessage(msgList);
     return context.OnDahai(nextAction.actor, nextAction.pai, nextAction.tsumogiri);
 }
Beispiel #3
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     return context.OnEndKyoku();
 }
Beispiel #4
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msg)
 {
     return context.OnTsumo();
 }
Beispiel #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();
     }
 }
Beispiel #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);
 }
Beispiel #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 ;
            }
        }
Beispiel #8
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     return context.OnOpenDora();
 }
Beispiel #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 ;
            }
        }
Beispiel #10
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     if (context.OnCheckIsEndGame())
     {
         return context.OnEndGame();
     }
     else
     {
         return context.OnStartKyoku();
     }
 }
Beispiel #11
0
 public bool ExecuteAction(GameContext context, List<MJsonMessageAll> msgList)
 {
     Debug.Assert(false);
     return false;
 }