001/* Copyright (C) Cross The Road Electronics 2024 */
002package com.ctre.phoenix;
003
004/**
005 * Class to handle multiple error codes
006 */
007public class ErrorCollection {
008    /**
009     * Add error to error collection
010     * @param err Error to add to collection
011     */
012    public void NewError(ErrorCode err) {
013        _worstError = ErrorCode.worstOne(_worstError, err);
014    }
015    /**
016     * Add error to error collection
017     * @param err Error to add to collection
018     */
019    public void NewError(int err) {
020        _worstError = ErrorCode.worstOne(_worstError, ErrorCode.valueOf(err));
021    }
022    /**
023     * Worst error of all in collection
024     */
025    public ErrorCode _worstError;
026    public ErrorCollection() {
027        _worstError = ErrorCode.OK;
028    }
029};
030