Пример #1
0
        public PlayerCombatData(ScriptMessageReader mr, int version)
        {
            this._playerID      = mr.ReadInteger();
            this._victoryStatus = (GameSession.VictoryStatus)mr.ReadInteger();
            this.Construct();
            int num1 = mr.ReadInteger();

            for (int index = 0; index < num1; ++index)
            {
                this._shipData.Add(new Kerberos.Sots.Strategy.ShipData()
                {
                    designID       = mr.ReadInteger(),
                    damageDealt    = mr.ReadSingle(),
                    damageReceived = mr.ReadSingle(),
                    killCount      = mr.ReadInteger(),
                    destroyed      = mr.ReadBool()
                });
            }
            int num2 = mr.ReadInteger();

            for (int index1 = 0; index1 < num2; ++index1)
            {
                Kerberos.Sots.Strategy.PlanetData planetData = new Kerberos.Sots.Strategy.PlanetData();
                planetData.orbitalObjectID = mr.ReadInteger();
                planetData.imperialDamage  = mr.ReadDouble();
                int num3 = mr.ReadInteger();
                planetData.civilianDamage = new List <PopulationData>();
                for (int index2 = 0; index2 < num3; ++index2)
                {
                    PopulationData populationData = new PopulationData()
                    {
                        faction = mr.ReadString(),
                        damage  = mr.ReadDouble()
                    };
                }
                planetData.infrastructureDamage = mr.ReadSingle();
                planetData.terraDamage          = mr.ReadSingle();
                this._planetData.Add(planetData);
            }
            int num4 = mr.ReadInteger();

            for (int index = 0; index < num4; ++index)
            {
                this._weaponData.Add(new Kerberos.Sots.Strategy.WeaponData()
                {
                    weaponID    = mr.ReadInteger(),
                    damageDealt = mr.ReadSingle()
                });
            }
            if (version >= 1)
            {
                this._fleetCount = mr.ReadInteger();
            }
            else
            {
                this._fleetCount = 0;
            }
        }
Пример #2
0
 public override bool OnEngineMessage(InteropMessageID messageId, ScriptMessageReader message)
 {
     if (messageId == InteropMessageID.IMID_SCRIPT_OBJECT_SETPROP)
     {
         if (message.ReadString() == "PlanetPopUpdate")
         {
             this.Population           = message.ReadDouble();
             this._lastAttackingObject = this.App.GetGameObject(message.ReadInteger());
             return(true);
         }
     }
     else
     {
         App.Log.Warn("Unhandled message (id=" + (object)messageId + ").", "game");
     }
     return(false);
 }