Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="KinCityData"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public KinCityData(BinaryFileReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 2:
            {
                m_Treasury = reader.ReadInt();
                m_TaxRate  = reader.ReadDouble();
                goto case 1;
            }

            case 1:
            {
                m_UnassignedGuardSlots = reader.ReadInt();
                goto case 0;
            }

            case 0:
            {
                m_City                = (KinFactionCities)reader.ReadInt();
                m_ControlingKin       = (IOBAlignment)reader.ReadInt();
                m_CaptureTime         = reader.ReadDeltaTime();
                m_CityLeader          = (PlayerMobile)reader.ReadMobile();
                m_IsVotingStage       = reader.ReadBool();
                m_Sigil               = (KinSigil)reader.ReadItem();
                m_ControlPoints       = reader.ReadInt();
                m_ControlPointDelta   = reader.ReadInt();
                m_NPCFlags            = (NPCFlags)reader.ReadInt();
                m_GuardOption         = (GuardOptions)reader.ReadInt();
                m_LastGuardChangeTime = reader.ReadDeltaTime();

                int length = reader.ReadInt();

                if (length > 0)
                {
                    for (int i = 0; i < length; ++i)
                    {
                        m_BeneficiaryDataList.Add(new BeneficiaryData(reader));
                    }
                }

                break;
            }
            }
        }