コード例 #1
0
        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
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public EntityVariableCreator(NetworkHandlerSystem nhs, long entityId)
 {
     if (nhs != null)
     {
         this.nhs = nhs;
     }
     else
     {
         throw new Exception(nameof(nhs));
     }
     this.entityId = entityId;
 }
コード例 #4
0
 public static IVariableCreator CreateGlobalVariables(this NetworkHandlerSystem nhs)
 {
     return(new EntityVariableCreator(nhs, 0));
 }