ace/Source/ACE.Database/SQLFormatters/World/HousePortalSQLWriter.cs
Mag-nus 8a642308bc This changes the writers so that angles are written in WXYZ format instead of XYZW
The cache.bin, as well as the client use these data structs in WXYZ order.

However, when you actually construct a Quaternion in ACE (Which uses a System.Numerics native type), the arguments are passed in XYZW.

I prefer XYZW order, but, to keep things in lined with the client, I've univied angles to be WXYZ order in our cache.bin exporter and in ACE.
2018-08-04 10:36:36 -05:00

37 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using ACE.Database.Models.World;
namespace ACE.Database.SQLFormatters.World
{
public class HousePortalSQLWriter : SQLWriter
{
/// <summary>
/// Default is formed from: input.HouseId.ToString("00000")
/// </summary>
public string GetDefaultFileName(HousePortal input)
{
string fileName = input.HouseId.ToString("00000");
fileName = IllegalInFileName.Replace(fileName, "_");
fileName += ".sql";
return fileName;
}
public void CreateSQLDELETEStatement(IList<HousePortal> input, StreamWriter writer)
{
throw new NotImplementedException();
}
public void CreateSQLINSERTStatement(IList<HousePortal> input, StreamWriter writer)
{
writer.WriteLine("INSERT INTO `house_portal` (`house_Id`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`)");
var lineGenerator = new Func<int, string>(i => $"{input[i].HouseId}, {input[i].ObjCellId}, {input[i].OriginX}, {input[i].OriginY}, {input[i].OriginZ}, {input[i].AnglesW}, {input[i].AnglesX}, {input[i].AnglesY}, {input[i].AnglesZ})");
ValuesWriter(input.Count, lineGenerator, writer);
}
}
}