protected override void Broadcast( ServerCommandCodec sc ) { Action a; foreach( KeyValuePair<int, Delegate> kv in listeners ) { a = (Action)kv.Value; a(); } }
public void Dispatch( ServerCommandCodec sc ) { if( sc.HasRecipient ) { Send( sc ); } else { Broadcast( sc ); } }
public void AddCodec( ServerCommandCodec codec ) { codecs.Add( codec.Name, codec ); }
protected override void Send( ServerCommandCodec sc ) { Action a = (Action)listeners[ sc.Recipient ]; a(); }
protected abstract void Broadcast( ServerCommandCodec sc );
protected abstract void Send( ServerCommandCodec sc );