Hello,

I have a question concerning the repeated fields. I'll start with an
example:

message Player {
  required int32 id = 1;
  required int32 x =2;
  required int32 y=3;
}

message Playerlist{
  repeated Player player= 1;
}

I have a server and get Player's from different clients and hold them
in a map (this map is updated all the time). After a certain time I
want to get all Players, create a Playerlist and send it to all
clients. The Playerlist however has just a method

Player* add_player();

I will have to copy all the Player's I've already created :

Player* newP = playerlist.add_player();
newP->set_id( playerFromMap->id() );

Isn't there a better way to do this?

Regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to