#region ================== Copyright (c) 2021 Boris Iwanski /* * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the * * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program.If not, see. */ #endregion #region ================== Namespaces using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Geometry; using CodeImp.DoomBuilder.UDBScript.Wrapper; #endregion namespace CodeImp.DoomBuilder.UDBScript.Wrapper { class DataWrapper { #region ================== Constructors internal DataWrapper() { } #endregion #region ================== Methods /// /// Returns an `Array` of all texture names. /// /// `Array` of all texture names public string[] getTextureNames() { return General.Map.Data.TextureNames.ToArray(); } /// /// Checks if a texture with the given name exists. /// /// Texture name to check /// `true` if the texture exists, `false` if it doesn't public bool textureExists(string name) { return General.Map.Data.GetTextureExists(name); } /// /// Returns an `ImageInfo` object for the given texture name. /// /// Texture name to get the info for /// `ImageInfo` object containing information about the texture public ImageInfo getTextureInfo(string name) { return new ImageInfo(General.Map.Data.GetTextureImage(name)); } /// /// Returns an `Array`of all flat names. /// /// `Array` of all flat names public string[] getFlatNames() { return General.Map.Data.FlatNames.ToArray(); } /// /// Checks if a flat with the given name exists. /// /// Flat name to check /// `true` if the flat exists, `false` if it doesn't public bool flatExists(string name) { return General.Map.Data.GetFlatExists(name); } /// /// Returns an `ImageInfo` object for the given flat name. /// /// Flat name to get the info for /// `ImageInfo` object containing information about the flat public ImageInfo getFlatInfo(string name) { return new ImageInfo(General.Map.Data.GetFlatImage(name)); } #endregion } }