Beispiel #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 10: {
                    if (position_ == null)
                    {
                        position_ = new global::SaveAnywhere.SaveData.Vector2();
                    }
                    input.ReadMessage(position_);
                    break;
                }

                case 18: {
                    if (currentLocation_ == null)
                    {
                        currentLocation_ = new global::SaveAnywhere.SaveData.GameLocation();
                    }
                    input.ReadMessage(currentLocation_);
                    break;
                }

                case 24: {
                    FacingDirection = input.ReadInt32();
                    break;
                }

                case 37: {
                    Stamina = input.ReadFloat();
                    break;
                }

                case 40: {
                    Health = input.ReadInt32();
                    break;
                }

                case 48: {
                    Swimming = input.ReadBool();
                    break;
                }
                }
            }
        }
Beispiel #2
0
 public void MergeFrom(Farmer other)
 {
     if (other == null)
     {
         return;
     }
     if (other.position_ != null)
     {
         if (position_ == null)
         {
             position_ = new global::SaveAnywhere.SaveData.Vector2();
         }
         Position.MergeFrom(other.Position);
     }
     if (other.currentLocation_ != null)
     {
         if (currentLocation_ == null)
         {
             currentLocation_ = new global::SaveAnywhere.SaveData.GameLocation();
         }
         CurrentLocation.MergeFrom(other.CurrentLocation);
     }
     if (other.FacingDirection != 0)
     {
         FacingDirection = other.FacingDirection;
     }
     if (other.Stamina != 0F)
     {
         Stamina = other.Stamina;
     }
     if (other.Health != 0)
     {
         Health = other.Health;
     }
     if (other.Swimming != false)
     {
         Swimming = other.Swimming;
     }
 }