Example #1
0
        public override bool SetProperty(string propertyName, string value, string[] source, ref int line)
        {
            switch (propertyName)
            {
            case "Name":
                m_name = value;
                break;

            case "Comment":
                m_comment = Parser.ParseComment(value, source, ref line);
                break;

            case "Public":
                m_public = Parser.ParseInt(value, line);
                break;

            case "Background Music":
                m_backgroundMusic = Parser.ParseInt(value, line);
                break;

            case "Volume":
                m_volume = Parser.ParseInt(value, line);
                break;

            case "Category Entry":
            case "Parent":                      // So say the docs, but not the XAP file!
                m_parentCategory = new CategoryEntry();
                m_parentCategory.Parse(source, ref line, OwnerProject);
                break;

            case "Instance Limit":
                m_instanceLimit = new InstanceLimit();
                m_instanceLimit.Parse(source, ref line, OwnerProject);
                break;

            default:
                return(false);
            }

            return(true);
        }
Example #2
0
        public override bool SetProperty(string propertyName, string value, string[] source, ref int line)
        {
            switch (propertyName)
            {
            case "Name":
                m_name = value;
                break;

            case "Volume":
                m_volume = Parser.ParseInt(value, line);
                break;

            case "Pitch":
                m_pitch = Parser.ParseInt(value, line);
                break;

            case "Priority":
                m_priority = Parser.ParseInt(value, line);
                break;

            case "Category Entry":
                // Docs appear to be wrong about how this is arranged
                CategoryEntry entry = new CategoryEntry();
                entry.Parse(source, ref line, OwnerProject);
                m_category = entry.FindCategory();
                break;

            case "Effect Entry":
                EffectEntry effectEntry = new EffectEntry();
                effectEntry.Parse(source, ref line, OwnerProject);

                foreach (Effect effect in OwnerProject.m_globalSettings.m_effects)
                {
                    if (effect.m_name == effectEntry.m_name)
                    {
                        m_effects.Add(effect);
                        break;
                    }
                }
                break;

            case "RPC Entry":
                RpcEntry rpcEntry = new RpcEntry();
                rpcEntry.Parse(source, ref line, OwnerProject);
                m_rpcEntries.Add(rpcEntry);
                break;

            case "Track":
                Track track = new Track();
                track.Parse(source, ref line, OwnerProject);
                m_tracks.Add(track);
                break;

            case "Comment":
                m_comment = Parser.ParseComment(value, source, ref line);
                break;

            default:
                return(false);
            }

            return(true);
        }