Skip to content

Commit c816086

Browse files
committed
Added XML comments
1 parent 020e60a commit c816086

File tree

7 files changed

+58
-6
lines changed

7 files changed

+58
-6
lines changed

MLAPI/Attributes/BinaryIgnore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace MLAPI.Attributes
44
{
55
/// <summary>
6-
/// The attribute to use for variables that should be automatically. replicated from Server to Client.
6+
/// The attribute to use for fields that should be ignored by the BinarySerializer
77
/// </summary>
88
[AttributeUsage(AttributeTargets.Field)]
99
public class BinaryIgnore : Attribute

MLAPI/Attributes/ClientRpc.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace MLAPI.Attributes
44
{
5+
/// <summary>
6+
/// This attribute is used to specify that this is a remote Client RPC
7+
/// </summary>
58
[AttributeUsage(AttributeTargets.Method)]
69
public class ClientRpc : Attribute
710
{

MLAPI/Attributes/Command.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace MLAPI.Attributes
44
{
5+
/// <summary>
6+
/// This attribute is used to specify that this is a remote Command
7+
/// </summary>
58
[AttributeUsage(AttributeTargets.Method)]
69
public class Command : Attribute
710
{

MLAPI/Attributes/TargetRpc.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace MLAPI.Attributes
44
{
5+
/// <summary>
6+
/// This attribute is used to specify that this is a remote Target RPC
7+
/// </summary>
58
[AttributeUsage(AttributeTargets.Method)]
69
public class TargetRpc : Attribute
710
{

MLAPI/Data/FixedQueue.cs

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,36 @@
22

33
namespace MLAPI.Data
44
{
5-
public class FixedQueue<T>
5+
/// <summary>
6+
/// Queue with a fixed size
7+
/// </summary>
8+
/// <typeparam name="T">The type of the queue</typeparam>
9+
public sealed class FixedQueue<T>
610
{
7-
protected readonly T[] queue;
8-
protected int queueCount = 0;
9-
protected int queueStart;
11+
private readonly T[] queue;
12+
private int queueCount = 0;
13+
private int queueStart;
1014

15+
/// <summary>
16+
/// The amount of enqueued objects
17+
/// </summary>
1118
public int Count { get => queueCount; }
1219

20+
/// <summary>
21+
/// Creates a new FixedQueue with a given size
22+
/// </summary>
23+
/// <param name="maxSize">The size of the queue</param>
1324
public FixedQueue(int maxSize)
1425
{
1526
queue = new T[maxSize];
1627
queueStart = 0;
1728
}
1829

30+
/// <summary>
31+
/// Enqueues an object
32+
/// </summary>
33+
/// <param name="t"></param>
34+
/// <returns></returns>
1935
public bool Enqueue(T t)
2036
{
2137
queue[(queueStart + queueCount) % queue.Length] = t;
@@ -27,6 +43,10 @@ public bool Enqueue(T t)
2743
return false;
2844
}
2945

46+
/// <summary>
47+
/// Dequeues an object
48+
/// </summary>
49+
/// <returns></returns>
3050
public T Dequeue()
3151
{
3252
if (--queueCount == -1) throw new IndexOutOfRangeException("Cannot dequeue empty queue!");
@@ -35,6 +55,11 @@ public T Dequeue()
3555
return res;
3656
}
3757

58+
/// <summary>
59+
/// Gets the element at a given virtual index
60+
/// </summary>
61+
/// <param name="index"></param>
62+
/// <returns></returns>
3863
public T ElementAt(int index) => queue[(queueStart + index) % queue.Length];
3964
}
4065
}

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ private void CacheAttributedMethods()
156156
}
157157
}
158158

159+
/// <summary>
160+
/// Calls a Command method on server
161+
/// </summary>
162+
/// <param name="methodName">Method name to invoke</param>
163+
/// <param name="methodParams">Method parameters to send</param>
159164
protected void InvokeCommand(string methodName, params object[] methodParams)
160165
{
161166
if (NetworkingManager.singleton.isServer)
@@ -192,6 +197,11 @@ protected void InvokeCommand(string methodName, params object[] methodParams)
192197
}
193198
}
194199

200+
/// <summary>
201+
/// Calls a ClientRpc method on all clients
202+
/// </summary>
203+
/// <param name="methodName">Method name to invoke</param>
204+
/// <param name="methodParams">Method parameters to send</param>
195205
protected void InvokeClientRpc(string methodName, params object[] methodParams)
196206
{
197207
if (!NetworkingManager.singleton.isServer)
@@ -224,6 +234,11 @@ protected void InvokeClientRpc(string methodName, params object[] methodParams)
224234
}
225235
}
226236

237+
/// <summary>
238+
/// Calls a TargetRpc method on the owner client
239+
/// </summary>
240+
/// <param name="methodName">Method name to invoke</param>
241+
/// <param name="methodParams">Method parameters to send</param>
227242
protected void InvokeTargetRpc(string methodName, params object[] methodParams)
228243
{
229244
if (!NetworkingManager.singleton.isServer)
@@ -673,7 +688,7 @@ protected void SendToLocalClientTarget(string messageType, string channelName, b
673688
InternalMessageHandler.Send(ownerClientId, messageType, channelName, data, networkId, networkedObject.GetOrderIndex(this));
674689
}
675690

676-
/// <summary>
691+
/// <summary>gh
677692
/// Sends a buffer to the client that owns this object from the server. Only handlers on this NetworkedBehaviour will get invoked
678693
/// </summary>
679694
/// <typeparam name="T">The class type to send</typeparam>

MLAPI/MonoBehaviours/Core/TrackedObject.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public float AvgTimeBetweenPointsMs
4545
}
4646
}
4747

48+
/// <summary>
49+
/// Gets the total time history we have for this object
50+
/// </summary>
4851
public float TotalTimeHistory
4952
{
5053
get

0 commit comments

Comments
 (0)