Make alterations to libzni
This commit is contained in:
parent
7b776ecfea
commit
0638f7e642
19 changed files with 1824 additions and 183 deletions
72
Serialization/ZNIFile/IntTag.cs
Normal file
72
Serialization/ZNIFile/IntTag.cs
Normal file
|
@ -0,0 +1,72 @@
|
|||
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 IntTag : Tag
|
||||
{
|
||||
|
||||
public IntTag() : this(null, 0)
|
||||
{ }
|
||||
public IntTag(int Value) : this(null, Value)
|
||||
{
|
||||
}
|
||||
public IntTag(string _Name, int Val)
|
||||
{
|
||||
this.Name = _Name;
|
||||
IntVal = Val;
|
||||
}
|
||||
private int IntVal;
|
||||
public int Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return IntVal;
|
||||
}
|
||||
}
|
||||
public override TagType Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return TagType.INTEGER;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ReadTag(BinaryReader br)
|
||||
{
|
||||
Name = br.ReadString();
|
||||
IntVal = br.ReadInt32();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override void SkipTag(BinaryReader br)
|
||||
{
|
||||
_ = new IntTag().ReadTag(br);
|
||||
}
|
||||
public override void WriteTag(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(((int)Type));
|
||||
bw.Write(Name);
|
||||
bw.Write(Value);
|
||||
}
|
||||
|
||||
public override void WriteData(BinaryWriter bw)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override void Rename(string old, string newName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override object Clone()
|
||||
{
|
||||
return new IntTag(Name, Value);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue