22using System . Collections ;
33using System . Collections . Generic ;
44using System . Linq ;
5- using CitizenFX . Core . Native ;
5+
6+ using static CitizenFX . Core . Native . API ;
67
78namespace CitizenFX . Core
89{
@@ -22,19 +23,19 @@ internal Player(string sourceString)
2223 m_handle = sourceString ;
2324 }
2425
25- public string Name => API . GetPlayerName ( m_handle ) ;
26+ public string Name => GetPlayerName ( m_handle ) ;
2627
27- public int Ping => API . GetPlayerPing ( m_handle ) ;
28+ public int Ping => GetPlayerPing ( m_handle ) ;
2829
29- public int LastMsg => API . GetPlayerLastMsg ( m_handle ) ;
30+ public int LastMsg => GetPlayerLastMsg ( m_handle ) ;
3031
3132 public IdentifierCollection Identifiers => new IdentifierCollection ( this ) ;
3233
33- public string EndPoint => API . GetPlayerEndpoint ( m_handle ) ;
34+ public string EndPoint => GetPlayerEndpoint ( m_handle ) ;
3435
3536 public Ped Character => Ped . FromPlayerHandle ( m_handle ) ;
3637
37- public void Drop ( string reason ) => API . DropPlayer ( m_handle , reason ) ;
38+ public void Drop ( string reason ) => DropPlayer ( m_handle , reason ) ;
3839
3940 public void TriggerEvent ( string eventName , params object [ ] args )
4041 {
@@ -44,7 +45,7 @@ public void TriggerEvent(string eventName, params object[] args)
4445 {
4546 fixed ( byte * serialized = & argsSerialized [ 0 ] )
4647 {
47- API . TriggerClientEventInternal ( eventName , m_handle , serialized , argsSerialized . Length ) ;
48+ TriggerClientEventInternal ( eventName , m_handle , serialized , argsSerialized . Length ) ;
4849 }
4950 }
5051 }
@@ -91,11 +92,11 @@ internal IdentifierCollection(Player player)
9192
9293 public IEnumerator < string > GetEnumerator ( )
9394 {
94- int numIndices = API . GetNumPlayerIdentifiers ( m_player . Handle ) ;
95+ int numIndices = GetNumPlayerIdentifiers ( m_player . Handle ) ;
9596
9697 for ( var i = 0 ; i < numIndices ; i ++ )
9798 {
98- yield return API . GetPlayerIdentifier ( m_player . Handle , i ) ;
99+ yield return GetPlayerIdentifier ( m_player . Handle , i ) ;
99100 }
100101 }
101102
@@ -119,11 +120,11 @@ public class PlayerList : IEnumerable<Player>
119120 {
120121 public IEnumerator < Player > GetEnumerator ( )
121122 {
122- int numIndices = API . GetNumPlayerIndices ( ) ;
123+ int numIndices = GetNumPlayerIndices ( ) ;
123124
124125 for ( var i = 0 ; i < numIndices ; i ++ )
125126 {
126- yield return new Player ( API . GetPlayerFromIndex ( i ) ) ;
127+ yield return new Player ( GetPlayerFromIndex ( i ) ) ;
127128 }
128129 }
129130
0 commit comments