Esempio n. 1
0
        protected override void ReadData(DataBuffer buf, FileFormat fmt)
        {
            PlayerPeds.Clear();

            int numPeds = buf.ReadInt32();

            for (int i = 0; i < numPeds; i++)
            {
                PedTypeId type   = (PedTypeId)buf.ReadInt32();
                short     model  = buf.ReadInt16();
                int       handle = buf.ReadInt32();
                PlayerPed p      = new PlayerPed(model, handle)
                {
                    Type = type
                };
                Serializer.Read(p, buf, fmt);
                p.MaxWantedLevel = buf.ReadInt32();
                p.MaxChaosLevel  = buf.ReadInt32();
                p.ModelName      = buf.ReadString(PlayerPed.MaxModelNameLength);
                if (fmt.IsMobile)
                {
                    buf.Skip(4);
                }
                PlayerPeds.Add(p);
            }

            Debug.Assert(buf.Offset == SizeOfObject(this, fmt));
        }
Esempio n. 2
0
 public void RemoveThreat(PedTypeId type, PedTypeFlags threat)
 {
     m_pedTypes[(int)type].Threats &= ~threat;
 }
Esempio n. 3
0
 public bool IsThreat(PedTypeId type, PedTypeFlags threat)
 {
     return(m_pedTypes[(int)type].Threats.HasFlag(threat));
 }
Esempio n. 4
0
 public void AddThreat(PedTypeId type, PedTypeFlags threat)
 {
     m_pedTypes[(int)type].Threats |= threat;
 }
Esempio n. 5
0
 public void SetThreats(PedTypeId type, PedTypeFlags threat)
 {
     m_pedTypes[(int)type].Threats = threat;
 }
Esempio n. 6
0
 public PedTypeFlags GetThreats(PedTypeId type)
 {
     return(m_pedTypes[(int)type].Threats);
 }
Esempio n. 7
0
 public PedTypeFlags GetAvoid(PedTypeId type)
 {
     return(m_pedTypes[(int)type].Avoid);
 }
Esempio n. 8
0
 public PedTypeFlags GetFlag(PedTypeId type)
 {
     return(m_pedTypes[(int)type].Flag);
 }