Exemplo n.º 1
0
 public virtual void Serialize(MapObjectSerializer serializer)
 {
     serializer.AppendProperty(Location.X);
     serializer.AppendProperty(Location.Y);
     serializer.AppendProperty(Size.Width);
     serializer.AppendProperty(Size.Height);
 }
Exemplo n.º 2
0
        public string Serialize()
        {
            StringBuilder serialized = new StringBuilder();

            foreach (Player player in Players.Values)
            {
                MapParser.SerializerPlayer(player, serialized);
            }

            foreach (Paintball paintball in Paintballs)
            {
                serialized.Append(paintball.ToString());
            }

            foreach (Obstacle obstacle in Obstacles)
            {
                serialized.Append(obstacle.ToString());
            }

            MapObjectSerializer mos = new MapObjectSerializer(serialized);

            foreach (PaintballHit ph in PaintballHits)
            {
                MapParser.SerializePaintballHit(ph, serialized);
//                ph.Serialize(mos);
            }

            return(serialized.ToString());
        }