Ejemplo n.º 1
0
 public void RemoveCubePart(MyCubePart part)
 {
     var pos = part.InstanceData.Translation;
     var cell = GetCell(pos);
     if (cell.RemoveCubePart(part))
         m_dirtyCells.Add(cell);
 }
Ejemplo n.º 2
0
        public void AddCubePart(MyCubePart part)
        {
            var pos = part.InstanceData.Translation;
            var cell = GetCell(pos);

            // We have to add anyway, even when it's already there, bones may have changed
            cell.AddCubePart(part);
            m_dirtyCells.Add(cell);
        }
 public bool RemoveCubePart(MyCubePart part)
 {
     return m_cubeParts.Remove(part);
 }
 public bool AddCubePart(MyCubePart part)
 {
     return m_cubeParts.Add(part);
 }
Ejemplo n.º 5
0
        internal void AddCubePartDecal(MyCubePart part, uint decalId)
        {
            List<uint> decals;
            bool found = m_cubeParts.TryGetValue(part, out decals);
            if (!found)
            {
                decals = new List<uint>();
                m_cubeParts.Add(part, decals);
            }

            if (decals == null)
            {
                // Decals list can be null as well
                decals = new List<uint>();
                m_cubeParts[part] = decals;
            }

            decals.Add(decalId);
        }
Ejemplo n.º 6
0
 public void AddCubePart(MyCubePart part)
 {
     if (!m_cubeParts.ContainsKey(part))
         m_cubeParts.Add(part, null);
 }
Ejemplo n.º 7
0
        internal void RemoveCubePartDecal(MyCubePart part, uint decalId)
        {
            List<uint> decals;
            bool found = m_cubeParts.TryGetValue(part, out decals);
            if (!found || decals == null)
                return;

            int indexToRemove = -1;
            for (int it = 0; it < decals.Count; it++)
            {
                if (decals[it] == decalId)
                {
                    indexToRemove = it;
                    break;
                }
            }

            if (indexToRemove != -1)
                decals.RemoveAt(indexToRemove);
        }