Class ZoneArchitecture
- Namespace
- LlamaLogic.Architecture
- Assembly
- LlamaLogic.Architecture.dll
Provides access to the architecture of the lots of a zone in a save game: the architecture_data field of the EA.Sims4.Persistence.ZoneObjectData protobuf message, the content of a ZoneObjectData resource
public static class ZoneArchitecture
- Inheritance
-
ZoneArchitecture
- Inherited Members
Remarks
architecture_data is a repeated field parallel to the message's objects field, and active_data_index selects the entry in use.
Most zones have one entry, some have none, and a few have several.
These methods read and replace only that field's entries in the message's bytes and copy everything else verbatim, so they never re-serialize the rest of the message.
Methods
GetArchitecture(ReadOnlyMemory<byte>)
Gets the architecture of each entry of the architecture_data field of a ZoneObjectData message, or null for an empty entry
public static IReadOnlyList<LotArchitecture?> GetArchitecture(ReadOnlyMemory<byte> zoneObjectData)
Parameters
zoneObjectDataReadOnlyMemory<byte>
Returns
Exceptions
- InvalidDataException
The data is not a well-formed protobuf message, or an entry is not a well-formed lot architecture
GetArchitectureData(ReadOnlyMemory<byte>)
Gets the content of each entry of the architecture_data field of a ZoneObjectData message: a record bundle, or nothing
public static IReadOnlyList<ReadOnlyMemory<byte>> GetArchitectureData(ReadOnlyMemory<byte> zoneObjectData)
Parameters
zoneObjectDataReadOnlyMemory<byte>
Returns
Exceptions
- InvalidDataException
The data is not a well-formed protobuf message
SetArchitecture(ReadOnlyMemory<byte>, IReadOnlyList<LotArchitecture?>)
Gets a ZoneObjectData message with each entry of its architecture_data field replaced by the encoding of the corresponding architecture, or emptied where it is null
public static ReadOnlyMemory<byte> SetArchitecture(ReadOnlyMemory<byte> zoneObjectData, IReadOnlyList<LotArchitecture?> architecture)
Parameters
zoneObjectDataReadOnlyMemory<byte>architectureIReadOnlyList<LotArchitecture>
Returns
Exceptions
- InvalidDataException
The data is not a well-formed protobuf message
- ArgumentException
The number of entries of
architecturediffers from that of the message's field- InvalidOperationException
An architecture cannot be encoded as it is
SetArchitectureData(ReadOnlyMemory<byte>, IReadOnlyList<ReadOnlyMemory<byte>>)
Gets a ZoneObjectData message with the content of each entry of its architecture_data field replaced by the corresponding architectureData
public static ReadOnlyMemory<byte> SetArchitectureData(ReadOnlyMemory<byte> zoneObjectData, IReadOnlyList<ReadOnlyMemory<byte>> architectureData)
Parameters
zoneObjectDataReadOnlyMemory<byte>architectureDataIReadOnlyList<ReadOnlyMemory<byte>>
Returns
Exceptions
- InvalidDataException
The data is not a well-formed protobuf message
- ArgumentException
The number of entries of
architectureDatadiffers from that of the message's field