public static string getPrefix(this NetworkMsgPrefix val) { PrefixAttribute[] attributes = (PrefixAttribute[])val .GetType() .GetField(val.ToString()) .GetCustomAttributes(typeof(PrefixAttribute), false); return(attributes[0].Prefix); }
public void enqueueMsg(NetworkMsgPrefix networkMsgPrefix, string msg) { dataToSend.Enqueue(networkMsgPrefix.getPrefix() + NETWORK_MSG_SEPARATOR + msg); }