Example #1
0
        public static void WriteConfiguration(Parts.IActor actor, Kc.Chunk outputChunk)
        {
            Parts.IProperty[] properties = actor.Properties;

            foreach (Parts.IProperty p in properties)
            {
                WriteValue(outputChunk, p);
            }
        }
Example #2
0
        public static void ReadConfiguration(Parts.IActor actor, Kc.Chunk inputChunk)
        {
            Parts.IProperty[] properties = actor.Properties;

            foreach (Parts.IProperty p in properties)
            {
                ReadValue(inputChunk, p);
            }
        }
Example #3
0
        public static bool WriteValue(Kc.Chunk outputChunk, Parts.IProperty property)
        {
            if (property.CurrentValue != null)
            {
                outputChunk.SetValue(property.Name, property.CurrentValue);
                return(true);
            }

            return(false);
        }
Example #4
0
 public static bool ReadValue(Kc.Chunk inputChunk, Parts.IProperty property)
 {
     if (property.DefaultValue != null)
     {
         object valueObject = inputChunk.GetValueObject(property.Name, property.DefaultValue);
         property.CurrentValue = valueObject;
         return(true);
     }
     return(false);
 }