2021-11-28 13:00:24 +00:00
|
|
|
|
#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<http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
2022-01-06 17:46:37 +00:00
|
|
|
|
namespace CodeImp.DoomBuilder.UDBScript.Wrapper
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
class DataWrapper
|
|
|
|
|
{
|
2022-11-13 00:15:17 +00:00
|
|
|
|
#region ================== Constructors
|
|
|
|
|
|
|
|
|
|
internal DataWrapper() { }
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region ================== Methods
|
|
|
|
|
|
2021-11-28 13:00:24 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns an `Array` of all texture names.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>`Array` of all texture names</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public string[] getTextureNames()
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return General.Map.Data.TextureNames.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if a texture with the given name exists.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">Texture name to check</param>
|
|
|
|
|
/// <returns>`true` if the texture exists, `false` if it doesn't</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public bool textureExists(string name)
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return General.Map.Data.GetTextureExists(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns an `ImageInfo` object for the given texture name.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">Texture name to get the info for</param>
|
|
|
|
|
/// <returns>`ImageInfo` object containing information about the texture</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public ImageInfo getTextureInfo(string name)
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return new ImageInfo(General.Map.Data.GetTextureImage(name));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns an `Array`of all flat names.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>`Array` of all flat names</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public string[] getFlatNames()
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return General.Map.Data.FlatNames.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if a flat with the given name exists.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">Flat name to check</param>
|
|
|
|
|
/// <returns>`true` if the flat exists, `false` if it doesn't</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public bool flatExists(string name)
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return General.Map.Data.GetFlatExists(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns an `ImageInfo` object for the given flat name.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="name">Flat name to get the info for</param>
|
|
|
|
|
/// <returns>`ImageInfo` object containing information about the flat</returns>
|
2022-11-13 00:15:17 +00:00
|
|
|
|
public ImageInfo getFlatInfo(string name)
|
2021-11-28 13:00:24 +00:00
|
|
|
|
{
|
|
|
|
|
return new ImageInfo(General.Map.Data.GetFlatImage(name));
|
|
|
|
|
}
|
2022-11-13 00:15:17 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
2021-11-28 13:00:24 +00:00
|
|
|
|
}
|
|
|
|
|
}
|