public bool RemoveEntity(IRegistrable _entity)
 {
     var aEntityType = _entity.GetType();
     var networkId = _entity.GetUniqueKey();
     return TypeRegisterMap[aEntityType].Remove(networkId);
 }
示例#2
0
 internal void CheckType(IRegistrable registrable)
 {
     if (registrable == null)
     {
         throw new ArgumentNullException(nameof(registrable));
     }
     if (!TargetType.IsInstanceOfType(registrable))
     {
         throw new ArgumentException($"type not match, required: {TargetType}, given: {registrable.GetType()}");
     }
 }
 public void AddEntity(IRegistrable _entity)
 {
     var aEntityType = _entity.GetType();
     var networkId = _entity.GetUniqueKey();
     TypeRegisterMap[aEntityType][networkId] = _entity;
 }