/// <summary> /// Factor method to create a message from a byte list /// </summary> /// <param name="bytes">A byte list from which the message will be decoded</param> /// <returns>A new message of the right specialization</returns> new public static ThrowBomb Create(ByteList bytes) { ThrowBomb result = null; if (bytes == null || bytes.RemainingToRead < MinimumEncodingLength) { throw new ApplicationException("Invalid message byte array"); } else if (bytes.PeekInt16() != ClassId) { throw new ApplicationException("Invalid message class id"); } else { result = new ThrowBomb(); result.Decode(bytes); } return(result); }
/// <summary> /// Factor method to create a message from a byte list /// </summary> /// <param name="bytes">A byte list from which the message will be decoded</param> /// <returns>A new message of the right specialization</returns> public static new ThrowBomb Create(ByteList bytes) { ThrowBomb result = null; if (bytes == null || bytes.RemainingToRead < MinimumEncodingLength) throw new ApplicationException("Invalid message byte array"); else if (bytes.PeekInt16() != ClassId) throw new ApplicationException("Invalid message class id"); else { result = new ThrowBomb(); result.Decode(bytes); } return result; }