mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
a todo
This commit is contained in:
1 parent
74592b2558
commit
2dadf08df4
2 files changed
+11
-2
No files matched your search
@@ -81,7 +81,6 @@ public interface ICustomRole
|
||||
ParentMod.PluginConfig.TryGetEntry<int>(NumConfigDefinition, out var numEntry);
|
||||
ParentMod.PluginConfig.TryGetEntry<int>(ChanceConfigDefinition, out var chanceEntry);
|
||||
|
||||
// TODO: use the RoleID class when that branch is merged
|
||||
return new NetData((uint)((RoleBehaviour)this).Role, BitConverter.GetBytes(numEntry.Value).AddRangeToArray(BitConverter.GetBytes(chanceEntry.Value)));
|
||||
return new NetData(RoleId.Get(GetType()), BitConverter.GetBytes(numEntry.Value).AddRangeToArray(BitConverter.GetBytes(chanceEntry.Value)));
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,14 @@ public class RoleId
|
||||
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public static ushort Get(Type type)
|
||||
{
|
||||
if (!CustomRoleManager.RoleIds.TryGetValue(type, out var roleId))
|
||||
{
|
||||
throw new InvalidOperationException($"Role {type} is not registered");
|
||||
}
|
||||
|
||||
return roleId;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user