Make alterations to libzni

This commit is contained in:
Tara 2022-12-27 20:58:21 -07:00
parent 7b776ecfea
commit 0638f7e642
19 changed files with 1824 additions and 183 deletions

View file

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LibZNI.Serialization.ZNIFile
{
public class BoolTag : Tag
{
private bool BoolVal;
public bool Value
{
get
{
return BoolVal;
}
}
public BoolTag(string _Name, bool val)
{
Name = _Name;
BoolVal = val;
}
public BoolTag(bool boolVal) : this(null, boolVal)
{
}
public BoolTag() : this(null, false) { }
public override TagType Type
{
get
{
return TagType.BOOL;
}
}
public override bool ReadTag(BinaryReader br)
{
Name = br.ReadString();
BoolVal = br.ReadBoolean();
return true;
}
public override void Rename(string old, string newName)
{
throw new NotImplementedException();
}
public override void SkipTag(BinaryReader br)
{
_ = new BoolTag().ReadTag(br);
}
public override void WriteData(BinaryWriter bw)
{
throw new NotImplementedException();
}
public override void WriteTag(BinaryWriter bw)
{
bw.Write(((int)Type));
bw.Write(Name);
bw.Write(Value);
}
public override object Clone()
{
return new BoolTag(Name, Value);
}
}
}