Пример #1
0
        public void Deserialize(INetDataReader reader)
        {
            TechBonuses    = new PlayerTechBonuses();
            Inventory      = new StorageComponent(4);
            ReactorStorage = new StorageComponent(4);
            WarpStorage    = new StorageComponent(1);
            Forge          = new MechaForge
            {
                tasks      = new List <ForgeTask>(),
                extraItems = new ItemBundle()
            };
            TechBonuses.Deserialize(reader);
            SandCount     = reader.GetInt();
            CoreEnergy    = reader.GetDouble();
            ReactorEnergy = reader.GetDouble();
            bool isPayloadPresent = reader.GetBool();

            if (isPayloadPresent)
            {
                int    mechaLength = reader.GetInt();
                byte[] mechaBytes  = new byte[mechaLength];
                reader.GetBytes(mechaBytes, mechaLength);
                using (MemoryStream ms = new MemoryStream(mechaBytes))
                    using (BinaryReader br = new BinaryReader(ms))
                    {
                        Inventory.Import(br);
                        ReactorStorage.Import(br);
                        WarpStorage.Import(br);
                        Forge.Import(br);
                    }
            }
        }
Пример #2
0
 public void Deserialize(INetDataReader reader)
 {
     coreEnergyCap            = reader.GetDouble();
     corePowerGen             = reader.GetDouble();
     reactorPowerGen          = reader.GetDouble();
     walkPower                = reader.GetDouble();
     jumpEnergy               = reader.GetDouble();
     thrustPowerPerAcc        = reader.GetDouble();
     warpKeepingPowerPerSpeed = reader.GetDouble();
     warpStartPowerPerSpeed   = reader.GetDouble();
     miningPower              = reader.GetDouble();
     replicatePower           = reader.GetDouble();
     researchPower            = reader.GetDouble();
     droneEjectEnergy         = reader.GetDouble();
     droneEnergyPerMeter      = reader.GetDouble();
     coreLevel                = reader.GetInt();
     thrusterLevel            = reader.GetInt();
     miningSpeed              = reader.GetFloat();
     replicateSpeed           = reader.GetFloat();
     walkSpeed                = reader.GetFloat();
     jumpSpeed                = reader.GetFloat();
     maxSailSpeed             = reader.GetFloat();
     maxWarpSpeed             = reader.GetFloat();
     buildArea                = reader.GetFloat();
     droneCount               = reader.GetInt();
     droneSpeed               = reader.GetFloat();
     droneMovement            = reader.GetInt();
     inventorySize            = reader.GetInt();
 }
Пример #3
0
 public void Deserialize(INetDataReader reader)
 {
     x = reader.GetDouble();
     y = reader.GetDouble();
     z = reader.GetDouble();
 }