mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Add useful method
This commit is contained in:
1 parent
96c2647193
commit
b55d09de71
1 file changed
+8
@@ -5,6 +5,8 @@ namespace Impostor.Api.Innersloth.Net
|
||||
{
|
||||
public abstract class InnerNetObject : GameObject
|
||||
{
|
||||
private const int HostInheritId = -2;
|
||||
|
||||
public uint NetId { get; internal set; }
|
||||
|
||||
public int OwnerId { get; internal set; }
|
||||
@@ -16,5 +18,11 @@ namespace Impostor.Api.Innersloth.Net
|
||||
public abstract bool Serialize(IMessageWriter writer, bool initialState);
|
||||
|
||||
public abstract void Deserialize(IClientPlayer sender, IClientPlayer? target, IMessageReader reader, bool initialState);
|
||||
|
||||
public bool IsOwnedBy(IClientPlayer player)
|
||||
{
|
||||
return OwnerId == player.Client.Id ||
|
||||
(OwnerId == HostInheritId && player.IsHost);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user