Beispiel #1
0
        public void Load()
        {
            var ext = (Path.GetExtension(Name) ?? "").ToLower();

            switch (ext)
            {
                case ".gob":
                    var texFileName = Path.GetFileNameWithoutExtension(Name) + ".tex";
                    WorldGob = new GobFile(EngineVersion, Path.Combine(DataPath, Name));
                    WorldTex = new WorldTexFile(EngineVersion, Path.Combine(DataPath, texFileName));
                    break;
                case ".lmp":
                    // TODO: Support just passing the filepath instead of having to load data here
                    var data = File.ReadAllBytes(Path.Combine(DataPath, Name));
                    WorldLmp = new LmpFile(EngineVersion, Name, data, 0, data.Length);
                    break;
                case ".yak":
                    var yakData = File.ReadAllBytes(Path.Combine(DataPath, Name));
                    WorldYak = new YakFile(EngineVersion, Name, yakData);
                    break;
                default:
                    throw new NotSupportedException("Unsupported file type");
            }
        }
 public YakTreeViewItem(TreeViewItemViewModel parent, YakFile yakFile, YakFile.Entry entry, String name)
     : base(parent, true)
 {
     _yakFile = yakFile;
     _entry = entry;
     _name = name;
 }
 public YakTreeViewModel(TreeViewItemViewModel parent, YakFile yakFile)
     : base(parent, true)
 {
     _parent = parent;
     _yakFile = yakFile;
     _name = yakFile.Name;
 }
 public YakChildTreeViewItem(TreeViewItemViewModel parent, YakFile yakFile, YakFile.Child value, YakFile.Entry entry, String name)
     : base(parent, false)
 {
     _yakFile = yakFile;
     _value = value;
     _entry = entry;
     _name = name;
 }