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