using UniSphere.Common.VariableTypes; using UniSphere.Messaging.Messages; using UniSphere.Messaging.Messages.Interfaces; namespace UniSphere.Common.Messaging.Messages.RenderSpecific { public class SkyBoxMessageResponse : BaseResponseMessage { /// /// Indicates the Type Identifier for this message. /// /// public override SUInt16 GetMessageTypeId() { return new SUInt16((ushort)GetEnumMessageType()); } /// /// Gets the type of the enumerated message. /// /// public override enumMessageType GetEnumMessageType() { return enumMessageType.SKYBOX_RESPONSE_MESSAGE; } #region Constructors /// Sjef van Leeuwen 21-1-2007 14:00 public SkyBoxMessageResponse(SkyBoxResponseCode responseCode, uint lifeformId, string left, string right, string top, string bottom, string front, string back) : base(responseCode, new object[] { new SUInt16((ushort)responseCode), new SUInt32(lifeformId), new SString(left), new SString(right), new SString(top), new SString(bottom), new SString(front), new SString(back) }) {} /// /// Initializes a new instance of the class. /// /// The response code. /// The left. /// The right. /// The top. /// The bottom. /// The front. /// The back. /// Sjef van Leeuwen 19-2-2007 14:21 internal SkyBoxMessageResponse(SUInt16 responseCode, SUInt32 lifeformId, SString left, SString right, SString top, SString bottom, SString front, SString back) : base(responseCode, new object[] { responseCode, lifeformId, left,right,top,bottom,front,back }) { } #endregion #region Properties /// /// Gets the lifeform id. /// /// The lifeform id. /// Sjef van Leeuwen 20-2-2007 20:18 public SUInt32 LifeformId { get { return (SUInt32)_parameters[1]; } } /// /// Gets the left. /// /// The left. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Left { get { return (SString)_parameters[2]; } } /// /// Gets the right. /// /// The right. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Right { get { return (SString)_parameters[3]; } } /// /// Gets the top. /// /// The top. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Top { get { return (SString)_parameters[4]; } } /// /// Gets the bottom. /// /// The bottom. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Bottom { get { return (SString)_parameters[5]; } } /// /// Gets the front. /// /// The front. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Front { get { return (SString)_parameters[6]; } } /// /// Gets the back. /// /// The back. /// Sjef van Leeuwen 19-2-2007 14:30 public SString Back { get { return (SString)_parameters[7]; } } #endregion #region Static Methods /// /// Deserializes the specified message. /// /// The message. /// /// Sjef van Leeuwen 21-1-2007 14:04 public static SkyBoxMessageResponse Deserialize(byte[] message) { SUInt16 responseCode = new SUInt16(message, 0); int OffSet = SUInt16.BYTE_LENGTH; return new SkyBoxMessageResponse(responseCode, GetSUInt32(ref message, ref OffSet), GetString(ref message,ref OffSet), GetString(ref message,ref OffSet), GetString(ref message,ref OffSet), GetString(ref message,ref OffSet), GetString(ref message,ref OffSet), GetString(ref message,ref OffSet)); } #endregion } }