/// <summary> /// Initalize the container /// </summary> /// <param name="defaultValues">A struct containing the default values for this container</param> /// <param name="workingFileBuffer">A handle to the file buffer in which this container represents a stat</param> public StringStatContainer(InitalizationStruct defaultValues, PrincessMakerFileBuffer workingFileBuffer) { attachedBuffer = workingFileBuffer; this.statId = defaultValues.statID; this.sizeInMemory = defaultValues.size; this.offset = defaultValues.offset; this.maxSize = defaultValues.maxLength; this.minSize = defaultValues.minLength; this.statType = StatTypes.String; stringAsBytes = attachedBuffer.ReadAtOffset(offset, sizeInMemory); }
public UInt16StatContainer(InitalizationStruct defaultValues, PrincessMakerFileBuffer workingFileBuffer) : base(defaultValues, workingFileBuffer) { byte[] intAsBytes = workingFileBuffer.ReadAtOffset(offset, 2); currentValue = BitConverter.ToUInt16(intAsBytes, 0); this.statType = StatTypes.UInt16; }