KnowledgeBase.KB.AssetToMList C# (CSharp) Method

AssetToMList() private static method

private static AssetToMList ( List ToMList, Name current, string argName ) : void
ToMList List
current Name
argName string
return void
        private static void AssetToMList(List<Name> ToMList, Name current, string argName)
        {
            if(current==Name.NIL_SYMBOL)
                throw new ArgumentException("Perspectives cannot contain NIL symbol.", argName);

            if (current == Name.UNIVERSAL_SYMBOL)
                throw new ArgumentException("Perspectives cannot contain Universal symbol.", argName);

            var last = ToMList.LastOrDefault();
            if((last==null && current == Name.SELF_SYMBOL) || current!=last)
                ToMList.Add(current);

            if ((ToMList.Count - 1) > MAX_TOM_LVL)
                throw new ArgumentException($"Invalid Theory of the Mind level. Max ToM level {MAX_TOM_LVL}.", argName);
        }