mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-10 07:44:37 +00:00
8c6a533918
todo: improve code and finish base structures
54 lines
1.2 KiB
C#
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}"
|
|
};
|
|
}
|
|
}
|