public MySyncAirtightDoorGeneric(MyAirtightDoorGeneric id)
 {
     m_Parent = id;
 }
 public MySyncAirtightDoorGeneric(MyAirtightDoorGeneric id)
 {
     m_Parent = id;
 }
Ejemplo n.º 3
0
 public MyUseObjectAirtightDoors(IMyEntity owner, string dummyName, MyModelDummy dummyData, uint key)
     : base(owner, dummyData)
 {
     Door        = (MyAirtightDoorGeneric)owner;
     LocalMatrix = dummyData.Matrix;
 }
Ejemplo n.º 4
0
        private bool IsPressurized(IMySlimBlock block, Vector3I pos, Vector3 normal)
        {
            var def = (MyCubeBlockDefinition)block.BlockDefinition;

            if (def.BuildProgressModels.Length > 0)
            {
                MyCubeBlockDefinition.BuildProgressModel buildProgressModel = def.BuildProgressModels[def.BuildProgressModels.Length - 1];
                if (block.BuildLevelRatio < buildProgressModel.BuildRatioUpperBound)
                {
                    return(false);
                }
            }
            Matrix matrix;

            block.Orientation.GetMatrix(out matrix);
            matrix.TransposeRotationInPlace();
            Vector3 vector   = Vector3.Transform(normal, matrix);
            Vector3 position = Vector3.Zero;

            if (block.FatBlock != null)
            {
                position = pos - block.FatBlock.Position;
            }
            Vector3 value = Vector3.Transform(position, matrix) + def.Center;
            bool    flag  = def.IsCubePressurized[Vector3I.Round(value)][Vector3I.Round(vector)];

            if (flag)
            {
                return(true);
            }
            if (block.FatBlock != null)
            {
                MyCubeBlock fatBlock = (MyCubeBlock)block.FatBlock;
                bool        result;
                if (fatBlock is MyDoor)
                {
                    MyDoor myDoor = fatBlock as MyDoor;
                    if (!myDoor.Open)
                    {
                        MyCubeBlockDefinition.MountPoint[] mountPoints = def.MountPoints;
                        for (int i = 0; i < mountPoints.Length; i++)
                        {
                            MyCubeBlockDefinition.MountPoint mountPoint = mountPoints[i];
                            if (vector == mountPoint.Normal)
                            {
                                result = false;
                                return(result);
                            }
                        }
                        return(true);
                    }
                    return(false);
                }
                else if (fatBlock is MyAdvancedDoor)
                {
                    MyAdvancedDoor myAdvancedDoor = fatBlock as MyAdvancedDoor;
                    if (myAdvancedDoor.FullyClosed)
                    {
                        MyCubeBlockDefinition.MountPoint[] mountPoints2 = def.MountPoints;
                        for (int j = 0; j < mountPoints2.Length; j++)
                        {
                            MyCubeBlockDefinition.MountPoint mountPoint2 = mountPoints2[j];
                            if (vector == mountPoint2.Normal)
                            {
                                result = false;
                                return(result);
                            }
                        }
                        return(true);
                    }
                    return(false);
                }
                else if (fatBlock is MyAirtightSlideDoor)
                {
                    MyAirtightDoorGeneric myAirtightDoorGeneric = fatBlock as MyAirtightDoorGeneric;
                    if (myAirtightDoorGeneric.IsFullyClosed && vector == Vector3.Forward)
                    {
                        return(true);
                    }
                    return(false);
                }
                else
                {
                    if (!(fatBlock is MyAirtightDoorGeneric))
                    {
                        return(false);
                    }
                    MyAirtightDoorGeneric myAirtightDoorGeneric2 = fatBlock as MyAirtightDoorGeneric;
                    if (myAirtightDoorGeneric2.IsFullyClosed && (vector == Vector3.Forward || vector == Vector3.Backward))
                    {
                        return(true);
                    }
                    return(false);
                }
            }
            return(false);
        }