コード例 #1
0
        public static void clearExceptionListWithNames(bool removeFromWorld)
        {
            List <TileNode> removalList = new List <TileNode>();
            List <TileExceptionMetaData> removalList2 = new List <TileExceptionMetaData>();

            foreach (var v in StardustCore.ModCore.SerializationManager.trackedObjectList)
            {
                TileExceptionMetaData exc = getExceptionFromTile((v as TileNode));
                if (exc != null)
                {
                    if (exc.actionType == "Navigation" || exc.actionType == "CostCalculation" || exc.actionType == "Child")
                    {
                        removalList.Add(exc.tile);
                        removalList2.Add(exc);
                    }
                }
            }

            foreach (var v in removalList)
            {
                StardustCore.ModCore.SerializationManager.trackedObjectList.Remove(v);
                if (removeFromWorld)
                {
                    v.thisLocation.objects.Remove(v.tileLocation);
                }
            }
            foreach (var v in removalList2)
            {
                tileExceptionList.Remove(v);
            }
        }
コード例 #2
0
        public static void cleanExceptionList(TileNode t)
        {
            TileExceptionMetaData err = new TileExceptionMetaData(null, "");

            foreach (var v in tileExceptionList)
            {
                if (v.tile == t)
                {
                    err = v;
                }
            }
            if (err.tile != null)
            {
                tileExceptionList.Remove(err);
            }
        }