예제 #1
0
 public void ReadEntityUpdate(AUT_WH.MajorDomoProtocol.EntityUpdate _update)
 {
     // go through the update list
     for (int valueIdx = 0; valueIdx < _update.ValuesLength; valueIdx++)
     {
         // search by value index
         var         valueUpdate = _update.Values(valueIdx).Value;
         EntityValue value       = GetValue((byte)valueUpdate.Index);
         if (value != null)
         {
             // is this the correct type?
             if (value.Type == valueUpdate.Type)
             {
                 // read value and remember if this changed it
                 m_updated |= value.ReadEntityValue(valueUpdate);
                 // Debug.Log("updated " + Name + "/" + value.Name + ":" + updated);
             }
         }
     }
 }
예제 #2
0
 public void ReadEntityValues(AUT_WH.MajorDomoProtocol.EntityInformation _information)
 {
     // go through the update list
     for (int valueIdx = 0; valueIdx < _information.ValuesLength; valueIdx++)
     {
         // search by value index
         var         valueInformation = _information.Values(valueIdx).Value;
         EntityValue value            = EntityValue.GenerateEntityValueInstance(valueInformation.Name, (byte)valueIdx, valueInformation.Type);
         if (value != null)                 // TODO: This could cause index mismatch
         {
             m_values.Add(value);
             value.ReadEntityValue(valueInformation);
             m_updated = true;
         }
         else
         {
             Debug.LogWarning("Could not create entity value '" + valueInformation.Name + "' for " + ToString());
         }
     }
 }