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)); }
public void RemoveThreat(PedTypeId type, PedTypeFlags threat) { m_pedTypes[(int)type].Threats &= ~threat; }
public bool IsThreat(PedTypeId type, PedTypeFlags threat) { return(m_pedTypes[(int)type].Threats.HasFlag(threat)); }
public void AddThreat(PedTypeId type, PedTypeFlags threat) { m_pedTypes[(int)type].Threats |= threat; }
public void SetThreats(PedTypeId type, PedTypeFlags threat) { m_pedTypes[(int)type].Threats = threat; }
public PedTypeFlags GetThreats(PedTypeId type) { return(m_pedTypes[(int)type].Threats); }
public PedTypeFlags GetAvoid(PedTypeId type) { return(m_pedTypes[(int)type].Avoid); }
public PedTypeFlags GetFlag(PedTypeId type) { return(m_pedTypes[(int)type].Flag); }