示例#1
0
        public static CTArtifact Create(string name, string[] manifest)
        {
            CTArtifactType type = (CTArtifactType)Enum.Parse(typeof(CTArtifactType), manifest[0]);
            string         path = manifest[1];
            CTArtifact     ret  = null;

            switch (type)
            {
            case CTArtifactType.TableCT:
            case CTArtifactType.TableFriendly:
            case CTArtifactType.TableRaw:
                ret = new _2da.TableArtifact(type, name, path);
                ret.LoadManifest(manifest);
                break;

            case CTArtifactType.TextFile:
            case CTArtifactType.ScriptSource:
                break;

            case CTArtifactType.Hak:
                ret = new Hak.HakArtifact(name, path);
                ret.LoadManifest(manifest);
                break;

            case CTArtifactType.TLK:
                ret = new Tlk.TlkArtifact(name, path);
                ret.LoadManifest(manifest);
                break;
            }
            return(ret);
        }
示例#2
0
        private void AddArtifact(string name)
        {
            CTArtifact artifact = CTArtifact.Create(name, System.IO.File.ReadAllLines("Artifacts\\" + name + ".txt"));

            m_afx.Add(artifact);
            if (artifact.ArtifactType == CTArtifactType.TLK)
            {
                AddTlkStack(new Tlk.TlkDocumentStacked(((Tlk.TlkArtifact)artifact).TlkName));
            }
        }