public void Step(ref ForcedRecoveryStepState token, int condition) { TurnEV currentTurn = turnService.GetCurrentTurnEV(entitiesDB); IPieceData piece = pieceFactory.CreateIPieceData(token.PieceMoved.Piece.PieceType); bool forcedRecoveryPossible = token.PieceMoved.Tier.TopOfTower && // Paranoia check piece.Abilities.PostMove.Contains(PostMoveAbility.FORCED_RECOVERY) && !HasDestinationTiles(token.PieceMoved) && checkService.ForcedRecoveryResolvesOrDoesNotCreateCheck(token.PieceMoved, currentTurn, entitiesDB); NextAction(ref token, forcedRecoveryPossible); }
static AbilityToPiece() { PieceFactory pieceFactory = new PieceFactory(); Array pieceTypes = Enum.GetValues(typeof(PieceType)); foreach (PieceType pieceType in pieceTypes) { IPieceData pieceData = pieceFactory.CreateIPieceData(pieceType); AddOtherMoveAbilities(pieceData); AddPreMoveAbilities(pieceData); AddPostMoveAbilities(pieceData); AddDropAbilities(pieceData); } }
private bool HasDropAbility(ref HandPieceEV handPiece, PieceSide side, DropAbility dropAbility) { List <DropAbility> drop = pieceFactory.CreateIPieceData(GetPieceType(ref handPiece, side)).Abilities.Drop; return(drop.Contains(dropAbility)); }
private bool HasForcedRearrangementAbility(PieceType pieceType) { IPieceData pieceData = pieceFactory.CreateIPieceData(pieceType); return(pieceData.Abilities.PostMove.Contains(PostMoveAbility.FORCED_REARRANGEMENT)); }
private IPieceData CreatePieceData(PieceEV pieceEV, bool useGoldMovement) { PieceType pieceToCreate = !useGoldMovement ? pieceEV.Piece.PieceType : PieceType.GOLD; return(pieceFactory.CreateIPieceData(pieceToCreate)); }