private void SetType(PieceModelEnum modelEnum) { this.modelEnum = modelEnum; GameObject prefab = null; foreach (EnumToModel enumsToModel in enumsToModels) { enumsToModel.model.SetActive(false); } foreach (EnumToModel enumToModel in enumsToModels) { if (enumToModel.@enum == modelEnum) { enumToModel.model.SetActive(true); model = enumToModel.model; } } }
public PieceMovement GetMovesFor(PieceModelEnum modelEnum) { switch (modelEnum) { case PieceModelEnum.Pawn: return(new PieceMovement.Pawn()); case PieceModelEnum.Knight: return(new PieceMovement.Knight()); case PieceModelEnum.King: return(new PieceMovement.King()); case PieceModelEnum.Bishop: return(new PieceMovement.Bishop()); case PieceModelEnum.Queen: return(new PieceMovement.Queen()); case PieceModelEnum.Rook: return(new PieceMovement.Rook()); default: throw new NotImplementedException(); } }
public PiecePosition(PieceModelEnum modelEnum, Vector2Int pos, Side facePos) { this.ModelEnum = modelEnum; this.pos = pos; this.facePos = facePos; }