コード例 #1
0
ファイル: clsUnitType.cs プロジェクト: Zabanya/SharpFlame
        public void UpdateAttachments()
        {
            BaseAttachment = new clsAttachment();

            if ( Body == null )
            {
                AlwaysDrawTextLabel = true;
                return;
            }

            clsAttachment NewBody = BaseAttachment.AddCopyOfAttachment(Body.Attachment);

            AlwaysDrawTextLabel = NewBody.Models.Count == 0;

            if ( Propulsion != null )
            {
                if ( Body.ObjectDataLink.IsConnected )
                {
                    BaseAttachment.AddCopyOfAttachment(Propulsion.Bodies[Body.ObjectDataLink.ArrayPosition].LeftAttachment);
                    BaseAttachment.AddCopyOfAttachment(Propulsion.Bodies[Body.ObjectDataLink.ArrayPosition].RightAttachment);
                }
            }

            if ( NewBody.Models.Count == 0 )
            {
                return;
            }

            if ( NewBody.Models[0].ConnectorCount <= 0 )
            {
                return;
            }

            sXYZ_sng TurretConnector = new sXYZ_sng();

            TurretConnector = Body.Attachment.Models[0].Connectors[0];

            if ( TurretCount >= 1 )
            {
                if ( Turret1 != null )
                {
                    clsAttachment NewTurret = NewBody.AddCopyOfAttachment(Turret1.Attachment);
                    NewTurret.Pos_Offset = TurretConnector;
                }
            }

            if ( Body.Attachment.Models[0].ConnectorCount <= 1 )
            {
                return;
            }

            TurretConnector = Body.Attachment.Models[0].Connectors[1];

            if ( TurretCount >= 2 )
            {
                if ( Turret2 != null )
                {
                    clsAttachment NewTurret = NewBody.AddCopyOfAttachment(Turret2.Attachment);
                    NewTurret.Pos_Offset = TurretConnector;
                }
            }
        }
コード例 #2
0
ファイル: clsUnitType.cs プロジェクト: Zabanya/SharpFlame
            public clsAttachment CopyAttachment(clsAttachment Other)
            {
                clsAttachment Result = new clsAttachment();

                Result.Pos_Offset = Other.Pos_Offset;
                Attachments.Add(Result);
                Matrix3DMath.MatrixCopy(Other.AngleOffsetMatrix, Result.AngleOffsetMatrix);
                Result.Models.AddSimpleList(Other.Models);
                Result.Attachments.AddSimpleList(Other.Attachments);

                return Result;
            }
コード例 #3
0
ファイル: clsUnitType.cs プロジェクト: Zabanya/SharpFlame
            public clsAttachment CreateAttachment()
            {
                clsAttachment Result = new clsAttachment();

                Attachments.Add(Result);
                return Result;
            }
コード例 #4
0
ファイル: clsUnitType.cs プロジェクト: Zabanya/SharpFlame
            public clsAttachment AddCopyOfAttachment(clsAttachment AttachmentToCopy)
            {
                clsAttachment ResultAttachment = new clsAttachment();
                clsAttachment Attachment = default(clsAttachment);

                Attachments.Add(ResultAttachment);
                Matrix3DMath.MatrixCopy(AttachmentToCopy.AngleOffsetMatrix, ResultAttachment.AngleOffsetMatrix);
                ResultAttachment.Models.AddSimpleList(AttachmentToCopy.Models);
                foreach ( clsAttachment tempLoopVar_Attachment in AttachmentToCopy.Attachments )
                {
                    Attachment = tempLoopVar_Attachment;
                    ResultAttachment.AddCopyOfAttachment(Attachment);
                }

                return ResultAttachment;
            }