Ejemplo n.º 1
0
        /// <summary>
        /// Copies a Chat Mapper user variable asset.
        /// </summary>
        /// <param name='chatMapperUserVariable'>
        /// The Chat Mapper user variable.
        /// </param>
        public void Assign(ChatMapper.UserVariable chatMapperUserVariable)
        {
            if (chatMapperUserVariable != null)
            {
                Assign(0, chatMapperUserVariable.Fields);

                // Chat Mapper 1.6 XML lists type of bools as "Number". This fixes it:
                Field initialValue = Field.Lookup(fields, DialogueSystemFields.InitialValue);
                if ((initialValue != null) &&
                    (initialValue.type == FieldType.Number) &&
                    (string.Equals(initialValue.value, "True", System.StringComparison.OrdinalIgnoreCase) || (string.Equals(initialValue.value, "False", System.StringComparison.OrdinalIgnoreCase))))
                {
                    initialValue.type = FieldType.Boolean;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copies a Chat Mapper user variable asset.
        /// </summary>
        /// <param name='chatMapperUserVariable'>
        /// The Chat Mapper user variable.
        /// </param>
        public void Assign(ChatMapper.UserVariable chatMapperUserVariable)
        {
            if (chatMapperUserVariable != null)
            {
                Assign(0, chatMapperUserVariable.Fields);

                // Chat Mapper 1.6 XML lists type of bools as "Number". This fixes it:
                Field initialValue = Field.Lookup(fields, "Initial Value");
                if ((initialValue != null) &&
                    (initialValue.type == FieldType.Number) &&
                    (string.Equals(initialValue.value, "True") || (string.Equals(initialValue.value, "False"))))
                {
                    initialValue.type = FieldType.Boolean;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new Variable copied from a Chat Mapper user variable.
 /// </summary>
 /// <param name='chatMapperUserVariable'>
 /// The Chat Mapper user variable.
 /// </param>
 public Variable(ChatMapper.UserVariable chatMapperUserVariable)
 {
     Assign(chatMapperUserVariable);
 }