Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ba378a

Browse files
committed
docs(api-v3): add docs to PedGroup.cs
1 parent689089b commit7ba378a

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

‎source/scripting_v3/GTA/Entities/Peds/PedGroup.cs‎

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ public void Dispose()
6868
GC.SuppressFinalize(this);
6969
}
7070

71+
72+
/// <summary>
73+
/// Gets the number of members in the group.
74+
/// </summary>
7175
publicintMemberCount
7276
{
7377
get
@@ -82,30 +86,64 @@ public int MemberCount
8286
}
8387
}
8488

89+
/// <summary>
90+
/// Sets the maximum allowed distance from the group leader before a member leaves the group.
91+
/// </summary>
8592
publicfloatSeparationRange
8693
{
8794
set=>Function.Call(Hash.SET_GROUP_SEPARATION_RANGE,Handle,value);
8895
}
8996

97+
/// <summary>
98+
/// Sets the <see cref="Formation"/> this <see cref="PedGroup"/> will use.
99+
/// </summary>
90100
publicFormationFormation
91101
{
92102
set=>Function.Call(Hash.SET_GROUP_FORMATION,Handle,(int)value);
93103
}
94104

105+
/// <summary>
106+
/// Adds the specified <see cref="Ped"/> to this <see cref="PedGroup"/> as either a member or the leader.
107+
/// </summary>
108+
/// <param name="ped">The <see cref="Ped"/> to add to the group.</param>
109+
/// <param name="leader">
110+
/// If <c>true</c>, assigns the <paramref name="ped"/> as the group leader; otherwise, adds them as a regular member.
111+
/// </param>
112+
/// <remarks>
113+
/// The game checks against an internal limit of 8 members per group.
114+
/// </remarks>
95115
publicvoidAdd(Pedped,boolleader)
96116
{
97117
Function.Call(leader?Hash.SET_PED_AS_GROUP_LEADER:Hash.SET_PED_AS_GROUP_MEMBER,ped.Handle,Handle);
98118
}
119+
120+
/// <summary>
121+
/// Removes the specified <see cref="Ped"/> from this <see cref="PedGroup"/>.
122+
/// </summary>
123+
/// <param name="ped">The <see cref="Ped"/> to remove from the group.</param>
99124
publicvoidRemove(Pedped)
100125
{
101126
Function.Call(Hash.REMOVE_PED_FROM_GROUP,ped.Handle);
102127
}
103128

129+
/// <summary>
130+
/// Determines whether the specified <see cref="Ped"/> is a member of this <see cref="PedGroup"/>.
131+
/// </summary>
132+
/// <param name="ped">The <see cref="Ped"/> to check for membership.</param>
133+
/// <returns>
134+
/// <c>true</c> if the <paramref name="ped"/> is a member of this group; otherwise, <c>false</c>.
135+
/// </returns>
104136
publicboolContains(Pedped)
105137
{
106138
returnFunction.Call<bool>(Hash.IS_PED_GROUP_MEMBER,ped.Handle,Handle);
107139
}
108140

141+
/// <summary>
142+
/// Gets the leader <see cref="Ped"/> of this <see cref="PedGroup"/>.
143+
/// </summary>
144+
/// <returns>
145+
/// The leader <see cref="Ped"/> of the group, or <c>null</c> if the group has no leader.
146+
/// </returns>
109147
publicPedLeader
110148
{
111149
get
@@ -115,17 +153,44 @@ public Ped Leader
115153
}
116154
}
117155

156+
/// <summary>
157+
/// Gets the member <see cref="Ped"/> at the specified index within this <see cref="PedGroup"/>.
158+
/// </summary>
159+
/// <param name="index">
160+
/// The zero-based index of the group member (0–7).
161+
/// </param>
162+
/// <returns>
163+
/// The <see cref="Ped"/> at the specified index, or <c>null</c> if no member exists at that position.
164+
/// </returns>
118165
publicPedGetMember(intindex)
119166
{
120167
inthandle=Function.Call<int>(Hash.GET_PED_AS_GROUP_MEMBER,Handle,index);
121168
returnhandle!=0?newPed(handle):null;
122169
}
123170

171+
/// <summary>
172+
/// Returns all <see cref="Ped"/>s in this <see cref="PedGroup"/> as an array.
173+
/// </summary>
174+
/// <param name="includingLeader">
175+
/// If <c>true</c>, includes the group leader in the returned array; otherwise, only members are included.
176+
/// </param>
177+
/// <returns>
178+
/// An array of <see cref="Ped"/> objects representing the group's members (and optionally the leader).
179+
/// </returns>
124180
publicPed[]ToArray(boolincludingLeader=true)
125181
{
126182
returnToList(includingLeader).ToArray();
127183
}
128184

185+
/// <summary>
186+
/// Returns all <see cref="Ped"/>s in this <see cref="PedGroup"/> as a <c>List</c>.
187+
/// </summary>
188+
/// <param name="includingLeader">
189+
/// If <c>true</c>, includes the group leader in the returned list; otherwise, only members are included.
190+
/// </param>
191+
/// <returns>
192+
/// A list of <see cref="Ped"/> objects representing the group's members (and optionally the leader).
193+
/// </returns>
129194
publicList<Ped>ToList(boolincludingLeader=true)
130195
{
131196
intmemberCount=MemberCount;
@@ -156,7 +221,7 @@ public List<Ped> ToList(bool includingLeader = true)
156221
}
157222

158223
/// <summary>
159-
///Removes this <see cref="PedGroup"/>.
224+
///Deletes this <see cref="PedGroup"/>.
160225
/// </summary>
161226
publicoverridevoidDelete()
162227
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp