mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 13:23:40 +01:00
Implement service locator
This commit is contained in:
parent
06b1163a52
commit
ff1d7f2829
101 changed files with 1614 additions and 1436 deletions
|
|
@ -27,9 +27,9 @@ namespace Dalamud.Game.Text.SeStringHandling
|
|||
private byte[] encodedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Lumina instance to use for any necessary data lookups.
|
||||
/// Gets the Lumina instance to use for any necessary data lookups.
|
||||
/// </summary>
|
||||
public DataManager DataResolver { get; set; }
|
||||
public DataManager DataResolver => Service<DataManager>.Get();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of this payload.
|
||||
|
|
@ -45,9 +45,8 @@ namespace Dalamud.Game.Text.SeStringHandling
|
|||
/// Decodes a binary representation of a payload into its corresponding nice object payload.
|
||||
/// </summary>
|
||||
/// <param name="reader">A reader positioned at the start of the payload, and containing at least one entire payload.</param>
|
||||
/// <param name="data">The DataManager instance.</param>
|
||||
/// <returns>The constructed Payload-derived object that was decoded from the binary data.</returns>
|
||||
public static Payload Decode(BinaryReader reader, DataManager data)
|
||||
public static Payload Decode(BinaryReader reader)
|
||||
{
|
||||
var payloadStartPos = reader.BaseStream.Position;
|
||||
|
||||
|
|
@ -64,8 +63,6 @@ namespace Dalamud.Game.Text.SeStringHandling
|
|||
payload = DecodeChunk(reader);
|
||||
}
|
||||
|
||||
payload.DataResolver = data;
|
||||
|
||||
// for now, cache off the actual binary data for this payload, so we don't have to
|
||||
// regenerate it if the payload isn't modified
|
||||
// TODO: probably better ways to handle this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue