public clsStructureType() { this.StructureType_ObjectDataLink = new modLists.ConnectedListLink<clsStructureType, clsObjectData>(this); this.Code = ""; this.Name = "Unknown"; this.StructureType = enumStructureType.Unknown; this.WallLink = new modLists.ConnectedListLink<clsStructureType, clsWallType>(this); this.BaseAttachment = new clsUnitType.clsAttachment(); base.Type = clsUnitType.enumType.PlayerStructure; }
public void UpdateAttachments() { this.BaseAttachment = new clsUnitType.clsAttachment(); if (this.Body == null) { this.AlwaysDrawTextLabel = true; } else { clsUnitType.clsAttachment attachment = this.BaseAttachment.AddCopyOfAttachment(this.Body.Attachment); this.AlwaysDrawTextLabel = attachment.Models.Count == 0; if ((this.Propulsion != null) && this.Body.ObjectDataLink.IsConnected) { this.BaseAttachment.AddCopyOfAttachment(this.Propulsion.Bodies[this.Body.ObjectDataLink.ArrayPosition].LeftAttachment); this.BaseAttachment.AddCopyOfAttachment(this.Propulsion.Bodies[this.Body.ObjectDataLink.ArrayPosition].RightAttachment); } if ((attachment.Models.Count != 0) && (attachment.Models[0].ConnectorCount > 0)) { modMath.sXYZ_sng _sng = this.Body.Attachment.Models[0].Connectors[0]; if ((this.TurretCount >= 1) && (this.Turret1 != null)) { attachment.AddCopyOfAttachment(this.Turret1.Attachment).Pos_Offset = _sng; } if (this.Body.Attachment.Models[0].ConnectorCount > 1) { _sng = this.Body.Attachment.Models[0].Connectors[1]; if ((this.TurretCount >= 2) && (this.Turret2 != null)) { attachment.AddCopyOfAttachment(this.Turret2.Attachment).Pos_Offset = _sng; } } } } }
public clsUnitType.clsAttachment CreateAttachment() { clsUnitType.clsAttachment newItem = new clsUnitType.clsAttachment(); this.Attachments.Add(newItem); return newItem; }
public clsUnitType.clsAttachment CopyAttachment(clsUnitType.clsAttachment Other) { clsUnitType.clsAttachment newItem = new clsUnitType.clsAttachment { Pos_Offset = Other.Pos_Offset }; this.Attachments.Add(newItem); Matrix3DMath.MatrixCopy(Other.AngleOffsetMatrix, newItem.AngleOffsetMatrix); newItem.Models.AddSimpleList(Other.Models); newItem.Attachments.AddSimpleList(Other.Attachments); return newItem; }
public clsUnitType.clsAttachment AddCopyOfAttachment(clsUnitType.clsAttachment AttachmentToCopy) { IEnumerator enumerator; clsUnitType.clsAttachment newItem = new clsUnitType.clsAttachment(); this.Attachments.Add(newItem); Matrix3DMath.MatrixCopy(AttachmentToCopy.AngleOffsetMatrix, newItem.AngleOffsetMatrix); newItem.Models.AddSimpleList(AttachmentToCopy.Models); try { enumerator = AttachmentToCopy.Attachments.GetEnumerator(); while (enumerator.MoveNext()) { clsUnitType.clsAttachment current = (clsUnitType.clsAttachment) enumerator.Current; newItem.AddCopyOfAttachment(current); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } return newItem; }
public clsBody() { this.ObjectDataLink = new modLists.ConnectedListLink<clsBody, clsObjectData>(this); this.Attachment = new clsUnitType.clsAttachment(); base.ComponentType = clsComponent.enumComponentType.Body; }
public clsTurret() { this.TurretObjectDataLink = new modLists.ConnectedListLink<clsTurret, clsObjectData>(this); this.Attachment = new clsUnitType.clsAttachment(); this.TurretType = enumTurretType.Unknown; }