/// <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 StartGame Create(ByteList bytes) { StartGame 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 StartGame(); result.Decode(bytes); } return result; }