public static IVariableCreator CreateIdentityVariables(this NetworkHandlerSystem nhs, IMyPlayer player) { if (player == null) { throw new Exception(nameof(player)); } return(new EntityVariableCreator(nhs, player.IdentityId)); //TODO: clear when identity destroyed }
public static IVariableCreator CreateEntityVariables(this NetworkHandlerSystem nhs, IMyEntity entity) { if (entity == null) { throw new Exception(nameof(entity)); } var res = new EntityVariableCreator(nhs, entity.EntityId); entity.OnClose += res.OnEntityClose; return(res); }
public EntityVariableCreator(NetworkHandlerSystem nhs, long entityId) { if (nhs != null) { this.nhs = nhs; } else { throw new Exception(nameof(nhs)); } this.entityId = entityId; }
public static IVariableCreator CreateGlobalVariables(this NetworkHandlerSystem nhs) { return(new EntityVariableCreator(nhs, 0)); }