package Rules.Strategys.Sichuan;

import Model.Hand;
import Model.Tile;
import Rules.Strategys.IInterruptionCondition;

/**
 * Created by Kreliou on 29/10/2015.
 */
public class SichuanInterruptionCondition implements IInterruptionCondition {

    //TODO implement algo
    public boolean checkInterruption(Tile tile, Hand hand){
        return false;
    }

}

@@ -65,16 +65,39 @@
 l.Tile;%0A
+import java.util.List;%0A
 import R
@@ -135,16 +135,16 @@
 dition;%0A
-
 %0A/**%0A * 
@@ -262,35 +262,8 @@
 on %7B
-%0A%0A    //TODO implement algo
 %0A   
@@ -319,16 +319,1143 @@
  hand)%7B%0A
+        int numPair = 0;%0A        int suit1%5B%5D = %7B-1, -1, -1, -1%7D;%0A        for (Tile currentTile : hand.getTileList()) %7B%0A            if currentTile.type == tile.type %7B%0A                if currentTile.digit == tile.digit %7B%0A                    numPair += 1;%0A                %7D%0A            %7D%0A            else if (currentTile.digit %3E= tile.digit - 2 && currentTile.digit %3C tile.digit) %7B%0A                suit1%5B(currentTile.digit == tile.digit - 2) ? 0 : 1)%5D = currentTile.digit;%0A            %7D%0A            else if (currentTile.digit %3C= tile.digit + 2 && currentTile.digit %3E tile.digit) %7B%0A                suit1%5B(currentTile.digit == tile.digit + 2) ? 2 : 3)%5D = currentTile.digit:%0A            %7D%0A        %7D%0A        if numPair %3E= 2 %7B%0A            return true;%0A        %7D%0A        int numberSuit = 0;%0A        for (int indexSuit = 0; indexSuit %3C 4; indexSuit++)%C2%A0%7B%0A            if (suit1%5BindexSuit%5D == -1) %7B%0A                numberSuit = 0;%0A            %7D%0A            else %7B%0A                numberSuit += 1;%0A                if (numberSuit == 2) %7B%0A                    return true;%0A                %7D%0A            %7D%0A            numberSuit += 1;%0A        %7D%0A
         
@@ -1472,13 +1472,12 @@
 se;%0A
+
     %7D%0A
-%0A
 %7D%0A

add algo take tile 🀄️😄