Beispiel #1
0
        public EntityData(AUT_WH.MajorDomoProtocol.EntityInformation _information)
        {
            Name      = _information.Name;
            ClientUID = _information.ClientUID;
            EntityUID = _information.EntityUID;
            State     = EntityState.Created;

            m_properties = _information.Properties;
            m_values     = new List <EntityValue>();
            m_updated    = false;

            ReadEntityValues(_information);

            CheckRegistered();
        }
Beispiel #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());
         }
     }
 }