예제 #1
0
		public void Register(ref ToeMessageDescription message)
		{
			if (!this.map.ContainsKey(message.Id))
			{
				this.map.Add(message.Id, this.messages.Count);
				this.messages.Add(message);
				return;
			}
			if (this.messages[this.map[message.Id]] != message)
			{
				throw new ToeException(string.Format("Different version of message {0} registered already", message.Name));
			}
		}
예제 #2
0
		public bool Equals(ToeMessageDescription other)
		{
			if (other.id != this.id)
			{
				return false;
			}
			if (other.fields.Length != this.fields.Length)
			{
				return false;
			}
			for (int index = 0; index < this.fields.Length; index++)
			{
				if (this.fields[index] != other.fields[index])
				{
					return false;
				}
			}
			return true;
		}