Skip to content

Commit 500626d

Browse files
committed
Moved INetworkedVar interface to NetworkedVarMeta file
1 parent 6b0994c commit 500626d

File tree

2 files changed

+60
-58
lines changed

2 files changed

+60
-58
lines changed

MLAPI/Data/NetworkedVar.cs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -171,62 +171,4 @@ public string GetChannel()
171171
return Settings.SendChannel;
172172
}
173173
}
174-
175-
/// <summary>
176-
/// Interface for networked value containers
177-
/// </summary>
178-
public interface INetworkedVar
179-
{
180-
/// <summary>
181-
/// Returns the name of the channel to be used for syncing
182-
/// </summary>
183-
/// <returns>The name of the channel to be used for syncing</returns>
184-
string GetChannel();
185-
/// <summary>
186-
/// Resets the dirty state and marks the variable as synced / clean
187-
/// </summary>
188-
void ResetDirty();
189-
/// <summary>
190-
/// Gets wheter or not the container is dirty
191-
/// </summary>
192-
/// <returns>Wheter or not the container is dirty</returns>
193-
bool IsDirty();
194-
/// <summary>
195-
/// Gets wheter or not a specific client can write to the varaible
196-
/// </summary>
197-
/// <param name="clientId">The clientId of the remote client</param>
198-
/// <returns>Wheter or not the client can write to the variable</returns>
199-
bool CanClientWrite(uint clientId);
200-
/// <summary>
201-
/// Gets wheter or not a specific client can read to the varaible
202-
/// </summary>
203-
/// <param name="clientId">The clientId of the remote client</param>
204-
/// <returns>Wheter or not the client can read to the variable</returns>
205-
bool CanClientRead(uint clientId);
206-
/// <summary>
207-
/// Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer
208-
/// </summary>
209-
/// <param name="writer">The writer to write the dirty changes to</param>
210-
void WriteDelta(BitWriter writer);
211-
/// <summary>
212-
/// Writes the complete state of the variable to the writer
213-
/// </summary>
214-
/// <param name="writer">The writer to write the state to</param>
215-
void WriteField(BitWriter writer);
216-
/// <summary>
217-
/// Reads the complete state from the reader and applies it
218-
/// </summary>
219-
/// <param name="reader">The reader to read the state from</param>
220-
void ReadField(BitReader reader);
221-
/// <summary>
222-
/// Reads delta from the reader and applies them to the internal value
223-
/// </summary>
224-
/// <param name="reader">The reader to read the delta from</param>
225-
void ReadDelta(BitReader reader);
226-
/// <summary>
227-
/// Sets NetworkedBehaviour the container belongs to.
228-
/// </summary>
229-
/// <param name="behaviour">The behaviour the container behaves to</param>
230-
void SetNetworkedBehaviour(NetworkedBehaviour behaviour);
231-
}
232174
}

MLAPI/Data/NetworkedVarMeta.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,67 @@
11
using MLAPI.MonoBehaviours.Core;
2+
using MLAPI.NetworkingManagerComponents.Binary;
23

34
namespace MLAPI.Data
45
{
6+
7+
/// <summary>
8+
/// Interface for networked value containers
9+
/// </summary>
10+
public interface INetworkedVar
11+
{
12+
/// <summary>
13+
/// Returns the name of the channel to be used for syncing
14+
/// </summary>
15+
/// <returns>The name of the channel to be used for syncing</returns>
16+
string GetChannel();
17+
/// <summary>
18+
/// Resets the dirty state and marks the variable as synced / clean
19+
/// </summary>
20+
void ResetDirty();
21+
/// <summary>
22+
/// Gets wheter or not the container is dirty
23+
/// </summary>
24+
/// <returns>Wheter or not the container is dirty</returns>
25+
bool IsDirty();
26+
/// <summary>
27+
/// Gets wheter or not a specific client can write to the varaible
28+
/// </summary>
29+
/// <param name="clientId">The clientId of the remote client</param>
30+
/// <returns>Wheter or not the client can write to the variable</returns>
31+
bool CanClientWrite(uint clientId);
32+
/// <summary>
33+
/// Gets wheter or not a specific client can read to the varaible
34+
/// </summary>
35+
/// <param name="clientId">The clientId of the remote client</param>
36+
/// <returns>Wheter or not the client can read to the variable</returns>
37+
bool CanClientRead(uint clientId);
38+
/// <summary>
39+
/// Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer
40+
/// </summary>
41+
/// <param name="writer">The writer to write the dirty changes to</param>
42+
void WriteDelta(BitWriter writer);
43+
/// <summary>
44+
/// Writes the complete state of the variable to the writer
45+
/// </summary>
46+
/// <param name="writer">The writer to write the state to</param>
47+
void WriteField(BitWriter writer);
48+
/// <summary>
49+
/// Reads the complete state from the reader and applies it
50+
/// </summary>
51+
/// <param name="reader">The reader to read the state from</param>
52+
void ReadField(BitReader reader);
53+
/// <summary>
54+
/// Reads delta from the reader and applies them to the internal value
55+
/// </summary>
56+
/// <param name="reader">The reader to read the delta from</param>
57+
void ReadDelta(BitReader reader);
58+
/// <summary>
59+
/// Sets NetworkedBehaviour the container belongs to.
60+
/// </summary>
61+
/// <param name="behaviour">The behaviour the container behaves to</param>
62+
void SetNetworkedBehaviour(NetworkedBehaviour behaviour);
63+
}
64+
565
/// <summary>
666
/// The settings class used by the build in NetworkVar implementations
767
/// </summary>

0 commit comments

Comments
 (0)