001/* Copyright (C) Cross The Road Electronics 2024 */ 002package com.ctre.phoenix.motorcontrol; 003 004import java.util.*; 005 006/** 007 * Group of motor controllers 008 */ 009public class GroupMotorControllers 010{ 011 static List<IMotorController> _ms = new ArrayList<IMotorController>(); 012 013 /** 014 * Add motor controller to the group 015 * @param mc motor controller to add 016 */ 017 public static void register(IMotorController mc) 018 { 019 _ms.add(mc); 020 } 021 022 /** 023 * @return number of motorcontrollers in group 024 */ 025 public static int getCount() 026 { 027 return _ms.size(); 028 } 029 030 /** 031 * @param idx Index of motor controller to get 032 * @return Motor controller at specified index 033 */ 034 public static IMotorController get(int idx) 035 { 036 return _ms.get(idx); 037 } 038}