Revert "refactor(Dalamud): switch to file-scoped namespaces"

This reverts commit b5f34c3199.
This commit is contained in:
goat 2021-11-18 15:23:40 +01:00
parent d473826247
commit 1561fbac00
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
325 changed files with 45549 additions and 45209 deletions

View file

@ -4,75 +4,76 @@ using System.IO;
using Lumina.Excel.GeneratedSheets;
using Newtonsoft.Json;
namespace Dalamud.Game.Text.SeStringHandling.Payloads;
/// <summary>
/// An SeString Payload representing an interactable status link.
/// </summary>
public class StatusPayload : Payload
namespace Dalamud.Game.Text.SeStringHandling.Payloads
{
private Status status;
[JsonProperty]
private uint statusId;
/// <summary>
/// Initializes a new instance of the <see cref="StatusPayload"/> class.
/// Creates a new StatusPayload for the given status id.
/// An SeString Payload representing an interactable status link.
/// </summary>
/// <param name="statusId">The id of the Status for this link.</param>
public StatusPayload(uint statusId)
public class StatusPayload : Payload
{
this.statusId = statusId;
}
private Status status;
/// <summary>
/// Initializes a new instance of the <see cref="StatusPayload"/> class.
/// Creates a new StatusPayload for the given status id.
/// </summary>
internal StatusPayload()
{
}
[JsonProperty]
private uint statusId;
/// <inheritdoc/>
public override PayloadType Type => PayloadType.Status;
/// <summary>
/// Initializes a new instance of the <see cref="StatusPayload"/> class.
/// Creates a new StatusPayload for the given status id.
/// </summary>
/// <param name="statusId">The id of the Status for this link.</param>
public StatusPayload(uint statusId)
{
this.statusId = statusId;
}
/// <summary>
/// Gets the Lumina Status object represented by this payload.
/// </summary>
/// <remarks>
/// The value is evaluated lazily and cached.
/// </remarks>
[JsonIgnore]
public Status Status => this.status ??= this.DataResolver.GetExcelSheet<Status>().GetRow(this.statusId);
/// <summary>
/// Initializes a new instance of the <see cref="StatusPayload"/> class.
/// Creates a new StatusPayload for the given status id.
/// </summary>
internal StatusPayload()
{
}
/// <inheritdoc/>
public override string ToString()
{
return $"{this.Type} - StatusId: {this.statusId}, Name: {this.Status.Name}";
}
/// <inheritdoc/>
public override PayloadType Type => PayloadType.Status;
/// <inheritdoc/>
protected override byte[] EncodeImpl()
{
var idBytes = MakeInteger(this.statusId);
/// <summary>
/// Gets the Lumina Status object represented by this payload.
/// </summary>
/// <remarks>
/// The value is evaluated lazily and cached.
/// </remarks>
[JsonIgnore]
public Status Status => this.status ??= this.DataResolver.GetExcelSheet<Status>().GetRow(this.statusId);
var chunkLen = idBytes.Length + 7;
var bytes = new List<byte>()
/// <inheritdoc/>
public override string ToString()
{
return $"{this.Type} - StatusId: {this.statusId}, Name: {this.Status.Name}";
}
/// <inheritdoc/>
protected override byte[] EncodeImpl()
{
var idBytes = MakeInteger(this.statusId);
var chunkLen = idBytes.Length + 7;
var bytes = new List<byte>()
{
START_BYTE, (byte)SeStringChunkType.Interactable, (byte)chunkLen, (byte)EmbeddedInfoType.Status,
};
bytes.AddRange(idBytes);
// unk
bytes.AddRange(new byte[] { 0x01, 0x01, 0xFF, 0x02, 0x20, END_BYTE });
bytes.AddRange(idBytes);
// unk
bytes.AddRange(new byte[] { 0x01, 0x01, 0xFF, 0x02, 0x20, END_BYTE });
return bytes.ToArray();
}
return bytes.ToArray();
}
/// <inheritdoc/>
protected override void DecodeImpl(BinaryReader reader, long endOfStream)
{
this.statusId = GetInteger(reader);
/// <inheritdoc/>
protected override void DecodeImpl(BinaryReader reader, long endOfStream)
{
this.statusId = GetInteger(reader);
}
}
}