UNPKG

dmclc

Version:

Dolphin Minecraft Launcher Core

60 lines (59 loc) 1.97 kB
/* * Ported from Fabric Loader. * Copyright 2016 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { VersionIntervalImpl } from "./VersionIntervalImpl.js"; /** * Representation of a version interval, closed or open. * * <p>The represented version interval is contiguous between its lower and upper limit, disjoint intervals are built * using collections of {@link VersionInterval}. Empty intervals may be represented by {@code null} or any interval * @code (x,x)} with x being a non-{@code null} version and both endpoints being exclusive. */ export class VersionInterval { and(o) { return VersionInterval.andOne(this, o); } or(o) { return VersionInterval.or(o, this); } not() { return VersionInterval.notOne(this); } /** * Compute the intersection between two version intervals. */ static andOne(a, b) { return VersionIntervalImpl.andOne(a, b); } /** * Compute the intersection between two potentially disjoint of version intervals. */ static and(a, b) { return VersionIntervalImpl.and(a, b); } /** * Compute the union between multiple version intervals. */ static or(a, b) { return VersionIntervalImpl.or(a, b); } static notOne(interval) { return VersionIntervalImpl.notOne(interval); } static not(intervals) { return VersionIntervalImpl.not(intervals); } }