Example #1
0
 /// Get MatrixInfo by matrix id
 public static MatrixInfo Get(int id)
 {
     if (!IsInitialized)
     {
         Instance.InitMatrices();
     }
     return(Instance.ActiveMatrices[id]);
 }
Example #2
0
    /// Get MatrixInfo by matrix id
    public static MatrixInfo Get(int id)
    {
        if (!IsInitialized)
        {
            Instance.InitMatrices();
        }

        //Sometimes Get is still being called on the old matrixmanager instance on a
        //round restart
        if (id >= Instance.ActiveMatrices.Length)
        {
            return(MatrixInfo.Invalid);
        }

        return(Instance.ActiveMatrices[id]);
    }
    private static MatrixInfo getInternal(Func <MatrixInfo, bool> condition)
    {
        if (Instance.activeMatrices.Count == 0)
        {
//			Logger.Log( "MatrixManager list not ready yet, trying to init" );
            Instance.InitMatrices();
        }
        for (var i = 0; i < Instance.activeMatrices.Count; i++)
        {
            if (condition(Instance.activeMatrices[i]))
            {
                return(Instance.activeMatrices[i]);
            }
        }

        return(MatrixInfo.Invalid);
    }