Example #1
0
        public static bool Validate(int slotIdSource, int slotIdDestination, IPlayer blackPlayer, IPlayer whitePlayer, Turn turn, List <Step> Steps)
        {
            IPlayer player;

            if (turn == Turn.Black)
            {
                player = blackPlayer;
            }
            else // white
            {
                player = whitePlayer;
            }
            switch (player.PlayerState)
            {
            case PlayerState.Normal:
                return(CubeStepExistNormal.Validate(slotIdSource, slotIdDestination, turn, Steps));

            case PlayerState.TakingOut:
                return(CubeStepExistTakinIn.Validate(slotIdSource, slotIdDestination, turn, Steps));

            case PlayerState.TakingIn:
                return(CubeStepExistTakingOut.Validate(slotIdSource, slotIdDestination, turn, Steps));

            case PlayerState.Blocked:
                return(false);

            default:
                throw new Exception("somthing wrong with the CubesStepExistValidators");
            }
        }
Example #2
0
 public static bool Validate(int slotIdSource, int slotIdDestination, Turn turn, List <Step> Steps)
 {
     return(CubeStepExistNormal.Validate(slotIdSource, slotIdDestination, turn, Steps));
 }