/// <summary>
 /// Deletes the TangoRoom from the Room List
 /// </summary>
 /// <param name="T"></param>
 public static void DeleteRoom(TangoRoom T)
 {
     lock (Rooms)
     {
         Rooms.Remove(T);
     }
 }
        /// <summary>
        /// Updates room list with a new room with an established name
        /// </summary>
        /// <param name="newMesh"></param>
        /// <param name="name"></param>
        public static void UpdateMesh(byte[] newMesh, string name)
        {
            TangoRoom T = new TangoRoom(); //creates a new room

            T.isDirty = true;              //marks that it needs to be rendered
            T._meshes = newMesh;           //init byte array
            count++;                       //increment count
            T.ID = count;                  //set id
            //T.PhotonPlayer = playerID;
            T.name = (string)(name);       //creates name based on input name
            lock (Rooms)
            {
                Rooms.Add(T); //adds room to list
            }
            //_meshes = newMesh;
            LastUpdate = DateTime.Now;
        }
        /// <summary>
        /// Update the currently saved mesh to be the given serialized Room Mesh
        /// This method will also update the LastUpdate time
        /// </summary>
        /// <param name="newMesh">Serialized Room Mesh stored in a byte array</param>
        public static void UpdateMesh(byte[] newMesh, int playerID)
        {
            TangoRoom T = new TangoRoom();

            T.isDirty = true;                                      //keeps track that room needs to be rendered
            T._meshes = newMesh;                                   //init the byte array
            count++;                                               //increment total count
            T.ID           = count;                                //ID = count
            T.PhotonPlayer = playerID;                             //inits the player ID it was recieved from
            string name = (string)(playerID + "_" + DateTime.Now); //creates a unique name based on ID and time

            name   = name.Replace('/', '_');
            name   = name.Replace('\\', '_');
            name   = name.Replace(' ', '_');
            name   = name.Replace(':', '_');
            T.name = name;
            lock (Rooms)
            {
                Rooms.Add(T); //adds room the list
            }
            //_meshes = newMesh;
            LastUpdate = DateTime.Now;
        }
 public static IEnumerable <Mesh> GetMeshAsList(TangoRoom T)
 {
     return(NetworkingPackage.SimpleMeshSerializerTango.Deserialize(T._meshes));
 }
 /// <summary>
 /// Retrieves a specific Room Mesh as a serialized byte array
 /// </summary>
 /// <param name="T"></param>
 /// <returns>Serialized Room Mesh</returns>
 public static byte[] GetMeshAsBytes(TangoRoom T)
 {
     return(T._meshes);
 }