Supercell.GUT/Supercell.GUT.Logic/Team/LogicTeamUnit.cs
BreadDEV 8c6a533918 [v0.0.2] you can enter menu now. but still early state
todo: improve code and finish base structures
2024-03-05 17:37:18 +07:00

54 lines
1.2 KiB
C#

using Supercell.GUT.Logic.Base;
using Supercell.GUT.Titan.Logic.DataStream;
using Supercell.GUT.Titan.Logic.Util;
namespace Supercell.GUT.Logic.Team;
public class LogicTeamUnit : LogicBase
{
public string Name { get; set; }
public LogicArrayList<string> Skills { get; set; }
public LogicTeamUnit() : base(0)
{
this.Skills = new LogicArrayList<string>();
}
public override void Destruct()
{
base.Destruct();
}
public override void Encode(ChecksumEncoder checksumEncoder)
{
base.Encode(checksumEncoder);
checksumEncoder.WriteInt(0);
checksumEncoder.WriteString(this.Name);
checksumEncoder.WriteInt(this.Skills.Size());
for (int i = 0; i < this.Skills.Size(); i++)
{
checksumEncoder.WriteString(this.Skills[i]);
}
checksumEncoder.WriteString(null);
}
public override void Decode(ByteStream byteStream)
{
base.Decode(byteStream);
}
public void SetSkill(string skill)
{
this.Skills.Add(skill);
}
public static LogicTeamUnit CreateDefaultUnit(int index)
{
return new LogicTeamUnit
{
Name = $"un_default{index}"
};
}
}