コード例 #1
0
        void DoChangeListType(byte type, bool add)
        {
            Tuple <MyObjectBuilderType, StringBuilder> tuple;

            if (!CandidateTypes.TryGetValue(type, out tuple))
            {
                Debug.Assert(false, "type not in dictionary");
                return;
            }
            if (add)
            {
                m_inventoryConstraint.AddObjectBuilderType(tuple.Item1);
            }
            else
            {
                m_inventoryConstraint.RemoveObjectBuilderType(tuple.Item1);
            }

            // Recompute because of new sorter settings
            CubeGrid.GridSystems.ConveyorSystem.FlagForRecomputation();

            if (m_allowCurrentListUpdate)
            {
                currentList.UpdateVisual();
            }
        }
コード例 #2
0
        internal bool DoChangeListType(byte type, bool add)
        {
            Tuple <MyObjectBuilderType, StringBuilder> tuple;

            if (!CandidateTypes.TryGetValue(type, out tuple))
            {
                Debug.Assert(false, "type not in dictionary");
                return(false);
            }
            if (add)
            {
                m_inventoryConstraint.AddObjectBuilderType(tuple.Item1);
            }
            else
            {
                m_inventoryConstraint.RemoveObjectBuilderType(tuple.Item1);
            }
            if (m_allowCurrentListUpdate)
            {
                currentList.UpdateVisual();
            }
            return(true);
        }