Worms4Editor/LibXom/Data/XomString.cs

53 lines
1.1 KiB
C#

using LibXom.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibXom.Data
{
public class XomString : XomFileComponent
{
private string value;
public override int Id
{
get
{
return this.fileBelongs.calculateIdForXomFileComponent(this.uuid, fileBelongs.XomStrings) - 1;
}
}
public string Value
{
get
{
return this.value;
}
set
{
this.value = value;
fileBelongs.updateStringById(this.Id, this);
}
}
public int Length
{
get
{
return Encoding.UTF8.GetByteCount(this.Value);
}
}
public override string ToString()
{
return this.Value;
}
internal XomString(XomFile fromFile, string value)
{
this.fileBelongs = fromFile;
this.value = value;
}
}
}